Skip to content

The format, unit and statement-shape regression checks pass - #1706

Merged
zlareb1 merged 6 commits into
mainfrom
fix/ci-adoption-page-format
Nov 30, 2026
Merged

zlareb1 merged 6 commits into
mainfrom
fix/ci-adoption-page-format

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Changelog category

  • CI Fix or Improvement

Why

The format job rejects the adoption page assignment. The unit suite also flags the grep docstring cap and an outdated fingerprint for the Python SDK memory module. The statement corpus still has the old memory.for_file projection.

Scope and risk

Wrap the adoption page assignment as the pinned formatter expects. Derive the grep header page budget from four docstring excerpts so the fixed layout has one source for its cap.

The Python SDK change that prompted the fingerprint mismatch parses search response metadata. The census still identifies the same sender call sites and request bodies. Update the fingerprint for that module.

The memory.for_file query selects created_at for first_written. Regenerate its statement snapshot from the current builder.

Compatibility, rollout and rollback

No wire or configuration changes. No operator steps or data migration. A revert restores the prior formatter input, grep budget declaration, fingerprint, and statement snapshot.

Tests

  • make format and make format-check
  • make lint and make typecheck
  • python -m pytest -q tests/unit/test_tunable_constants.py tests/unit/test_code_grep_definition_headers.py tests/unit/test_session_content_senders.py tests/unit/test_doc_links.py tests/unit/test_public_copy.py
  • python -m pytest -q tests/analyzer/test_corpus.py -k "every_case_renders or no_drive_calls or every_axis_moves or shapes_file_matches"
  • Each failure reproduced before its fix. The same checks pass locally with the patch.

AI assistance in the code

  • AI-generated by Codex. The review checked the formatter output, header line budgets, the SDK sender census, and the regenerated statement shape.

Checklist

  • Local format, lint, type checks and focused tests pass.
  • Commits are signed off.

Note

Medium Risk
Plugin hook behavior changes (test gate timing, shunt deny semantics) affect every indexed-repo session; default stop gating is looser unless LOOM_TEST_GATE=block.

Overview
Documentation and plugin releases (1.2.67 → 1.2.69) align with behavioral changes in the Claude/Codex plugins and the memory/code APIs.

The test gate now surfaces linked test commands when a file first changes (PostToolUse on Bash/PowerShell, and on edit via loom-blast-radius), not only at session stop. Default stop behavior passes if any recognized test runner ran after the last code change; LOOM_TEST_GATE=block suppresses edit-time hints and only blocks stop when pytest-style runs match the named tests. Hooks, README, and HOOKS.md document the new flow.

The code shunt embeds index answers in denials (code.outline / code.symbol text) instead of naming ops to call; directory greps and compound shell commands are no longer denied; ranged-read caps return declaration outlines. LOOM_SHUNT_READ_CAP docs now say "denied with declarations."

Memory/code read docs add rev, first_written, unlinked, and code_note (indexed repo vs checkout) on lessons, search, memory.for_file, and review brief rationale rows.

docs/pages/adoption.astro splits a long directoryRefresh assignment across lines for the Biome formatter (CI format fix; logic unchanged).

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

Wrap the directory refresh condition as the pinned formatter expects.

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 12:58pm UTC
loom-telemetry Ready Ready Preview Nov 28, 2026 12:58pm UTC

Request Review

zlareb1 and others added 3 commits November 28, 2026 17:38
… refusal names the scope it would have shown (#1689)

* The plugin's code shunt never refuses a compound shell command, and a refusal names the scope it would have shown

A refusal costs the agent a model request and withholds what the call
would have printed. The shunt refused a three-part command for one of its
parts, a grep for a local variable the index holds no definition of, and
its read refusals named an op to call instead of carrying that op's
answer.

- A Bash command of several parts (a `;`, `&&`, `||` or newline list, or
  a pipeline) is never refused. Its reads and greps are still counted as
  passes (`compound_command`), with no lookup and no denial budget spent.
  A `gh` issue search inside such a command runs.
- A refusal is given only with the index's answer in full. A symbol grep
  is refused when `code.symbol` returns exactly one definition and the
  caller's lines from modified files fit; a read when `code.outline`
  returns every declaration of the lines asked for within its budget.
  Otherwise the call runs (`index_unanswered`).
- A read refusal lists those declarations: lines, qualified name, header.

`code.outline` is now sent by a hook with a session-derived path, so it
joins the session-content class like `code.symbol` and `code.enclosing`,
and its reach gains the plugin hook. Both plugin manifests are 1.2.65.

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

* The code shunt refuses a whole-file read with an outline of up to 4,000 tokens

The outline behind a read refusal is asked for with a 4,000-token budget.
Against a running index of a large C++ repository, the hook's own request
for 301 files over 800 lines returned the whole outline of 52 files at
1,500 tokens and of 187 at 4,000, in at most 8,351 characters of
declarations; an outline costs a median 2.2 budgeted tokens per file line.

A whole file the index did not outline is asked about once per session:
the miss is kept beside the denial budgets, so a repeated read of it makes
no second lookup.

A `gh` issue search followed by `&` is not judged. Inside a command of
several parts, a grep that alone would be a symbol lookup is counted as
compound_command, as a read is. The tokens_saved of a hit is net of the
refusal's own text.

Both plugin manifests are 1.2.67.

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

* The reviewed digest of the code shunt hook matches its source

The hook sends the same ops with the same session-derived fields as
before: `code.outline` with a path and a larger constant budget,
`code.symbol` with a name, `code.outcome` with counts. The pinned digests
of both plugins' copies are renewed.

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

* A refused tail slice lists the declarations of the file's last lines, and a read refusal says which kinds it lists

`tail -n N file` carries a length and no start, and the hook read the
missing start as line 1: over the read cap, `tail -n 300` of a 900-line
file was refused with the declarations of lines 1-300. The hook now counts
the slice back from the file's last line, so the refusal names lines
601-900 and lists what is declared there.

A budget spend another hook of the session records while this one waits
for `code.outline` is kept: the counts file is read again for the write,
for the miss record and for the read cap's spend.

The refusal's list holds the kinds `code.outline` lists by default. A
TypeScript interface, type alias, enum or constant is not among them, so
the refusal now says what it lists instead of calling the list the file's
declarations.

Text only: the 8,400-character refusal is stated as the longest measured,
not as a limit of the 4,000-token budget; a whole file whose lookup was not
answered is also asked about once per session, which the comments and docs
now say; and the docs no longer list a grep over a directory as denied.

The hook sends the same ops with the same fields, so its reviewed digest is
renewed for both plugins' copies.

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

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
… when it was written and whether it was checked against this checkout (#1691)

* A memory hit that names code says which revision and date it was made against and whether it was checked against this checkout

A search hit that names a file and holds no code link read exactly like
one whose code is current: `code_state` was empty for both, the commit a
linked hit was anchored at was served nowhere, and a hit's date reached
only the context pack line. Line numbers written into a memory were
served as written whatever its link state.

`code_change` now gives each reader the same facts. A hit read from a
memory's own row that holds no link and whose text names a file by a path
with a directory is `unlinked`. A linked hit carries `code_rev`, the
commit its worst link was anchored at. Every line that renders a memory
with a code state carries `code_state=<state>`, `rev=<commit>` when it
holds a link, and its date where the line shows none: the reader block,
loom_search's plain lines, context.pack memory and decision lines,
memory.for_file rows and code-answer lessons. A reply that serves an
unlinked or changed memory says once that those memories were not
checked against the caller's checkout (`code_note` on memory.search and
the first line of each rendered block); a reply whose memories are all
fresh says nothing. A memory that is not fresh is shown without the line
numbers its text gives: the stored value is untouched.

A hit that names no code renders byte for byte as before, and `unlinked`
moves no hit in the ranking.

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

* A parked search page stores no unlinked label, and a read says what Loom compared and serves a memory's text as stored

`unlinked` is a value the previous build's hit model refuses, and the tail a
search parks was annotated with it: a later page answered by that build during
a rolling upgrade dropped every such hit. A page now stores a link state or
none, and the page that serves a hit labels it again with the predicate the
search uses.

No read rewrites a memory's text. The line numbers a memory gives were removed
for every state but `fresh`, `unlinked` included, which is the state of every
path-naming memory where no repository is indexed, where its link is pending,
and where its link is in a repository the caller may not read. Every surface
serves the stored text again; the patterns that removed the numbers also took
words a sentence needs and ran in more than quadratic time on a long run of
spaces.

The sentence a reply carries says what was compared instead of naming a
checkout no read sees: no comparison is shown for an unlinked memory, and
`code_state` and `rev` describe the repository as indexed. It is served for
any code state, a fresh one included, one clause per state present.

The day printed beside a code state is the write day on every surface, as
`written=`: a search hit's `created_at`, a row's `updated_at`. `context.pack`
keeps `date=` for the date its text is about. Symbol lessons read
`updated_at` and carry `written` too, and a `loom_search` structured hit that
names code keeps its `created_at`.

`MemorySearchOutput.code_note` is set when the output is built, so the model
and its dump agree and a dump that leaves `code_state` out of its hits no
longer raises.

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

* The day beside a code state is the row's creation day, which an unpin, a lock or a label does not move

memory.for_file lines, path and symbol lessons and the startup recall printed
`updated_at` as `written=`. Unpin, lock, unlock, restore and label stamp that
column without writing the text, so an old claim could read as written
yesterday. Those reads now print `created_at`, as a search hit does; the docs
say what that day is on each read.

- A search whose link read fails still labels a hit that names a file
  `unlinked`, as its later pages do.
- A decision found on several paths carries the anchor commit of the link in
  its worst state, and a review brief's rationale section says once what its
  rows' code states were compared with.
- `names_file` reads the path pattern alone, and only in a text with a slash.
- A block takes the room for the sentence from the row that prints with it,
  so a row left out no longer keeps that room from the rows after it.

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

* A read of a memory's row labels its day first_written, and written is the day of a search hit's text

A search hit's day is its search document's, which a write of the text and
a restore stamp again, while memory.for_file, a lesson and the startup
recall read the row's creation day, which no later write moves. Both printed
as `written`, so the label had two meanings for a memory whose text was
written again. The row reads print `first_written=<day>`, and a lesson
carries the field `first_written`; a search hit keeps `written=<day>`. No
column and no read is added.

A test builds the revision of a row and asserts the day and its label on the
memory.for_file line, the lesson and the search hit.

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

* The memory.for_file ceiling check charges a decision or constraint the sentence it prints with

render_block charges a row that names code what the sentence on what was
compared grows by, and the check that decides whether a "… more" line needs
room measured a decision or constraint by its line alone. One within that
sentence of the ceiling was counted as printed and then left out; the older
row it supersedes went with it, and the "… more" line counting that row was
added to a block that had reserved no room for it, past token_budget.
_ceiling_hides charges each such row as the loop does.

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

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…ds the end of a session only when the session ran no test since its last code change (#1696)

* The test gate tells the agent which tests constrain an edited file when it edits it, and no longer blocks the end of a session by default

The Stop test gate decided from a transcript's shell text whether the
tests it names had run, and blocked the stop when it could not tell. In
two recorded benchmark runs of one task it blocked 8 of 29 sessions with
the plugin installed, and each of the 8 had run the named tests: with a
whole-suite run that had failures, between `git stash` and `git stash
pop`, before a `git checkout` of another file, behind `grep FAILED`, or
beside a quoted `\|` in a grep pattern. A block costs one more model
request and reply. The run after the last round of parsing rules blocked
5 of 15 sessions, against 3 of 14 before it.

The gate no longer reads shell text by default. When a session first
changes a file in an indexed checkout, the tool call that changed it
comes back with one line of additional context naming the command of the
tests `code.test_gate` links to that file:

    Loom: tests the index links to src/a.py: .venv/bin/python -m pytest tests/test_a.py

The line is attached once per file per session and costs no model
request. After a Bash or PowerShell command it comes from
`loom-test-gate.mjs`, for each dirty file the command names that was
written since the session began. After Edit, Write or MultiEdit it comes
from `loom-blast-radius.mjs`, the one hook wired for those tools, where
it replaces the radius's own count of tests, so an edit gets one line.
An edited test file names nothing, and neither does a comment-only
change. The stop is not held.

`LOOM_TEST_GATE=block` keeps the blocking gate as it was and prints
nothing at edit time. `LOOM_TEST_GATE=off` turns both off. No parsing
rule became unused: the blocking gate still reads them all.

The Codex plugin wires the same hook after its shell tool. Both plugin
manifests move to 1.2.65.

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

* The edit-time tests line names a changed test's own command and names each test once per session

The line named only the tests the index links to a changed file, so an
index that links a source file to no test said nothing about a change to
that file and its test: the blocking gate's ask for such a change is the
changed test itself. That is the case in the recorded runs, whose index
holds no test-map row.

A changed test file with a known runner names its own command, as the
blocking gate does. A test is named once per session, so a session that
edits a source file and then the test the index links to it gets one
line, not two with the same command. A file under a tests directory
that no runner takes names nothing.

The line reads `Loom tests for <file>: <command>`, which holds for both
cases.

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

* The test gate's docs example names no particular project

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

* The edit-time tests line names the functions the index links no test to, and not a test the command itself ran

A changed source file the index links to no test got no line, and the
stop is no longer held, so a session that changed source and added or
ran no test was told nothing. The line now names the changed functions
for a file that has no test to run in the checkout: `Loom tests for
<file>: the index links no test to <functions>`, worded as the index's
view, once per file.

A test whose command the call's own command holds is not named: the
line arrived on the result of that very run. Only the tests a line
printed count as named, so one folded into "(+N more)" is still named
when its own file changes. The blast radius leaves its count of tests
out only where the line names tests for the edited file, not for
another file of the same call.

After a shell command, a checkout the shared cache says is not indexed
costs no git call: the root is found by its `.git` entry.

The docs say that a file is asked about at its first change only, the
hook tables name each row's off switch again, and both manifests take
1.2.69.

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

* By default the test gate holds the stop of a session that changed code and ran no test since

The default no longer held any stop, so a session that edited source and
ran no test ended unasked: with every test run taken out of the 29
recorded sessions, none was held. The measured fault was narrower: the
gate read from shell text which tests ran and how they went, and held
sessions that had run them.

At Stop the default now runs the blocking gate's steps with one earlier
exit: any shell command that starts a test runner and finished no earlier
than the oldest write among the session's changed files lets the stop
pass, before anything is asked of the server (`testedSince`,
`oldestChange`). The command is read for a runner's name only, in a Claude
Code transcript or a Codex rollout; its output is not read. A session
that ran none is held once per distinct change with the gate's reason.
With no transcript the default holds no stop. `LOOM_TEST_GATE=block`
keeps the stricter reading and names nothing at edit time.

At edit time:

- A file the server gave no answer for stays unasked for one more call
  that names it; it was marked as asked before the request, so one
  timeout silenced it for the session.
- A test is left out of the line only when the call's command runs its
  whole command in this checkout. A substring match also dropped it for
  `pytest tests/test_a.py::test_one`, `docker exec app pytest
  tests/test_a.py` and `echo "pytest tests/test_a.py"`.

The malformed-input test starts the gate after a shell command and in
both Stop modes.

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

* By default the test gate holds the stop of a session that ran no test since its last code change

The default Stop compared the last test run with the oldest write among
the session's changed files, so a session that edited one file, ran a
test and then edited a second code file was not held.

- The run is compared with the newest write among the changed code files
  (`lastCodeChange`). A file that is documentation or prose by its name
  (`.md`, `.mdx`, `.rst`, `.adoc`, `.txt` other than `CMakeLists.txt` and
  a requirements file, or a `CHANGELOG`, `CHANGES`, `HISTORY` or `NEWS`
  file) is left out, so a note written after the run holds nothing. A
  deleted file is left out too, as before.
- A build tool counts as a test run only when `test` follows no letter in
  one of its arguments: `npm install x@latest`, `go install y@latest`,
  `make latest` and `node scripts/attest.js` no longer count, and
  `make test-unit`, `npm run test`, `node --test`, `go test ./...` and
  `gradle :app:test` still do. `nextest` is named as a runner, so
  `cargo nextest run` still counts.
- A Codex rollout's shell call is read as its command text. Its
  `arguments` JSON can hold an argv such as `["go","test","./..."]`,
  whose words no space joins, so a build tool's run was not seen there.

`LOOM_TEST_GATE=block` is unchanged.

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

* A package install or a Codex shell call under another name does not decide the default Stop wrongly

- A build tool counts as a test run when `test` or `tests` follows no
  letter and no lower-case letter follows it. `npm install
  @testing-library/react` and `go get github.com/stretchr/testify` do not
  count; `make test-unit`, `make unit-tests`, `gradle :app:test` and
  `gradlew testDebugUnitTest` do.
- `testedSince` takes a Codex rollout's shell call under each name
  `normalizeToolName` folds onto Bash (`shell_command`, `local_shell`,
  `container.exec`), not only `exec`, `exec_command` and `shell`: a
  session that ran its tests through one of those was held.
- The Claude Code page's paragraph on what the hooks run locally says
  what the plugin README says of the test gate; a unit test keeps the two
  equal.
- The sender census pins `lib/repo-scope.mjs` of both plugins at its
  current content. The file gained `cachedUnindexed`, which reads the
  shared cache and sends nothing; its three reviewed call sites are
  unchanged.

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

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Derive the grep header budget from the fixed excerpt size. Refresh the reviewed SDK sender fingerprint after the response parser change and regenerate the memory.for_file statement shape for its creation timestamp.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1 zlareb1 changed the title The adoption page passes the format check The format, unit and statement-shape regression checks pass Nov 28, 2026
@zlareb1
zlareb1 merged commit 0dfc875 into main Nov 30, 2026
126 of 127 checks passed
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