Skip to content

Run the extended CodeQL suite on a weekly schedule - #1256

Merged
zlareb1 merged 512 commits into
mainfrom
ci/codeql-extended-schedule
Nov 30, 2026
Merged

zlareb1 merged 512 commits into
mainfrom
ci/codeql-extended-schedule

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or Improvement

Why

The default security suite prioritizes high-precision findings. A weekly extended suite adds lower-confidence security queries for review without adding analysis to every pull request.

Scope and risk

The extended suite scans server, dashboard and TypeScript SDK source in a separate analysis category. Workflow changes run both language jobs with read-only permissions and report counts by rule in the job summary. Findings may include more false positives than the default suite.

Only scheduled or manual execution on the owning repository's default branch uploads SARIF to GitHub Security. The pull-request path cannot upload findings. Step debugging is refused, missing reports or malformed result structures fail the job, and the summary omits finding messages, source paths and locations.

Both language jobs use standard public-repository runners with forty-five-minute limits and pinned actions. Database uploads, dependency caching and report artifacts are disabled. No paid service, separate account or application behavior change is added.

Compatibility, rollout and rollback

  • Wire: no operation or request/response field changes.
  • Operator steps: none. The weekly schedule starts after merge.
  • Rollback: revert the workflows to stop future scans.

Tests

  • Workflow schema, expressions and embedded shell checks pass with actionlint and ShellCheck.
  • The pinned formatter accepts both workflows, and git diff --check passes.
  • Report input cases cover valid findings, no findings, malformed runs, malformed results and missing or invalid rule identifiers. The rendered synthetic summary excludes finding details. Hosted analysis and full-project qualification results are reported in the pull request checks.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated with Codex. Reviewed the query scope, token separation, summary projection, tool inputs and execution limits.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, workflow lint and focused checks pass. Full project tests run in CI.
  • Commits are signed off.

@vercel

vercel Bot commented Nov 23, 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 30, 2026 6:48pm UTC
loom-telemetry Ready Ready Preview Nov 30, 2026 6:48pm UTC

Request Review

zlareb1 and others added 29 commits November 26, 2026 17:50
* Complete grep excerpts at the verified indexed revision

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep enrichment deadlines local to each page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Use the qualified caller and source location to recognize one call site across the parser and compiler index. Keep both symbol IDs for reading incoming test edges.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Match the main test environment and give the dependency graph a fresh lockfile to scan.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Adoption telemetry includes contact domains by default

Use eligible namespace contacts from password and federated accounts so deployments can report aggregate domain activity across sign-in methods.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The adoption report test counts password contacts

Exercise the expanded contact scope in the live report test, including requests attributed to a password account.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Keep fresh lessons for verified forwarding callers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep distinct verified caller lessons eligible

Select fresh links before reading a limited set of excerpts. Use the complete excerpt to distinguish lessons written under a shared key.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require fingerprint proof for verified caller lessons

Restrict exact-revision lesson reads to compatible, nonempty fingerprint comparisons. Ordinary symbol reads keep their existing state fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Verify restored caller lessons against their original source

Trust the checked hash only while its stored link still identifies located code. Keep ordinary symbol reads on their existing fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Readers can check a cross-client handoff, a code-linked lesson and the SQL audit before choosing a team setup.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Preserve Python member reads when SCIP is indexed

Resolve typed reads from the parser candidates in the same name query so a compiler ID for the same member cannot displace its parser edge.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Retain compiler-only Python member candidates

Prefer parser candidates per qualified name so a compiler-only member with the same short name remains readable.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Name agent memory capabilities in documentation search titles

Put each page’s task in its title and description so it makes sense outside the sidebar.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Distinguish request IDs from worker query tags in telemetry metadata

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Show how edit context returns a caller’s saved lesson

A coding agent can read the constraints that apply at a forwarding call before changing its dependency.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* State the source and access requirements for caller lessons

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Add an evaluation checklist for choosing coding-agent memory

Teams can use their requirements to choose a starting setup and copy the checks into a pilot.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require authenticated writes in the selector’s SQL audit check

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ty (#1549)

Repository-job git reads no system or global git config and inherits no
environment beyond PATH, HOME, LANG and TMPDIR, so neither `http.sslCAInfo`
in a git config nor GIT_SSL_CAINFO or SSL_CERT_FILE reaches it: it verifies
with the image's default roots, and a git server whose certificate a private
authority issued fails every clone with "server verification failed:
certificate signer not trusted". The one setting that hands git a bundle,
LOOM_CODE_GIT_PROXY_CA_FILE, applies only through a forward proxy.

The new setting names a PEM bundle that `auth_env` passes to every repository
job as `http.sslCAInfo`. Through the proxy, LOOM_CODE_GIT_PROXY_CA_FILE is
appended after it and wins when set, so proxied deployments behave as before.
A deployment that does not set it is unchanged.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…t changes (#1551)

* A refused compiler-tier delta holds its tier until a cap or the target changes

A delta tier whose delta `open_delta` refused (over a cap, a link, not a
regular file) recorded the failure and left its watermark, so every pass
ran the full harness again at the same commit and was refused the same way.

The tier now keeps the refused target and the delta caps in effect. While
both match, the next pass skips the entry before the checkout moves and the
failing record keeps its fix. A raised cap, a live setting, or a new branch
head releases it on the next pass. A delta that changed while it was read
holds nothing. The C/C++, TypeScript, Python and Go delta tiers share it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refusal hold records the caps its open read

The hold sampled the delta caps after `open_delta` failed, so a cap raised
while the open ran was recorded as the one the delta was refused under: a
1.5 MB delta refused at a 1 MB cap that was raised to 2 MB stayed held at
2 MB, where it opens.

`delta_caps` now reads the three caps once; `open_tier_delta` passes that
snapshot to `open_delta` and records the same one in the hold.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
)

* CLI backfill phases republish the namespace's counts and coverage

`code.index_status` and `code.repos` read `chunks_embedded` and
`embedding_coverage` from the shared `table_counts` row, and the Repositories
page reads per-language coverage from the shared `coverage` row. The ingest
pass republishes both after it moves rows; `loom code backfill` moves rows
outside it. A reader serves the counts row whatever watermarks it was computed
at, so after `--phase embed` status kept reporting the pre-embed coverage
(`embedding_coverage: 0.0`, `searchable: false`, `code.search` answering
lexically) until an ingest pass moved the namespace's rows again. Embedding
moves no watermark, so the coverage row stayed current to its readers as well.

Each phase that wrote something republishes both rows at its end, as the
ingest pass does. A failed refresh is printed and does not fail the finished
phase.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the counts at every phase end

The republish ran only when this run's own counters were nonzero. A resumed
index whose cursor was already at the end, or an embed phase whose last page
landed before the process died, wrote its rows in an earlier process and so
left the pre-backfill `table_counts` row in place. Both phase ends now
republish unconditionally; a republish is one query per row.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The embed phase republishes the counts only for an org it declared

An embed phase with nothing pending republished without declaring its org, so a
mistyped --org wrote counts and coverage rows that the cell never gated. With
nothing pending, the phase now declares and republishes only a namespace that
already has a counts row; a mistyped org has none and writes nothing.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A full index run republishes the counts after its watermark

The full-run path republished in `_close_index`, before it wrote `git_head`.
Both rows carry the counts fingerprint, `git_head` included, so `code.coverage`
rejected the new coverage row and the next reader ran the aggregates again. A
full run now republishes after the watermark and the backfill stamps; a hold,
a repair and a twin label write no watermark and republish in `_close_index`
as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…ured output (#1311)

* The Anthropic client sends a JSON Schema as the Messages API's structured output

A json_schema response format was dropped, so the conflict resolver's Claude answers came back in a shape parse_verdicts could not read and every judgement failed while still being billed. The schema now goes in output_config.format and into the JSON directive, which keeps the shape when a model refuses output_config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A refusal of one output_config key drops that key alone

A 400 naming output_config.effort recorded a refusal of the whole output_config, so later schema requests to the same model lost output_config.format. traits.refused_key records output_config.effort or output_config.format on its own, and the Anthropic client leaves the other key in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A rejected schema drops the format for that request alone

A 400 that points inside the sent schema (output_config.format.schema...)
rejects that schema, not the model's structured output. The call is re-sent
without the format and nothing is remembered for the model, so later
requests still send their schema. Refusals of output_config.format itself
are still learned per model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

---------

Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
`loom code backfill --phase embed` failed on a ClickHouse at its default
`http_max_field_value_size` (128 KiB) with "HTML Form Exception: Field value
too long". `pending_embed_chunks` asks phase 1 for four times the page size
(2,000 keys for the CLI's page of 500) and bound every (path, chunk_id) pair
as one form field in the phase-2 FINAL read; at ordinary path lengths that
list is several hundred KiB.

Phase 2 goes through `query_all_sliced`, as other keyed reads do. Each slice
keeps its own oldest `limit` rows and the slices' rows are ordered and capped
together, so the page is the oldest-first page one statement would return.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Format the coding-agent memory selector page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings

Resolve local actions from the workflow commit, verify translations from a scheduled job, install npm packages from lockfiles, and validate each docs destination as a parsed link.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Include the selector page in the IndexNow route test

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Pin the coverage action to its full commit SHA

The plugin scanner requires a full SHA for action references it treats as remote.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep queued translation requests during scheduled checks

Finalizer polls and translation batches share one queue. Keep pending requests available while the current run finishes.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
List domains with successful requests over 90 complete days. Use report version 2 to keep domains collected under the private notice out of the public list.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Replay how Loom memory follows source edits

Show branch-specific lesson states from a recorded comparison and let readers repeat the evaluation on a disposable hosted runner.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scope evaluation cleanup to its server job

Finish the fork instructions and apply the site formatter.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Keep pytest node paths out of code anchors

A pytest command can make a file extension look like a qualified symbol. Skip selectors with explicit Python paths so a note can link the declarations it names.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Handle class-only and nested pytest node selectors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A context window that starts at the function declaration hides decorators that still belong to the test. Reuse the retained chunk to prove the decorator prefix and stay within the requested radius.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A page offset belongs to the original file selection. Bind that scope before reading the saved pool or retrying the query.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A compiler call and a parser read at the same location describe different relationships. Collapse the rows only when their kinds agree.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A page offset belongs to the results selected by the original filters. Verify those filters before serving a saved page or rerunning the search.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Single-target edit context returns verified member source

Agents can use one exact name and get the same revision-verified member source as a one-name batch.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Describe member sources for both edit context forms

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
When a relative spelling omits a source directory, look up the symbol on the one live indexed file with that complete suffix. Keep an existing path as the lookup boundary and leave ambiguous suffixes unresolved.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Edit batches share verified test source reads

Reuse a verified source window when several named targets cite the same test. Keep each citation and deadline and drain pending reads before the batch exits.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bound shared edit example reads

Apply the enrichment deadline to the shared source read. A later waiter can retry after a stalled read reaches its deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Single-file lessons verify the commit while reading source

A successful bounded local blob read proves that the mirror holds the pinned commit. Use one Git process for that case and keep the mirror availability check when the local read cannot supply the file.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lesson reads share one parse deadline

The fallback spends only the source-read time left after a local miss. Keep the mirror availability check and bound both paths with the same deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* A code namespace erasure deletes the cached code.ask answers asked in it

The erasure step for cached code.ask answers deleted only those that quoted the
erased namespace's memories (`memory_namespace`). An answer asked in the erased code
namespace carries the repository's code in its text and was left in
`loom.code_answers`, uncounted by the residue census. After a re-index of the same
commit it was served again, since the cache invalidates only when a cited file changes.

The step and the census now match a row by `namespace` as well as `memory_namespace`.
The delete stays a lightweight delete read sequentially, and the census still skips a
tombstone that holds no text.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Align the answer-cache erasure docs and comments with the changed step

The architecture doc still said an answer drawn from the code index alone stays;
a namespace erasure now deletes it with the code namespace it was asked in. The
module docstring of the answer-cache erasure tests, the `namespace_tables`
docstring and one test docstring described the old predicate, and the comment on
`KEEP_TABLES` now says only what is not purged there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Guard every cached answer against an erasure, not only memory-quoting ones

An ask can finish synthesizing after the namespace delete and the final
census. The answer cache skipped its erasure check when the answer quoted no
memory, so a code-only answer could land in the erased namespace. Run the
before-and-after write guard for every answer, and delete a code-only answer
that lands after the mark by its own key.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* An abstain's negative cache entry is guarded against an erasure and counted by its census

An abstaining ask that overlapped a namespace delete could recreate its cached
question afterwards: the negative entry was written without the erasure check,
and the census skipped it because its answer and citations are empty. The
negative write now runs the same before-and-after guard as a synthesized
answer, and the namespace census counts a row that holds a question.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refresh the analyzer shapes and the tombstone sentence for the code-only guard

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
zlareb1 and others added 28 commits November 30, 2026 19:34
…nverified, not dropped (#1811)

A code tool call that names a code namespace with a longer or shorter commit
hash resolves to the one such namespace the caller reads. The gate kept only
whether each candidate's read check admitted the caller, so a check that could
not run (a grant or classification read failed) looked like a refusal:

- with one candidate, the caller got UNKNOWN_NAMESPACE with the candidate among
  the suggestions, ledgered as the caller's mistake, so an outage of those reads
  left the request SLO green;
- with two candidates, the call ran on the other one, where two working checks
  refuse the name as ambiguous.

The gate keeps both halves of each check. When any candidate's check could not
run, the call resolves to none of them, the refusal is the one an unconfigured
name gets and suggests no unchecked candidate, and its ledger row counts against
the server.

Tests: the read-check stub is one helper, a tracker tool joins the list of tools
checked on the resolved namespace, the tool result is asserted to carry
`namespace_resolved`, and one test runs the gate's own read check on a
restricted index and an unreadable classification. docs/reference/mcp.md states
the two existing limits of the rule: any trailing hexadecimal run counts as a
hash, and a token whose claim covers every namespace is never resolved.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Modern Yarn reads its own proxy settings for registry requests. Point those settings at the relay that already handles networked jobs.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…arts no git call, SessionEnd is handed off, a pytest command is named only where the checkout runs pytest, and the stop-time test gate holds a stop only when the install asks for it (#1794)

* A Loom session waits on a hook only when the hook has something to add, and the stop-time test gate is opt-in

The Claude Code plugin waited, on every event, for work that returned
nothing in the common case, and one hook made the model work by policy.

- The test gate holds no stop unless the install asks for it (the
  `stop_test_gate` option, or LOOM_TEST_GATE=stop). The tests of an
  edited file are still named on the edit. A pytest command is printed
  only where the checkout configures pytest for the test; elsewhere the
  tests are listed by path.
- Before a shell command the host starts no hook unless the command runs
  `gh` (the handler's `if`), so a shell read or search is never refused
  under Claude Code. The Read and Grep tools are judged as before.
- After a shell command that only reads, the launcher loads no test gate
  and no git process is started.
- The SessionEnd hook hands the session's close to a detached process and
  returns. The client ends a SessionEnd hook after 1.5 s; the close is now
  sent by a process it does not end. In that process the run's close has
  the hooks' request bound instead of 1.5 s.
- The SessionStart hook and the MCP headers helper share one repository
  lookup. The helper notes the scope it gave the connection, and a new
  session whose connection carries the checkout is told neither its
  namespace nor its tag.

Both plugin manifests are at 1.2.99.

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

* The read-only shell rule has a test of its own

The launcher and the test gate skip their work after a shell command that
only reads; the rule's cases are listed where the other shell-command
shapes are tested.

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

* The examples of the tests line and the shell rule name no project

The sample paths in the docs page and the two tests are an application's
own.

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

* The test gate holds a stop by default, a host that ends with the client can have SessionEnd sent in the hook, and a shell read renews a lapsed repository entry

Review findings on this branch, each fixed where it arose.

- The stop of a session that changed code and ran no test since is held
  by default again. `gateMode` is back in lib/test-gate.mjs as on main,
  the launcher loads the gate at Stop without a switch, and the
  `stop_test_gate` option and the `stop` mode are gone. What stays from
  this branch is the runner proof: the reason names a pytest command only
  where the checkout configures pytest.
- LOOM_SESSION_END_WAIT=true runs the SessionEnd records in the hook, as
  main did, for a host torn down the moment the client exits. The default
  stays the hand-off, which the client cannot cancel.
- After a read, loom-file-context renews a lapsed repository entry where
  the mode runs the code index, inside the read's bound. No hook runs
  before a shell command any more, so nothing else renewed the entry of a
  session that reads through the shell, and its files were asked about
  without the team namespace.
- `readsOnly` no longer takes for a read: `awk`, `sort -o`, `uniq` with a
  second operand, `tree -o`, `git ... --output`, `rg --pre`, a sed script
  that does more than print, delete or quit, an escape outside single
  quotes, an escaped quote, a quoted program name. Quotes are paired by a
  scan, so an apostrophe inside double quotes hides no substitution.
- A `conftest.py`, `pytest.toml` or `.pytest.toml` on the way to the root
  proves pytest, so a repository that runs it on its defaults keeps its
  command.
- With LOOM_TEST_GATE=block the held stop names the command the index
  gives: only a run of it passes that stop.
- A lookup that finds no index stamps its entry when it is answered, so a
  process waiting for it takes the answer instead of asking again.
- The Troubleshooting page no longer calls an empty session start a fault.

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

* An edit renews a lapsed repository entry, sed with a script attached to -e is no read, and the gate texts name no stop mode

The Codex wiring's description and the settings table named a
LOOM_TEST_GATE value, stop, that the gate does not have: it holds a stop
by default, and knows block and off. Both read as on main again.

Under Claude Code nothing renews the checkout's repository entry before a
shell command, so an edit ten minutes after the session's last lookup
asked memory.for_file without the team namespace, and the repository's
rules and decisions did not arrive before it. The edit now renews a
lapsed entry first, as a read does, where the mode runs the code index.
The renewal has its own bound ahead of the request's, and the texts that
gave a read one second in all say so.

readsOnly took `sed -n -e's/a/b/w out' p` for a read: the script in the
same word as -e was not read, and the file operand was judged in its
place. A word with text after its -e is now refused.

The pins of loom-code-shunt.mjs are renewed: a comment changed, no
sender site.

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

* The test gate holds a stop only where the install asks for it, and a dead lookup claim is removed only while it is the one that was read

By default the test gate no longer holds the end of a session that
changed code and ran no test since. In 27 measured plugin sessions the
hold fired in 8. Each of those then spent 2 to 7 more model requests (28
requests, about 114 s and $0.164 in all), and no grade improved. Six of
the eight were tasks the same agent fixed without the plugin and without
a test run. The tests of an edited file are still named on the tool call
that edits it.

- `gateMode` is in lib/loom-client.mjs and has four modes. `advise`,
  when nothing is set: tests are named at edit time and no stop is held.
  `stop`: they are named, and a session that ran no test since its last
  code change is held once. `block` and `off` are as before. The
  `stop_test_gate` install option turns `stop` on, and LOOM_TEST_GATE
  outranks it. An on-word reads as nothing set.
- The launcher loads the gate at a Stop only in a mode that holds stops,
  so in code mode a Stop loads no script and asks the server nothing.
- An install that wants the hold back sets `--config
  stop_test_gate=true`, or LOOM_TEST_GATE=stop in the environment. Codex
  has no install option and uses the variable.
- A lookup claim left by a process that died was removed by every process
  that read it as dead, so the second of two could remove the claim the
  first had taken since, and both asked. The claim is now moved aside,
  which one process alone can do to a file, and anything but the dead
  claim that was read goes back.
- The launcher's note on LOOM_SESSION_END_WAIT says what such a hook has
  sent when it returns: the run's close. Session memory, the brief and
  the last turns are with flushers.

Both plugin manifests are at 1.2.105. The sender pins of
lib/loom-client.mjs and lib/repo-scope.mjs are renewed: no sender site
changed.

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

* A checkout's lookup claim and header note are shared by every spelling of its path

Three plugin tests failed on Windows and one on Alpine.

On Windows the runner's temp directory has a short name, so a checkout
under it has two spellings. The shared cache entry is keyed by the
checkout's real path, and the lookup claim and the headers helper's note
were keyed by the path as the caller spelled it. A test that named the
checkout one way found no note and no claim written the other way: the
session was told both lines, and a lookup did not wait for the claim.
The hooks name a checkout by its real path, so sessions were not
affected. The claim and the note are now keyed as the cache entry is
(`checkoutStatePath`). A test names a checkout through a link and by
its real path; it failed before this change.

On Alpine no Python is on PATH, and the reason of a stop held with
LOOM_TEST_GATE=block names the index's command with no interpreter in
front. The test asked for one; it now takes the command either way.

The sender pins of lib/loom-client.mjs and lib/repo-scope.mjs are
renewed: no sender site changed.

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

* uniq with the standard input as its first operand and a file as its second is no read

`readsOnly` counted the operands of `uniq` as the words that start
with no dash, so `sort a.txt | uniq - b.txt`, which writes b.txt, was
taken for a read: the tests line and its git call were skipped after a
command that wrote a file. A bare `-` is now counted as the operand it
is.

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>
…checkout links nothing from later changes (#1808)

The merged-PR ledger is filled from the forge up to now, whatever commit the
index is at. A namespace indexed at an older commit (a release branch, a
pinned deployment, a bisect checkout) ranked and linked its code by changes
merged later: the co-change rows of the test map, the history leg and history
section of code search, co-change, churn and the context packs.

The ingest pass publishes where the head sits in the ledger's clock as the
`history_until` state row: the merge time of the newest ledger change among
the head's first-parent commits, else the head's committer time. One store
predicate, `_head_bound`, compares `merged_at` with it in every ledger read
that ranks or links by history. It applies only while the row names the
current `git_head`, so a namespace no pass has published for reads the whole
ledger. code.pr_check lifts the bound: a duplicate merged later is a
duplicate. Reads by PR number or inside a window the caller names are
unchanged.

The bound is the forge's recorded merge time, not the head's committer time:
a forge records a merge a second or more after the merge commit is made, and
tens of minutes after it under a merge queue, so the committer time would
leave out the head's own change.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…r it, and a change linked to tests only through other definitions names at most four (#1813)

* The tests named for a source file start with the test file named after it, and a hub file gets no unbounded list

code.test_gate, and the rows code.impact and code.edit_context take from it, read the
one test file named after each edited Python module from the file table and list it
right after the changed tests and the measured ones, with the module's path in
`named_for`. The name reached the gate only through test-map rows, which an index
built from a tree alone does not have for a repository whose sources are not under
`src/`.

A change with nothing but leads (chains of two or more calls, neighbours) names at
most four of them, the strongest first, and counts the rest in `tests_unnamed`. The
cut does not fall between leads of one strength: seven files that each call one
definition of the edited file name none.

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

* The gate's page describes the named row after the list of kinds

The paragraph on the test file named after an edited module sat between the sentence
that introduces the kinds and their list.

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>
* A prompt's first line that ends in a URL is not a card lead-in

The prompt hook reads a prompt that opens as labelled lines as a card and
searches with its request field. The optional line above the labelled lines
counted as a lead-in when it ended in a slash, a dotted name and a colon,
which a URL also does: a question ending in `https://example.org:` above
`repo: a/b` and `task: ...` was searched by the `task` value alone.

The lead-in's last word must now be a file path: names joined by single
slashes, the last one dotted, with an optional `~`, `.` or `..` in front. A
word with a scheme, `//` or `user@host:` is none, and the prompt is searched
whole.

The doc comment of `unknownRecallValue` says in two lines what it returns
and why the value is cut. Both plugin manifests are 1.2.107, and the sender
pins of the two edited files are renewed: no call site or request body
changed.

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

* A lead-in's file path is the line's last word, and a word with a scheme or a remote is none

A word that opens with // or has a colon before its first slash is a URL or a remote, not a file path; a drive letter is a path. The path's directory names may hold any characters.

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>
…commit that holds the change, and prompt recall leaves it out of a checkout that has it (#1791)

* A session's memory of code it then changed names the commit that holds the change, and prompt recall leaves it out of a checkout that has the commit

A coding session's capture states the code as the session found it: the cause of a bug as the code was before its edits, in the present tense. Once that change is in a checkout the fact describes code that is no longer there, and a later session read it as a defect the checkout still had.

- A session capture's fact that names a file its session changed carries the tag session-change, and a capture's client names the commit that holds the change as change:<commit> (the plugins: HEAD, once the session committed everything it changed).
- context.pack labels such a line changed_in=<commit> and lists each record's commit and a fix record's Fixed in clause in the memories section's meta.
- The prompt hook, which holds the checkout, asks git whether HEAD has the commit: a fact of the code before it is left out, and a fix record is added as its past fix in one line. Records are added whole within the cap, never cut, and a transcript passage is not a record.
- The session primer asks for no memory search: no task is known at session start.

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

* A fix record stated as a past fix keeps its line's own labels

The one-line form of a fix record whose commit the checkout holds keeps the source, writer and dates the pack printed for it: a reader of a shared namespace still sees who wrote the record.

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

* The plugin manifests are at 1.2.98

1.2.97 is taken by another open pull request.

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

* Only the facts about code a session changed carry the commit that holds the change

A capture's change:<commit> tag is taken off the capture's tags once its marked facts carry it, so a preference or a session summary of the same capture is not tagged with a commit, and a namespace's tags do not gain one value per fact.

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

* The capture asks git for the commit beside the other SessionEnd scripts, not ahead of them

The SessionEnd scripts share one process, and the run hook closes a run whose begin is still unanswered within 900 ms. Two synchronous git calls in the session-memory script held that process, and on a slow runner the run was left open. The two calls now run concurrently and without blocking.

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

* Only a claim its session's change ended is marked, and the primer and passage recall are as on main

A session capture marked every fact that names a file its session changed,
whatever the fact says, so a relation or an invariant that holds after the
change was labelled as code before it and left out of a prompt in a checkout
that has the commit.

- The coding-session prompt asks the extractor to tag a claim that the
  session's edits made untrue with `session-change`. `session_change.mark`
  keeps the tag on a fact that names a file the session changed, takes it off
  any other, and puts it on the fix record; the cause of a fix record that is
  not written keeps it. A fact about a changed file that carries no tag is not
  marked.
- The session primer asks for every section again, and prompt recall adds a
  transcript passage that fits: both changes are outside this concern.
- `session_changes[*].fixed` is escaped as the record's line is, and is the
  excerpt the line shows when the excerpt does not hold the whole record, so a
  fix record is never left with a cut clause or with nothing to state.
- The prompt hook asks the checkout once for each commit the pack lists.
- The extraction page states what the mark does not cover: an untagged cause,
  a session that ends with uncommitted work, a change that lands as another
  commit, and files a pull rewrote.

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

* The session-change mark reads a fact's own text, and prompt recall cuts a record longer than its cap

The mark compared the session's changed files with a fact's `files`, which
also hold the paths of the turns the fact cites: a tagged claim about
src/other.py that cited a turn naming a changed src/reader.py kept the tag
and its commit, and prompt recall left it out of every checkout with that
commit. `mark` now reads the files the fact's text names, as the fix
record's own check does.

Prompt recall left a record out when it did not fit the cap, so a record
of about 1,000 characters or more never reached a prompt at the default.
When no record fits, the first is cut to the cap and ends with
`...[truncated]`, as before whole-record selection; a second record is
still never cut.

A decisions line carries `code_state` after its brackets, so the sentence
that explains it was dropped from every decisions block: a label's
sentence is kept while any kept line carries the label.

The prompt hook asked git about each listed commit with a blocking call of
up to a second each, in the process the event's scripts share. The calls
run together without holding the process, a second at most for all, and a
commit not answered by then counts as one HEAD does not have.

The extraction page states that a fix record is marked when its text names
a changed file that is no test, and that a session whose last test run
failed is marked like any other.

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

* A capture names a commit only when HEAD's history holds the session's change, and a block's only cut record is recalled

The SessionEnd capture named HEAD as the commit that holds the session's
change when the checkout was clean and HEAD was committed after the session
began. A session that committed on one branch and then checked out a newer
one ended on such a commit without its change, and every later checkout of
that branch was told the fix was in it. HEAD is now named only when its
history has a commit made since the session began that touches every file
the session's edit tool wrote; a session with no edit-tool call names none.
Untracked files are asked for whatever status.showUntrackedFiles says.

Prompt recall dropped the last item of every block the server cut, so a
block whose only record was cut (one decision or one procedure longer than
its section's budget) was recalled as nothing. That record is now given up
to its last whole sentence, step or line, followed by a mark that it is cut
and the key to read it whole by. The cut of a first record longer than the
cap takes the same form. A cut record after a whole one is still left out.

A label's sentence at the top of a block stays only while a kept line
carries the label among its labels; the word in a record's text no longer
keeps it.

The session-change mark also reads a path the fact gives from the root of
the file system, as the edit tool is given one, which the file detector
does not read.

Plugin 1.2.103.

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

* Plugin 1.2.104

Two other open pull requests took 1.2.103 while this one was in review.

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

* The branch-switch test checks the trunk's history, not a file's bytes

On Windows git checks a file out with CRLF line endings, so the test's
check that the trunk holds the file as it was before the fix compared
'one\r\n' with 'one\n' and failed. The check is about history: the fix is
no ancestor of the trunk's tip.

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

* A path a fact gives from the root is compared whole with the path the edit tool was given

The mark compared a path from the root of the file system by its tail, so
a changed file at the checkout's root (app.py) also matched a file of the
same name in any folder (/work/repo/src/pkg/app.py), and a tagged fact
about that other file kept the mark. The server does not know where the
checkout is; the session's edit-tool calls do. A file the client found
changed is now listed as the edit tool was given it when a call names it,
and a path from the root in a fact's text names a changed file only when
it is that path.

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

* A changed file is listed from the root only when an edit call names that path under the checkout

The previous commit matched each changed path to an edit path by its tail,
one path at a time: a file a command wrote at the checkout's root
(operations.py) was listed as an edited file of the same name further down,
and a tagged fact about that file kept the mark although it was not among
the changed ones. A session's changed paths share one root. It is now read
once from the edit calls, as the shortest folder that holds every edit and
puts a listed file at a path a call names, and a changed file is listed
from the root only when a call names exactly that path under it.

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

* The Claude Code manifest keeps main's stop_test_gate option

The merge resolution took this branch's whole manifest and dropped the
option main added; the file is now main's with the version at 1.2.108.

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>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…d by three quarters of it (#1804)

* Prompt-time recall answers inside its time bound with what it has

context.pack takes `deadline_ms`, the caller's own wait. Its sections run for
three quarters of it; one still running then is stopped and left out, and the
answer holds the sections that finished, with `partial` and `partial_reason`.
The remaining quarter pays for the round trip, the request's admission and the
answer. Without the field the pack waits for every section, as before.

The prompt-recall hook sends its request bound as that deadline, so the hook's
bound and the server's are one number. A pack whose procedures section is slow
used to be dropped whole by the hook; it now arrives with the memory records.

The local embedder reads the query-embedding cache as the hosted embedders do.
The memories and procedures sections of one pack embed the same prompt at the
same moment, and each ran its own inference on every thread the process has:
one request now runs one.

Both plugin manifests go to 1.2.103.

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

* A context pack's deadline has no floor

A deadline too short for any section answers an empty pack marked partial,
which is what the caller asked for, so `deadline_ms` is taken as sent. The
floor was a module constant, a number an operator could not see.

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

* A context pack's deadline is counted from the request's arrival

The sections of a pack with `deadline_ms` had three quarters of it counted
from the handler's start, so the token check and the request's admission came
out of the quarter left for the round trip. They now have three quarters
counted from when the transport took the request (`request_work.age_s`), and
the text says what that gives: the caller has the answer inside its deadline
when the round trip and the pack's assembly fit in the remaining quarter.
Nothing bounds those two.

`deadline_ms` is an int, 0 for no deadline: one spelling where there were two.

The local embedder's query-cache entries are keyed by the model's alias and
pinned revision. `local` and `local:<default alias>` are the same weights and
now share entries, and an entry written under `local` is not served after the
default alias changes.

A cut section's task is cancelled; the docstring no longer says its inference
thread or ClickHouse statement stops with it.

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

* Both plugin manifests are at 1.2.106

Another open pull request uses 1.2.103, and two with one version ship only
the first.

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>
* A session's memory capture spends at most one model call, and none when its diff and test result state the fix

A plugin's session capture paid two or three model calls: the extraction, a
relation backfill when the reply left a fact without a triple, and one
durability-verifier call per verify model; a long capture paid one extraction
per size window. The fix record needed the extraction call for its cause and
definition names, though the changed files and the passing test commands were
already read from the session's tool observations.

- The plugins name, for each changed tracked file, the definitions its changed
  lines are in (`changed_files[].definitions`, read from `git diff -U0`), and
  leave out transcript rows the client wrote itself (a hook's feedback), which
  were sent as user turns.
- With those names the server states the fix record from the first request,
  the definitions beside their files and the test commands that passed, with
  no model call.
- A session capture is read by a model in one extraction call over its latest
  turns within `memory_extract_size_segment_chars`, with no relation backfill
  and no verifier call. The call is skipped when the record was stated without
  a model and the user said nothing after the first request.
- `LOOM_MEMORY_EXTRACT_SESSION_CAPTURES=false` turns the call off: the
  lowest-cost mode.
- The durability verifier judges trajectory replays only; its session-capture
  prompt is removed.

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

* The plugin manifests take a version no open pull request uses

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

* A session capture is read by the extractor unless the deployment turns its model calls off

A capture whose client named the changed definitions and whose tests passed was
not read by a model when the user had sent one prompt: a rule the user stated in
that prompt and the cause of the bug were never extracted. The record stated in
its place quoted the capture's first user message as the request, whatever the
session went on to do. A capture over the segment budget was read from its
latest turns only, no verifier call judged a session capture's facts, and every
row the client marked as its own was left out of the turns, including the body
of a slash command, which can be the session's only prompt.

- A session capture is extracted in windows, with the extractor asked for the
  fix record and its cause, and with the durability verifier over the facts
  that are not the record. The relation backfill is the one call it no longer
  makes.
- `LOOM_MEMORY_EXTRACT_SESSION_CAPTURES=false` is the one case with no model
  call. Only then is the fix record stated from the definitions the client
  named. It says where the change is and which tests passed, and quotes no
  turn.
- The plugins leave out a hook's feedback row only, name a definition from a
  hunk header or an added line and not from a removed one, and pass git the
  diff prefixes they read.
- `changed_files[].definitions` takes four names of 120 characters, which is
  what the plugins send and a record states, and the names are scanned by the
  refusal check like the paths beside them.

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

* A session capture keeps its relation backfill and is sent whatever its changed files are named

A checkout with a changed file at its root named `constructor`, `toString`
or `__proto__` sent no capture: the definitions were kept in a plain object,
so the lookup returned an inherited value and the hook threw before the
hand-off. They are kept in a Map.

The relation backfill is back for a session capture. Its removal rested on
the prompt asking for the triples, while the measured captures show replies
that leave them out; nothing showed what those captures would store without
it. The extraction module is the one on main again.

A definition is named only in a file whose extension is a programming
language's: a line of a README or a YAML file that reads like one
("type error: the value is null") named `error` in a stated record.

The stated record's docstring and the extraction page say how the record is
linked to its evidence (as a fact the extractor left uncited), the setting's
comment is two lines, and the setting-off test follows the record through
every later step to the write: its key, value, tags, files and identity.

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>
…ap retires co-change rows from changes outside the indexed head (#1817)

`loom code backfill` wrote `git_head` and no `history_until` row, so a
namespace indexed at an older commit by a backfill alone read the whole
ledger. It now publishes the bound right after the watermark write, for a
run that moves the watermark (not a repair, not a twin label).

The test-map leg of `code_graph_stats` only inserted `pr_cooccurrence`
rows, so a row mined from a later change stayed live after the bound
applied and `code.test_gate` kept naming its test. The leg now tombstones
the live rows its bounded read no longer returns. `pr_file_pairs` orders
its pairs totally, so a ledger with more pairs than its limit yields the
same ones on every read. The live-pair read the coverage import used is
one statement for both methods (`live_test_pairs`).

Also:
- the stored head is validated as an object id before it reaches
  `git log` (`gitrepo.first_parent_times`);
- the publisher reads the state with sequential consistency, since its
  caller may have written `git_head` on another replica a moment ago;
- `graph_stats._run_repo` takes the config its caller holds;
- the publisher logs under its own name;
- the two tests that asserted source text drive the ingest post-steps
  and the graph-statistics pass instead.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…ever their order, and `code.coverage_claim` reads the call chains alone (#1816)

* `code.coverage_claim` reads the call chains of its subject and none of the gate's other reads

The claim's call-chain leg took the links code.test_gate reads for an edit of the
subject and used the walk alone: the neighbour read, the coverage read and the read of
the test file named after the module ran and were dropped. `definition_links` and
`link_tests` take `walk_only`, and the leg asks for it.

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

* A change that call chains link to tests names up to four of them whatever their order

When a change has nothing but leads and more than four of them, the cut left out every
row the order could not tell apart from the fifth. For chains of two or more calls that
emptied the list: five test files that each reach the touched definition with one test
named none, `obligations` was false, and the definition was still `linked`, so neither
`tests` nor `unlinked` said anything about it. The rule now applies to `file_neighbor`
rows only. A chain links a test to a touched definition, so chains of one strength are
cut by path and the change always names a test. Seven neighbours of one strength still
name none: they call other definitions of the file, and the touched definition is in
`unlinked`.

`tests_unnamed` is described as the lower bound it is: at most 200 neighbour files are
read, and none is counted beside four or more chains. The descriptions of
`impacted_tests` and of `tests` on a definition say that leads can be left out, and the
`loom-code` skill gives the gate's order with the named file and the cut. The plugins
are 1.2.108.

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

* The plugins are 1.2.109

The branch took 1.2.108 for its change to the `loom-code` skill, and main reached that
version before it.

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

* The plugins are 1.2.110

One patch version above main's, for the change to the `loom-code` skill.

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>
…s edit tool wrote (#1818)

With the model calls of a session capture off, the record took the definition names of every changed file, so a file that a pull, a merge or a branch switch rewrote during the session was stated as fixed by it, and could crowd out the file the session edited. The names are now kept only for a file a call of the session's edit tool names; a session with no such call keeps them all.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
… capture's definitions whatever the user's diff settings, and keep only the label notes that apply (#1820)

* The plugins read BSD and cut-short in-place options as writes, read a capture's definitions whatever the user's diff settings, and keep only the label notes that apply

sed -I, a GNU long option cut short and sort --out= read as commands that wrote nothing, so a file they rewrote got no tests line. The session capture's diff passed its own flags, so diff.interHunkContext hid a changed definition and a textconv program ran in the hook; it now passes DIFF_ARGS. A sentence that joins the notes on two labels was kept whole when a kept line carried one of them. The data-handling page lists the definition names a capture sends. Both manifests are at 1.2.111.

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

* Both plugin manifests are at 1.2.112

The open release pull request uses 1.2.111.

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>
…ad of the ledger's pairs (#1819)

The test-map leg tombstoned every live `pr_cooccurrence` row its pair read did
not return. The read stops at 20,000 pairs, so a namespace whose ledger yields
more lost every row past the cut on its first pass, at the branch tip too. A
read that fills its limit is partial: the leg adds what it read and retires
nothing, and `pr_file_pairs` keeps the order it has on main.

Both test-map reads ask for sequential consistency. The pass publishes
`history_until` just before it mines, and a replica behind that write served
the pair read unbounded, so the pass mined the later rows again and retired
none until the next one.

Tests: a stored head git would read as an option writes no row and no file;
the pair read is sequential; a pass with the read cut below the ledger's pairs
retires nothing at either head. The backfill tests use the `chain` fixture
instead of a helper that ran `git init` per commit, and `graph_stats` imports
`build_row` once.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
… the checkout configures, once and with the prompt; otherwise Loom says nothing about tests (#1822)

* A test line names a file's own test with a runner the checkout configures, or is absent

The edit-time line named any test the index reached from a file: on
recorded sessions those were other modules' tests in most cases, given as
a pytest command in checkouts that do not run pytest, on the result of a
command that had usually run tests already.

- At edit time a line is sent only for the one tracked test file named
  after the edited file, a test a coverage run measured executing the
  change, or the edited test file itself; with a runner the checkout
  configures, an interpreter for pytest, a command of at most 200
  characters, and no prompt that ends by ruling a test run out. It names
  one test, as `<python> -m pytest -q -rf <path>`, and says what the
  index knows of it and what the output ends with.
- The fragments "no known runner", "the index links no test to" and
  "(+N more)" are gone from that line. The held stop's reason is
  unchanged.
- With the prompt's code pointers on, a prompt that names the definition
  of one of its pointers gets the same line with the pointers, for a
  Python file with exactly one test file named after it. It adds no
  request, and the test is not named again at edit time.

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

* Codex copies, both manifests at 1.2.112, and the sender pins of the edited files

The Codex plugin's copies are regenerated. The pins of the six edited
sender files are renewed: no call site or request body changed (the prompt
hook's test line is computed from the checkout and sends nothing, and the
client library's change is a comment). The option's description, the mode
comment and three sentences of the docs say an edited file's own test is
named.

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

* Both plugin manifests are at 1.2.113

Main took 1.2.112 while this branch was open.

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

* The prompt's test line follows the test gate's mode

The line a prompt carries is the test gate's, so LOOM_TEST_GATE=off or
block sends none, as at edit time. The sender pins of the two edited files
are renewed: no call site or request body changed.

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

* Both plugin manifests are at 1.2.114

An open pull request took 1.2.113.

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

* A file whose line a prompt ruled out stays unasked, and the line's own command form counts as a run

Two review findings on this branch.

- A session whose latest prompt ended by ruling a test run out had the
  edited file marked as asked about, so a later prompt that took the ruling
  back brought no line for it. The file now stays unasked and gets its line
  at its next change.
- A command that ran the test with options before its path, the form the
  line itself gives (pytest -q -rf <path>), was not read as running it, so
  the line could arrive on that run's own result. Options before the path
  of a plain pytest command are now read as the same run; an option
  followed by a value of its own (-k name) still selects a part of the
  file.

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>
* Test link readers use a configured neighbor limit

The candidate row count is an operator setting, and a module constant violates the tunable-number guard. Preserve the default of 200 and use the validated field in each reader.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Neighbor limits fit the query parameter range

Reject values above the UInt32 query parameter maximum when loading configuration. Cover the accepted boundary and first rejected value, and regenerate the documented range.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

---------

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
* A configured entry may not share a clone with another repository

A derived clone dir names the repository alone, so a fork and its upstream
resolve to one bare clone and each fetch moves the other's branch refs. When
two LOOM_CODE_REPOS_JSON entries resolve to the same git_dir, the parser
compares their git_remote values after the defaults and skips the later entry
if they differ, with a git_dir configuration error that names the holder and
says to use one spelling of the remote or set a separate git_dir.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Compare a held clone dir by its canonical path

A relative git_dir and its absolute path, or a symlink to a held clone, are
one bare clone; compared as written, two remotes could still fetch into it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Key held clone dirs by path and by directory identity

`_clone_taken` keyed its holders by `realpath(git_dir)`, which keeps the
spelling it is given. On a case-insensitive volume `Widget.git` and
`widget.git` are one directory under two keys, so two entries with different
remotes both loaded and their fetches moved the same refs.

Each entry is now held under its canonical path and, once `git_dir` exists,
also under its `(st_dev, st_ino)`; it collides with a holder when either key is
held. Keying by identity alone would let a directory that does not exist yet
(`missing/../widgets.git`) and an existing `widgets.git` slip past each other,
as a path key and an identity key never compare. The cost is one `realpath`
per entry plus one `os.stat` while the directory exists, no walk over the held
clones. A stat that raises OSError (directory missing, or removed while the
config is parsed) leaves the path key alone. An entry with the held remote
still shares the clone; one with another remote is skipped with the `git_dir`
error.

Two entries naming a directory that is not created yet, with spellings that
differ in case, are still told apart until the first clone creates it.

`known_repo_count` no longer says it does no I/O.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Refuse git_dir spellings that differ only in case before either exists

Two entries whose git_dir differ only in the case of the last component
passed validation on a fresh volume, because no directory existed yet to
compare by identity. Hold each clone dir under its canonical path with
the last component lowercased as well, so they collide with the existing
error. On a case-sensitive host this also refuses two distinct directories
spelled Widget.git and widget.git with different remotes; the error says
to set a separate git_dir.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Hold clone dirs by path and identity only, and document the first-run limit

The lowercased last component made two clone paths that differ only in case
collide, which also refused two distinct directories on a case-sensitive
volume. A clone dir is held under its canonical path and, once it exists,
under its (st_dev, st_ino), so case-sensitive volumes accept both spellings
and a case-insensitive volume is caught as soon as the directory exists.

Before the first clone, two spellings of one path on a case-insensitive volume
still pass. The operations guide names this and asks for clone paths that
differ by more than capitalization.

The test creates both directories and asserts both entries load; it is
skipped on a case-insensitive volume.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Use the checked-in lockfiles to propose weekly dependency bumps. Keep routine major upgrades and changes to the lint and type-check pins with their own review.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* Document indexed edit and range lookups for Claude Code (#1528)

* Document indexed edit and range lookups for Claude Code

The project policy shows how to reuse current source and notes without extra reads.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Check linked lesson currency before reuse

An indexed source revision can be current while a lesson points to code that changed.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Insights reads events through signed views (#1493)

* Insights reads events through signed views

Grant access to signed event projections so Insights can provision with policy visibility scoped to the Loom database. Revoke the raw event grants before exposing either view.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Insights probes accept existing column grant options

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Mixed-version CI verifies signed Insights event views

Compare the ordinary view with physical rows and aggregates across both builds. Use the published release that recognizes newer analyst catalogs and verify both physical reads are refused.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Schema status expects both Insights event views

Include the full runtime event view catalog when calculating schema drift. Keep reporting missing known views and unexpected objects.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

---------

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* The coding-agent comparison links paired repository results (#1529)

* The coding-agent comparison links paired repository results

Show how both setups performed on the same file-location questions and make the cost and elapsed-time trade-off visible.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The guide distinguishes reproduction runs from the paired benchmark

Point readers from the storage runner to the separate coding-agent measurement.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP grep offers a source read for related evidence (#1530)

An exact miss can still find enclosing scopes for a related expression. Attach the validated continuation to the related result so an agent can follow the indexed evidence.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Edit context ranks indirect tests across requested definitions (#1532)

Tests behind a caller cover the edit batch when they share its related names. Use the same ranking evidence as the direct test path.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code enrichment reads candidate limits from settings (#1503)

* Code enrichment reads candidate limits from settings

The unit gate rejects module-level candidate bounds. Validate both limits in the settings catalog before using them in edge queries.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Enrichment settings preserve the lookup work limits

Usage example coverage reads at most 50 paths. Bounding indirect candidates at 30 callers keeps synchronous source-window ranking within its existing workload.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The Loom site accepts self-hosted adoption reports (#1534)

The dashboard and report endpoint share a deployment. Serve the existing collector and daily repository snapshot from the site so self-hosted installs can reach them through the public origin.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP grep batches exact and related source reads (#1542)

* MCP grep batches exact and related source reads

A literal batch can return an exact test declaration and related source for another query. Include valid ranges from both evidence groups in the same source read suggestion.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep mixed grep reads for location-only matches

Validated ranges can drive a combined read when a caller requests zero excerpt lines. Preserve the continuation for languages without a named edit selector.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Complete grep excerpts at the verified indexed revision (#1545)

* Complete grep excerpts at the verified indexed revision

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep enrichment deadlines local to each page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep indirect test evidence for shared call sites (#1546)

Use the qualified caller and source location to recognize one call site across the parser and compiler index. Keep both symbol IDs for reading incoming test edges.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Mutation tests use pytest 9.1.1 (#1543)

Match the main test environment and give the dependency graph a fresh lockfile to scan.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption telemetry includes contact domains by default (#1544)

* Adoption telemetry includes contact domains by default

Use eligible namespace contacts from password and federated accounts so deployments can report aggregate domain activity across sign-in methods.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The adoption report test counts password contacts

Exercise the expanded contact scope in the live report test, including requests attributed to a password account.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Return fresh lessons from verified callers in code edit context (#1554)

* Keep fresh lessons for verified forwarding callers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep distinct verified caller lessons eligible

Select fresh links before reading a limited set of excerpts. Use the complete excerpt to distinguish lessons written under a shared key.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require fingerprint proof for verified caller lessons

Restrict exact-revision lesson reads to compatible, nonempty fingerprint comparisons. Ordinary symbol reads keep their existing state fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Verify restored caller lessons against their original source

Trust the checked hash only while its stored link still identifies located code. Keep ordinary symbol reads on their existing fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Link coding-agent memory guides to their verification steps (#1561)

Readers can check a cross-client handoff, a code-linked lesson and the SQL audit before choosing a team setup.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Preserve Python member reads when SCIP is indexed (#1566)

* Preserve Python member reads when SCIP is indexed

Resolve typed reads from the parser candidates in the same name query so a compiler ID for the same member cannot displace its parser edge.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Retain compiler-only Python member candidates

Prefer parser candidates per qualified name so a compiler-only member with the same short name remains readable.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Name agent memory capabilities in documentation search titles (#1567)

* Name agent memory capabilities in documentation search titles

Put each page’s task in its title and description so it makes sense outside the sidebar.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Distinguish request IDs from worker query tags in telemetry metadata

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show how edit context returns a caller’s saved lesson (#1569)

* Show how edit context returns a caller’s saved lesson

A coding agent can read the constraints that apply at a forwarding call before changing its dependency.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* State the source and access requirements for caller lessons

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Add an evaluation checklist for choosing coding-agent memory (#1571)

* Add an evaluation checklist for choosing coding-agent memory

Teams can use their requirements to choose a starting setup and copy the checks into a pilot.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require authenticated writes in the selector’s SQL audit check

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* LOOM_CODE_GIT_CA_FILE lets git trust a remote under a private authority (#1549)

Repository-job git reads no system or global git config and inherits no
environment beyond PATH, HOME, LANG and TMPDIR, so neither `http.sslCAInfo`
in a git config nor GIT_SSL_CAINFO or SSL_CERT_FILE reaches it: it verifies
with the image's default roots, and a git server whose certificate a private
authority issued fails every clone with "server verification failed:
certificate signer not trusted". The one setting that hands git a bundle,
LOOM_CODE_GIT_PROXY_CA_FILE, applies only through a forward proxy.

The new setting names a PEM bundle that `auth_env` passes to every repository
job as `http.sslCAInfo`. Through the proxy, LOOM_CODE_GIT_PROXY_CA_FILE is
appended after it and wins when set, so proxied deployments behave as before.
A deployment that does not set it is unchanged.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused compiler-tier delta holds its tier until a cap or the target changes (#1551)

* A refused compiler-tier delta holds its tier until a cap or the target changes

A delta tier whose delta `open_delta` refused (over a cap, a link, not a
regular file) recorded the failure and left its watermark, so every pass
ran the full harness again at the same commit and was refused the same way.

The tier now keeps the refused target and the delta caps in effect. While
both match, the next pass skips the entry before the checkout moves and the
failing record keeps its fix. A raised cap, a live setting, or a new branch
head releases it on the next pass. A delta that changed while it was read
holds nothing. The C/C++, TypeScript, Python and Go delta tiers share it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refusal hold records the caps its open read

The hold sampled the delta caps after `open_delta` failed, so a cap raised
while the open ran was recorded as the one the delta was refused under: a
1.5 MB delta refused at a 1 MB cap that was raised to 2 MB stayed held at
2 MB, where it opens.

`delta_caps` now reads the three caps once; `open_tier_delta` passes that
snapshot to `open_delta` and records the same one in the hold.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the namespace's counts and coverage (#1550)

* CLI backfill phases republish the namespace's counts and coverage

`code.index_status` and `code.repos` read `chunks_embedded` and
`embedding_coverage` from the shared `table_counts` row, and the Repositories
page reads per-language coverage from the shared `coverage` row. The ingest
pass republishes both after it moves rows; `loom code backfill` moves rows
outside it. A reader serves the counts row whatever watermarks it was computed
at, so after `--phase embed` status kept reporting the pre-embed coverage
(`embedding_coverage: 0.0`, `searchable: false`, `code.search` answering
lexically) until an ingest pass moved the namespace's rows again. Embedding
moves no watermark, so the coverage row stayed current to its readers as well.

Each phase that wrote something republishes both rows at its end, as the
ingest pass does. A failed refresh is printed and does not fail the finished
phase.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the counts at every phase end

The republish ran only when this run's own counters were nonzero. A resumed
index whose cursor was already at the end, or an embed phase whose last page
landed before the process died, wrote its rows in an earlier process and so
left the pre-backfill `table_counts` row in place. Both phase ends now
republish unconditionally; a republish is one query per row.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The embed phase republishes the counts only for an org it declared

An embed phase with nothing pending republished without declaring its org, so a
mistyped --org wrote counts and coverage rows that the cell never gated. With
nothing pending, the phase now declares and republishes only a namespace that
already has a counts row; a mistyped org has none and writes nothing.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A full index run republishes the counts after its watermark

The full-run path republished in `_close_index`, before it wrote `git_head`.
Both rows carry the counts fingerprint, `git_head` included, so `code.coverage`
rejected the new coverage row and the next reader ran the aggregates again. A
full run now republishes after the watermark and the backfill stamps; a hold,
a repair and a twin label write no watermark and republish in `_close_index`
as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The Anthropic client sends a JSON Schema as the Messages API's structured output (#1311)

* The Anthropic client sends a JSON Schema as the Messages API's structured output

A json_schema response format was dropped, so the conflict resolver's Claude answers came back in a shape parse_verdicts could not read and every judgement failed while still being billed. The schema now goes in output_config.format and into the JSON directive, which keeps the shape when a model refuses output_config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A refusal of one output_config key drops that key alone

A 400 naming output_config.effort recorded a refusal of the whole output_config, so later schema requests to the same model lost output_config.format. traits.refused_key records output_config.effort or output_config.format on its own, and the Anthropic client leaves the other key in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A rejected schema drops the format for that request alone

A 400 that points inside the sent schema (output_config.format.schema...)
rejects that schema, not the model's structured output. The call is re-sent
without the format and nothing is remembered for the model, so later
requests still send their schema. Refusals of output_config.format itself
are still learned per model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

---------

Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* The embed phase binds its candidate keys a slice at a time (#1547)

`loom code backfill --phase embed` failed on a ClickHouse at its default
`http_max_field_value_size` (128 KiB) with "HTML Form Exception: Field value
too long". `pending_embed_chunks` asks phase 1 for four times the page size
(2,000 keys for the CLI's page of 500) and bound every (path, chunk_id) pair
as one form field in the phase-2 FINAL read; at ordinary path lengths that
list is several hundred KiB.

Phase 2 goes through `query_all_sliced`, as other keyed reads do. Each slice
keeps its own oldest `limit` rows and the slices' rows are ordered and capped
together, so the page is the oldest-first page one statement would return.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Link the memory selector from the agent documentation index (#1574)

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings (#1572)

* Format the coding-agent memory selector page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings

Resolve local actions from the workflow commit, verify translations from a scheduled job, install npm packages from lockfiles, and validate each docs destination as a parsed link.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Include the selector page in the IndexNow route test

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Pin the coverage action to its full commit SHA

The plugin scanner requires a full SHA for action references it treats as remote.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep queued translation requests during scheduled checks

Finalizer polls and translation batches share one queue. Keep pending requests available while the current run finishes.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption shows active reported contact domains (#1577)

List domains with successful requests over 90 complete days. Use report version 2 to keep domains collected under the private notice out of the public list.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Replay how Loom memory follows source edits (#1588)

* Replay how Loom memory follows source edits

Show branch-specific lesson states from a recorded comparison and let readers repeat the evaluation on a disposable hosted runner.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scope evaluation cleanup to its server job

Finish the fork instructions and apply the site formatter.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep pytest node paths out of code anchors (#1589)

* Keep pytest node paths out of code anchors

A pytest command can make a file extension look like a qualified symbol. Skip selectors with explicit Python paths so a note can link the declarations it names.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Handle class-only and nested pytest node selectors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep attached decorators in Python test examples (#1592)

A context window that starts at the function declaration hides decorators that still belong to the test. Reuse the retained chunk to prove the decorator prefix and stay within the requested radius.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Grep cursors keep their path filters (#1594)

A page offset belongs to the original file selection. Bind that scope before reading the saved pool or retrying the query.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code edges keep distinct relationship kinds across index tiers (#1595)

A compiler call and a parser read at the same location describe different relationships. Collapse the rows only when their kinds agree.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Search cursors keep their original filters (#1596)

A page offset belongs to the results selected by the original filters. Verify those filters before serving a saved page or rerunning the search.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-target edit context returns verified member source (#1598)

* Single-target edit context returns verified member source

Agents can use one exact name and get the same revision-verified member source as a one-name batch.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Describe member sources for both edit context forms

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* File-qualified symbols resolve unique indexed path suffixes (#1600)

When a relative spelling omits a source directory, look up the symbol on the one live indexed file with that complete suffix. Keep an existing path as the lookup boundary and leave ambiguous suffixes unresolved.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Edit batches share verified test source reads (#1601)

* Edit batches share verified test source reads

Reuse a verified source window when several named targets cite the same test. Keep each citation and deadline and drain pending reads before the batch exits.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bound shared edit example reads

Apply the enrichment deadline to the shared source read. A later waiter can retry after a stalled read reaches its deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lessons verify the commit while reading source (#1602)

* Single-file lessons verify the commit while reading source

A successful bounded local blob read proves that the mirror holds the pinned commit. Use one Git process for that case and keep the mirror availability check when the local read cannot supply the file.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lesson reads share one parse deadline

The fallback spends only the source-read time left after a local miss. Keep the mirror availability check and bound both paths with the same deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Erasing a code namespace removes its cached code.ask answers (#1585)

* A code namespace erasure deletes the cached code.ask answers asked in it

The erasure step for cached code.ask answers deleted only those that quoted the
erased namespace's memories (`memory_namespace`). An answer asked in the erased code
namespace carries the repository's code in its text and was left in
`loom.code_answers`, uncounted by the residue census. After a re-index of the same
commit it was served again, since the cache invalidates only when a cited file changes.

The step and the census now match a row by `namespace` as well as `memory_namespace`.
The delete stays a lightweight delete read sequentially, and the census still skips a
tombstone that holds no text.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Align the answer-cache erasure docs and comments with the changed step

The architecture doc still said an answer drawn from the code index alone stays;
a namespace erasure now deletes it with the code namespace it was asked in. The
module docstring of the answer-cache erasure tests, the `namespace_tables`
docstring and one test docstring described the old predicate, and the comment on
`KEEP_TABLES` now says only what is not purged there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Guard every cached answer against an erasure, not only memory-quoting ones

An ask can finish synthesizing after the namespace delete and the final
census. The answer cache skipped its erasure check when the answer quoted no
memory, so a code-only answer could land in the erased namespace. Run the
before-and-after write guard for every answer, and delete a code-only answer
that lands after the mark by its own key.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* An abstain's negative cache entry is guarded against an erasure and counted by its census

An abstaining ask that overlapped a namespace delete could recreate its cached
question afterwards: the negative entry was written without the erasure check,
and the census skipped it because its answer and citations are empty. The
negative write now runs the same before-and-after guard as a synthesized
answer, and the namespace census counts a row that holds a question.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refresh the analyzer shapes and the tombstone sentence for the code-only guard

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits (#1562)

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits

The pass ordered every entry's pending commits by commit time, floored at a
24-hour horizon. A mirror far behind on older history therefore outranked
every recent commit of every other entry, and while its backlog lasted a
branch with one new merge stayed at 0 of 1 pass after pass.

Each round now gives every waiting entry one commit, the entry with the
fewest landed this pass first, then entry order. Within an entry commits
stay oldest first, so the watermark still moves one commit at a time. At the
budget the entry the scheduler would have served next is cut first, and the
next pass starts there through the existing `commits` cut and `rotate_to`.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A sliced commit counts as its entry's turn in the round-robin

A commit sliced at the share clock returned before the entry's landed count
moved, so it was deferred at the same key as the entries the round had not
reached and won the tie on entry order. The `commits` cut then named the entry
that had just been served, and a small entry behind sliced large ones stayed at
0 of 1 pass after pass.

A sliced entry is now deferred one turn later than its landed count, so the cut
names the entry the round did not reach and the next pass starts there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The commit-phase tests state the round-robin order and drop unused commit times

The scheduler no longer reads commit times, but the test helpers still took a
`times` map and patched `commit_meta_many`, so the dates passed to every
fixture were inert and two test names read as if a date were an input. The
helpers lose the parameter and the patch, the cases are named by backlog
size, and the lanes and round-robin docstrings and one assertion message now
describe the order across entries as round-robin.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The ingest cut names an entry by org and namespace, so two orgs sharing a namespace alternate

The cursor a cut pass leaves named the entry by namespace alone, and
`rotate_to` took the first entry of that name. With `code-widgets` in two
orgs and a budget for one commit, both cuts named the second org's entry and
both passes served the first org's.

A cut is now kept as `<org>/<namespace>:<leg>` and the commit, bootstrap and
walk phases rotate on `cut_key` (org and namespace). `cut_phase` reads the leg
after the last colon, so an org name containing one still parses. A cursor
written before this names no org and matches no entry: the pass keeps the
configured order once, and the next cut is written in the new form. A build
without this change reads the new form the same way (rolling-upgrades, rule 4).

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the leftover commit-times argument from two ingest tests

Two callers still passed a map of commit times as the helper's third
argument, which since the helper dropped its times parameter is the
per-commit file count. A time of about 1.7 billion became that many
file names, so the run grew until the memory limit killed it. Both
callers use the helper's defaults now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The budget-cut test expects the org-keyed resume point

The cut now resumes at org/namespace:leg, so the existing test reads
o/code-x:walk.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* A refused compiler-tier delta holds its tier on the whole run, not on its target and caps (#1582)

The hold a refused delta leaves (<watermark>_refused) recorded only the target
and the three caps its open read. The run's window starts at the tier's
watermark, which other writers move (`loom code scip-full`, a batch apply, a
base-unknown reset), and the harness reads inputs the key did not carry
(exclude_generated for Go, scip_ts_projects and code_scip_ts_paths for
TypeScript, code_scip_delta_max_tus for C/C++). So a tier stayed held after its
watermark moved, after a branch was force-pushed back to the refused commit,
and after the entry's generated-file rule changed, each of which makes the next
run a different one.

The record is now {base, target, caps, inputs, loom}, written as sorted JSON so
code_index_state shows why a tier is held. `base` is the watermark the run
started from, `inputs` is what the tier's harness reads besides the window (an
empty object for Python), and `loom` is the release. Each delta worker reads
those inputs once per pass and builds the harness environment and the hold from
that one snapshot, so a setting changed while the harness runs cannot make the
record differ from the run. A hold that cannot be written fails its pass with
the store error, and the next pass runs the harness again.

Holds written by the previous format never match, so each held tier runs once
more after the upgrade and holds again. The operations guide names what the
hold keys on and what releases it, and no longer says extra Go deltas hold.

The tests are the three cases the review found, on a moved base, a branch
pushed back to a refused commit and a changed generated-file rule, plus the
translation-unit cap read once per pass and each tier's inputs in the record.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes (#1552)

* loom code backfill keeps an owed edge pass across a resume

A first full backfill implies the edges-only second pass, but only while
its cursor is empty. A first backfill stopped in its index phase (a held
org, a SIGTERM, a crash) resumes with the cursor set, and a rerun after an
interrupted edge pass finds the cursor at its end: both finish, write
`git_head` and drop the pass, so the namespace's cross-file references
stay unbound and nothing says so.

The run now records why it owes the pass (`first-backfill`, or
`requested` for `--edges-second-pass`) under
`backfill_edges_owed:index<suffix>` before its first batch, and clears the
record once the pass is done. A resumed run or a rerun reads the record and
runs the pass; `--no-edges-second-pass` declines it and clears the record.
A `--paths-file` repair records nothing, as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom runs a parsed command through one entry, dispatch.run_parsed

A command's context is bound in two places: `main` wires the process's
seams, and `_dispatch` binds the traffic class, the query tag, the actor
and the org the command bills. A second process that runs a share of a
command's work needs exactly that, so it is one function now,
`run_parsed(args)`, in its own module, `server/cli/dispatch.py`, with
`_dispatch`. `app.main` parses and calls it. A family module may import
`dispatch` without importing `app`, so the package's one-way import rule
holds. Nothing a command does changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill runs its batches through one run, cut at the header/source boundary

The index phase's reader and ingest and the edge pass's ingest move from
closures in `_backfill` and `_second_edge_pass` into `_Run`, built once
from the entry, the head, the embedder and the denylist; a batch of either
pass is a method on it. The code is the closures' code, reading its fields
from `self`.

`_cursor_batches` hands out the batches with their first index. The
headers `headers_first` puts first end their own batch, so no batch holds
both a header and a source and every header can be written before any
source batch starts. A resumed run starts at its cursor wherever an
earlier build cut.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes

One backfill process parses and extracts at about one core, whatever
--concurrency says: every tree-sitter parse holds the interpreter lock and
runs one at a time per process, and the extraction after it walks the tree
in Python. A tree does not pickle and a file's extraction reads the index
between its steps, so a worker takes a whole cursor batch: its own
connection, reads, parse, extraction and writes.

A worker is the command itself. The parent starts N spawned processes on
its own parsed arguments; each enters through dispatch.run_parsed, as
`loom` does, so it runs under every binding the command runs under: the
background traffic class, the cli.code.backfill query tag and operation,
the org it bills, logging, telemetry, SIGTERM and Ctrl-C handling, the
wired seams, the model-work admission and the registry read. `_backfill`
then serves the batches it is sent instead of walking the tree, each
awaited in the command's own task. One pipe per worker carries its batches
and their counters; nothing crosses but paths, counters and the reason a
batch was held.

The parent hands a worker its next batch when the worker reports its
last, so once a batch is held nothing more starts, and the batches still
running are counted. The cursor moves past a batch once every earlier one
is written. The header batches are all written before the first source
batch is handed out. A worker caches what it reads of the index (header
texts, the import resolver's live path set, layouts and listings), and
another worker's writes do not reach those caches, so it forgets them when
it moves to the sources and to the edge pass, which therefore reads the
finished index. The edge pass forgets them in one process too: the Go
listing and the other resolver caches outlived the index phase by up to
their TTL, so the pass did not re-derive what it claimed to. The same
workers serve both passes, admitted once, as the parent is.

A run whose workers wrote batches side by side owes the edge pass whatever
the flags say, recorded as `workers`: a file there resolved against what
its worker had read while the others were still writing. `--paths-file`
and `--no-edges-second-pass` runs with --workers run it, and a later
backfill that finds it owed runs it.

Stopping: a closing pipe cancels the worker's command task, as its own
SIGTERM or Ctrl-C does, so a stop of the parent, of the worker or of the
whole process group unwinds through the batch before the worker retires.
The parent closes the pipes when the run ends, fails or is cancelled, and
a killed parent closes them too. The parent reads every exit code: a
worker that exits before its run opened, in a batch (named with its first
index, and with the signal when one killed it), or on close (a failed
drain or retirement) fails the command; on close only after the command
has written its own end of the run, as one process retires after its
command returns. --workers is refused below 1 and with --phase embed, and
no more workers start than a pass has batches. --workers 1, the default,
keeps one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep the edge pass owed when a pass ends with errors

A worker's edge batch can return with errors when a file write fails.
The owed record now clears only when the pass reports none, so a resume
runs the pass again. The test fails an edge write in a two-worker run
and resumes in one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Index embed-excluded paths without a description or a vector (#1564)

* Index embed-excluded paths without a description or a vector

A repository entry's `embed_exclude` globs (`LOOM_CODE_EMBED_EXCLUDE` for
the scalar entry, the `exclude` glob semantics) keep a path in the index:
it is chunked, its symbols, edges and test map are derived, and code.search
reaches its chunks through the lexical leg. Its new chunks are neither
described nor embedded, in the file ingest and in the round's prefetch, and
`loom code describe` leaves them alone. The rows carry
`unembedded by design: embed_exclude`.

Embed recovery and the coverage counts now match the shared prefix
`unembedded by design`, so reference fixtures and embed-excluded chunks
are neither stubs to fill nor counted in the embeddable denominator. Rows
already stored under the reference marker match it unchanged.

Test files are often a large share of a repository's chunks; this lets an
operator spend the embedder on source and reach tests from the source hit
through the test map.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep unembedded-by-design chunks without a vector in reembed

`loom code reembed` copies a row that carries the `unembedded by design` marker under the second label with its marker and no vector, so an embed-excluded path or a reference fixture is not embedded there and that label's recovery leaves it alone.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep every vector and description writer off embed-excluded paths

The provider rebuild embedded every live `code_chunks` row and cleared
`embed_last_error`, so a staged embedder switch gave embed-excluded chunks
and reference fixtures a vector and erased their marker. It now stages a
row marked unembedded by design without a vector and keeps the marker.

The `code_summary` pass wrote an LLM card and a card vector for an
embed-excluded file, and could carry a twin's card across models. It now
takes the entry's `embed_exclude` globs (`denylist_for`), writes and carries
no card for a matching file, and clears a card written before the glob: the
row keeps its rank and carries the marker, so recovery and the card leg of
code.search skip it. Removing the glob lets the next pass write the card.

`unembedded_by_design` is the one predicate the Python writers read the
marker with. A test discovers every code-plane module that calls an
embedder or an LLM and fails until a new one is declared as a writer gated
on the marker or the globs, or as a query-side reader; the round prefetch
filter, the describe skip and the marker precedence get their own tests.
`ReembedStats.rows_unembedded` had no reader and is dropped.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Resolve the ingest denylist once per file

`ingest_file` resolved `default_denylist()` in `_refused` and again for the
embed rule; it now resolves it once and passes it down. The chunk stage's
`embed_excluded` has its one caller pass it, and the marker choice reads as
one expression.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Document embed_exclude on a changed glob, a rollback and self-service entries

The operations guide states what a changed glob does: adding one leaves
existing vectors until a chunk changes, and removing one leaves the chunks
unembedded and outside the coverage denominator, embedded again when their
content changes or when the repository is indexed into a new namespace.
`embed_exclude` applies to configured entries only. A rolling-upgrades entry
records how an older build reads the marker as a stub. The coverage
comments name both kinds of rows unembedded by design, and the setting's
comment is cut to two lines; the generated references are regenerated.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* simplify: N-1-safe marker, drop the enumeration test and the card clear

The embed_exclude marker now extends the reference fixtures' marker
(`unembedded by design: reference (embed_exclude)`), so the previous build's
recovery, backfill embed phase and coverage counts, which match
`unembedded by design: reference` as a prefix, skip it as this build's do.
The recovery and coverage reads keep main's parameter.

A test pins the reference literal, and a cross-version test checks that the
row ingest stores is skipped by the previous build's recovery predicate and by
this build's.

The code_summary pass no longer clears a card written before its file's glob:
a card, like a chunk, keeps the state it had when the glob was set. The
candidate and carry filters stay.

The model-caller enumeration test is gone: it was a closed list that every new
caller had to edit, and it passed with the ingest gate removed. The reembed,
provider rebuild and card tests move beside their existing fakes, and the
recovery parameter check already in test_code_reference_files.py stays the
only one. reembed partitions its rows in one loop and reads the column it
always selects. Rule 63 and the operations guide say what is true now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An embed-excluded file's card goes once the file changes

The code_summary pass leaves embed-excluded paths out of its candidates, so a
card written before the path's glob was never rewritten or removed after the
file changed: code.map and the cards leg kept serving a description of the old
content.

The pass now tombstones the live card of an excluded path whose inputs_hash no
longer matches the file's content hash, a deleted file included. A card that
still matches the file stays, as before, and a rank row without a card is left
alone. The next code_graph_stats pass writes the file's rank row back. The
operations guide says the card stays until the file changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Spell the full setting name in the coverage description

code_ready_embed_coverage named embed_exclude by its suffix; it now
names code_embed_exclude, and the example file and schema follow.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Regenerate the configuration reference for the coverage description

scripts/codegen/settings_reference.py after 59fc1016f's catalog wording change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Write the graph-stats rank copy just above the card it read

The ranks leg reads a live file card, then inserts a mirror of it with the
new rank at the clock version. A tombstone or a new summary written in
between carries an earlier version than that copy, so the copy won under
FINAL and brought back a card retired meanwhile.

The copy now takes the read card's version plus one. Every other writer
takes its version from the clock, so a later tombstone or summary is
higher and wins; with no write in between the copy is still the newest
row.

The test reads a card, lets the tombstone land during the read and checks
that FINAL keeps the tombstone. It fails without the change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The operations guide says LOOM_CODE_GIT_CA_FILE sets trust, not reach (#1580)

* The operations guide says what LOOM_CODE_GIT_CA_FILE settles and what it does not

The guide's paragraph for LOOM_CODE_GIT_CA_FILE read as if the setting made a
forge under a private authority indexable. It settles trust only: in the
repository-job sandbox the egress proxy still refuses a remote whose name
resolves to a loopback, private or link-local address, and no setting admits
one, so such a forge indexes only as an operator repository on a host without
the sandbox. The guide now says so.

It also says what the bundle applies to (every git a repository job runs, the
compiler tier's dependency fetches and submodule updates included, so the
bundle must hold the public roots when any of those reach a public host) and
that the path is not checked when the setting loads: it must be absolute and
inside the sandbox's read-only /etc/ssl, and a relative or `~/` path, or a link
leaving /etc/ssl, fails in git's own words. The "CA bundles" paragraph now
counts three bundles and says which one git uses through the proxy.

The unit test imports asyncio at the top of the module. No behaviour changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Name the trees the repository-job sandbox mounts for the git CA bundle

A link out of /etc/ssl can still work: the sandbox also mounts /usr and
/etc/ca-certificates read-only, so a link into /usr/share/ca-certificates
resolves to the same file. Say the target must be visible to the job and
keep /etc/ssl as the suggested location.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The mirror sweep keeps the tier checkouts of an entry that names no producer (#1584)

* The mirror sweep keeps the tier checkouts of an entry that names no producer

`_named_paths` named `checkout_for(c, "")` for each entry. For an entry with
no `scip_producer` that is `<checkout>.`, a path no tier uses, so the
checkout of the tier its tree calls for (`<checkout>.python`,
`<checkout>.typescript`, `<checkout>.go`) was named by nothing. `_sweep_root`
removes an unnamed `checkout-*` directory older than 600 s, so a self-service
entry's tier checkout was deleted and copied again over and over. A
configured entry is unaffected unless its checkout sits under
`code_repos_root`.

Name `checkout_for(c, p)` for every producer the tiers can run, plus the
entry's `scip_extra_producers`, and for each registry row its checkout and
the sibling of every producer. `repos.sibling_checkout` holds the one
spelling of a sibling path, so the sweep and `checkout_for` cannot drift.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the clause about the removed call from the sweep comment

The comment above `checkouts` in `_named_paths` described a line the previous
commit removed. It now says what the code does.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Sweep only the named tiers of an entry that names its producer

An entry with a scip_producer runs that tier and its extras only, yet the
sweep named every tier's checkout for it, so the old checkout of a tier
removed from its extras stayed on disk until the repository went. Keep all
candidate tiers for an entry naming no producer and only the named ones
otherwise.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The CLI embed phase republishes only when behind, once, with coverage first (#1581)

* A backfill phase republishes once, last, and only where the counts trail

With nothing pending, the embed phase declared its org and republished
whenever a `table_counts` row existed. Readers write that row: `loom code
stats` with a mistyped --org leaves a row of zeros, so the same typo on
`--phase embed` declared the org, and every idle embed run on an indexed
namespace paid the org gate, the count scans and the coverage aggregates.
It now declares only when rows are pending or the published chunk counts
differ from the chunk table. That comparison is a store read,
`CodeRepo.published_chunks_behind`, over the shared counts and the chunk
aggregate.

The index phase writes `git_head` and the backfill stamps first, then
`_close_index` compacts, records the pass and republishes last on every
exit (a full run, a run resumed at the end of its cursor, a hold, a repair,
a twin label), so the `republish` flag is gone. The cursor is cleared after
the republish, so a run interrupted while it publishes resumes at the end
and publishes then.

The republish writes the coverage row first and the counts row only once the
coverage has landed. An embed phase stopped between the two, by Ctrl-C or a
failed coverage refresh, otherwise left the counts current and the coverage
at the pre-embed vectors with a matching fingerprint, and the rerun found
nothing behind. It also reads with sequential consistency: the fingerprint
it stamps carries the `git_head` the run has just written, which the replica
serving the read may not have yet.

The tests drive `_backfill` and `_backfill_embed` against the real
`CodeRepo` over a replica that lags the run's writes, and read the rows
back.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused coverage write keeps the counts behind

The CLI writes the counts row only once the coverage row has landed, but
`refresh_coverage` swallowed its own write failure, so the counts landed
anyway and the next embed phase found nothing behind. The CLI now passes
`must_land=True`, which makes the coverage write raise.

`published_chunks_behind` also reads the coverage row's embedded figure,
so current counts over a coverage row that trails the chunks still count
as behind. That state comes from vectors landing between the two writes,
or from an earlier build that published counts after a failed coverage
write.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An existing coverage row is compared even when the counts row is missing

When the index phase published coverage and its first counts write failed,
an embed phase that landed its last vectors and stopped before publishing
left an idle rerun reading a missing counts row as nothing to republish.
published_chunks_behind now compares the coverage row on its own.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* Show repository freshness from mirror health (#1604)

A successful mirror fetch can leave the same commit indexed for days. Use the server’s overdue-fetch flag for the badge and keep deployment worker errors in the worker diagnostics.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires (#1002)

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires

A confirmed renewal can extend the deadline while the previous wait resumes. Use the current freshness before stopping workers, and retain genuine expiry controls.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover the review provenance default in Cell proof refusals

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

---------

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Edit context includes verified indexed forwarding targets (#1494)

* Edit context includes verified indexed forwarding targets

When one typed forwarding call resolves in the same index revision, cite the target in read_sources. Share the bounded lookup between single and batched edits and keep existing member reads independent.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Load forwarding helpers after the code modules initialize

Initialize grep and edit context in either order by loading forwarding helpers only when the optional source lookup runs.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Use scoped cursors in vector continuation fixtures

Keep the original search scope on stored cursors so the fixture exercises continuation without fresh retrieval.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bump the actions group across 1 directory with 3 updates (#1516)

* Bump the actions group across 1 directory with 3 updates

Bumps the actions group with 3 updates in the / directory: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv), [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `astral-sh/setup-uv` from 10.3.3 to 10.4.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/68559e99cc807c1eb7e9238fd43a15bba460eec2...1db35dd8eee11c5894872e0b383ae6c406cf738d)

Updates `ossf/scorecard-action` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/fa7117db83c52d787ae5a89f350999701505d78e...23f22cd43608bae7a1f1fa2603d7314dee9538a5)

Updates `github/codeql-action/upload-sarif` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.1...33d7b85da1a04171e211befe2c739303b9a4c066)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>

* Scorecard fails when the API rejects a publication

The updated action warns by default. Opt into failure on API rejection so a stale public result is visible in the workflow status.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scorecard uploads SARIF when publishing fails

Upload the completed scan when the file exists so a publication rejection still leaves results in code scanning.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep excerpt bounds in the compact coding schema (#1613)

Numeric bounds in JSON Schema do not constrain string values. List the
grep context radius as an integer so its existing bounds apply while
the server still accepts and validates numeric strings.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code read accepts same-file line pairs (#1614)

* Read same-file line pairs in one source request

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Advertise code read pair endpoints as integers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP validation errors omit rejected retry examples (#1612)

* Omit invalid retry examples from tool errors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep retry examples faithful to supplied values

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Validate corrected arguments and keep explicit scope out of retry guidance

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show missing-field templates only for fillable arguments

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep spelling corrections within their original argument object

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Compact SCIP replies omit documentation present in function bodies (#1617)

SCIP wraps declarations and can unquote forward references. Compare the
Python function headers and docstrings before dropping a description.
Keep any description whose declaration or documentation adds evidence.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The assistant runs natively with caller-scoped tools (#995)

* Run the assistant natively without a bundled chat service

Own bounded streaming model turns and authenticated MCP tools in the web process. Validate citations against answer receipts and capture usage before completion. Retain external state and provisioning metadata for an approved cutover.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Use shared signing for native assistant streams

Streaming requests share endpoint resolution, credential refresh and private
header filtering with the provider transport. Cancellation joins pending
signing before the producer exits. Reuse the deployment region setting and
regenerate its settings artifacts. Verify native enablement with serving TLS.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native answers retain publication proofs through response delivery

Whole replies retain nested source-access proofs through required accounting
and response delivery. Citations use returned help anchors, and native
configuration failures remain visible in the dashboard. Retained provisioning
credentials keep their rotation coverage while replaced polling paths are removed.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native authorization fixtures use the retained evidence paths

Route fixtures bind the answer-owned MCP app. Protected ledger fixtures exercise
the pure support rule with all authorization and marked-outcome expectations kept.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Assistant fixtures follow asynchronous credential admission

Keep authorization, revocation and whole-response publication assertions on
the provisioning-aware credential boundary used by the served routes.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant evidence uses request-owned receipts

Remove unused persisted-answer query code and preserve receipt-based support
assertions. Cover configuration admission and model-alias pricing, correct
configuration documentation and bounds, and align the disabled chat fixture
with the native refusal contract.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe SQL citations using answer-owned receipts

Keep persisted query metadata separate from citation verification and remove
unused support fixtures after the polling path is retired.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native display steps use the receipt formatter

Keep step labels and protected-row rules in the shared formatter. Retain the
local-model routing and container networking guidance alongside assistant setup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Translated setup links point to the native assistant guide

Regenerate the published setup destinations when the English guide is replaced.
Keep the translated text and source stamps for the translation updater.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Keep assistant archives private and bound retained credential writes

Create converted archives exclusively with owner-only permissions and keep
credential resealing statements inside the retained provisioning lease.
Remove unused ticket and accounting state and obsolete test seams.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Retain streamed source proofs and bound help citations

Keep nested tool publication guards through final accounting and refuse citations to unread help outline sections.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Exercise the terminal publication boundary in stream delivery tests

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover source proof loss before streamed assistant content

Exercise access changes during model generation and an awaited send while preserving final accounting and stream cleanup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Renew streamed source proofs at each HTTP send

Share retained source proofs with the HTTP request tail while keeping streamed accounting open until its terminal event. The new source-loss regressions reproduce unchecked private content before this repair.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant tests retain mirror admission and private accounting

Exercise real admission and response accounting through source activation, marked refusal, failed private delivery and repeated provider cancellation.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Clarify provider setup and failure diagnostics

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit d6675819a9447ce97f5f21e1b72747c8b1a1cd7b)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Refresh the provider architecture summary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Route the conflict judge in the single-provider recipe

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit f93385b019dc0978daa33b08392e717348c7643c)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe the dashboard model selection boundary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a6d8a1279a4a8fe4a4eae3b170610c662b52e0b5)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit cb594d01ade7d2b883849670db9f314a46f4abc4)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a94d2f9…
The TypeScript dependency installer uses the bundled pnpm. Pin a version that supports peer overrides, and check that syntax during toolchain installation.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
The collection primer sends the same scoped request and the SDK change parses response data. Record the current digests after reviewing those paths.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
* MCP grep offers a source read for related evidence (#1530)

An exact miss can still find enclosing scopes for a related expression. Attach the validated continuation to the related result so an agent can follow the indexed evidence.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Edit context ranks indirect tests across requested definitions (#1532)

Tests behind a caller cover the edit batch when they share its related names. Use the same ranking evidence as the direct test path.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code enrichment reads candidate limits from settings (#1503)

* Code enrichment reads candidate limits from settings

The unit gate rejects module-level candidate bounds. Validate both limits in the settings catalog before using them in edge queries.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Enrichment settings preserve the lookup work limits

Usage example coverage reads at most 50 paths. Bounding indirect candidates at 30 callers keeps synchronous source-window ranking within its existing workload.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The Loom site accepts self-hosted adoption reports (#1534)

The dashboard and report endpoint share a deployment. Serve the existing collector and daily repository snapshot from the site so self-hosted installs can reach them through the public origin.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP grep batches exact and related source reads (#1542)

* MCP grep batches exact and related source reads

A literal batch can return an exact test declaration and related source for another query. Include valid ranges from both evidence groups in the same source read suggestion.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep mixed grep reads for location-only matches

Validated ranges can drive a combined read when a caller requests zero excerpt lines. Preserve the continuation for languages without a named edit selector.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Complete grep excerpts at the verified indexed revision (#1545)

* Complete grep excerpts at the verified indexed revision

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep enrichment deadlines local to each page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep indirect test evidence for shared call sites (#1546)

Use the qualified caller and source location to recognize one call site across the parser and compiler index. Keep both symbol IDs for reading incoming test edges.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Mutation tests use pytest 9.1.1 (#1543)

Match the main test environment and give the dependency graph a fresh lockfile to scan.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption telemetry includes contact domains by default (#1544)

* Adoption telemetry includes contact domains by default

Use eligible namespace contacts from password and federated accounts so deployments can report aggregate domain activity across sign-in methods.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The adoption report test counts password contacts

Exercise the expanded contact scope in the live report test, including requests attributed to a password account.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Return fresh lessons from verified callers in code edit context (#1554)

* Keep fresh lessons for verified forwarding callers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep distinct verified caller lessons eligible

Select fresh links before reading a limited set of excerpts. Use the complete excerpt to distinguish lessons written under a shared key.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require fingerprint proof for verified caller lessons

Restrict exact-revision lesson reads to compatible, nonempty fingerprint comparisons. Ordinary symbol reads keep their existing state fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Verify restored caller lessons against their original source

Trust the checked hash only while its stored link still identifies located code. Keep ordinary symbol reads on their existing fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Link coding-agent memory guides to their verification steps (#1561)

Readers can check a cross-client handoff, a code-linked lesson and the SQL audit before choosing a team setup.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Preserve Python member reads when SCIP is indexed (#1566)

* Preserve Python member reads when SCIP is indexed

Resolve typed reads from the parser candidates in the same name query so a compiler ID for the same member cannot displace its parser edge.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Retain compiler-only Python member candidates

Prefer parser candidates per qualified name so a compiler-only member with the same short name remains readable.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Name agent memory capabilities in documentation search titles (#1567)

* Name agent memory capabilities in documentation search titles

Put each page’s task in its title and description so it makes sense outside the sidebar.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Distinguish request IDs from worker query tags in telemetry metadata

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show how edit context returns a caller’s saved lesson (#1569)

* Show how edit context returns a caller’s saved lesson

A coding agent can read the constraints that apply at a forwarding call before changing its dependency.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* State the source and access requirements for caller lessons

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Add an evaluation checklist for choosing coding-agent memory (#1571)

* Add an evaluation checklist for choosing coding-agent memory

Teams can use their requirements to choose a starting setup and copy the checks into a pilot.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require authenticated writes in the selector’s SQL audit check

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* LOOM_CODE_GIT_CA_FILE lets git trust a remote under a private authority (#1549)

Repository-job git reads no system or global git config and inherits no
environment beyond PATH, HOME, LANG and TMPDIR, so neither `http.sslCAInfo`
in a git config nor GIT_SSL_CAINFO or SSL_CERT_FILE reaches it: it verifies
with the image's default roots, and a git server whose certificate a private
authority issued fails every clone with "server verification failed:
certificate signer not trusted". The one setting that hands git a bundle,
LOOM_CODE_GIT_PROXY_CA_FILE, applies only through a forward proxy.

The new setting names a PEM bundle that `auth_env` passes to every repository
job as `http.sslCAInfo`. Through the proxy, LOOM_CODE_GIT_PROXY_CA_FILE is
appended after it and wins when set, so proxied deployments behave as before.
A deployment that does not set it is unchanged.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused compiler-tier delta holds its tier until a cap or the target changes (#1551)

* A refused compiler-tier delta holds its tier until a cap or the target changes

A delta tier whose delta `open_delta` refused (over a cap, a link, not a
regular file) recorded the failure and left its watermark, so every pass
ran the full harness again at the same commit and was refused the same way.

The tier now keeps the refused target and the delta caps in effect. While
both match, the next pass skips the entry before the checkout moves and the
failing record keeps its fix. A raised cap, a live setting, or a new branch
head releases it on the next pass. A delta that changed while it was read
holds nothing. The C/C++, TypeScript, Python and Go delta tiers share it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refusal hold records the caps its open read

The hold sampled the delta caps after `open_delta` failed, so a cap raised
while the open ran was recorded as the one the delta was refused under: a
1.5 MB delta refused at a 1 MB cap that was raised to 2 MB stayed held at
2 MB, where it opens.

`delta_caps` now reads the three caps once; `open_tier_delta` passes that
snapshot to `open_delta` and records the same one in the hold.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the namespace's counts and coverage (#1550)

* CLI backfill phases republish the namespace's counts and coverage

`code.index_status` and `code.repos` read `chunks_embedded` and
`embedding_coverage` from the shared `table_counts` row, and the Repositories
page reads per-language coverage from the shared `coverage` row. The ingest
pass republishes both after it moves rows; `loom code backfill` moves rows
outside it. A reader serves the counts row whatever watermarks it was computed
at, so after `--phase embed` status kept reporting the pre-embed coverage
(`embedding_coverage: 0.0`, `searchable: false`, `code.search` answering
lexically) until an ingest pass moved the namespace's rows again. Embedding
moves no watermark, so the coverage row stayed current to its readers as well.

Each phase that wrote something republishes both rows at its end, as the
ingest pass does. A failed refresh is printed and does not fail the finished
phase.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the counts at every phase end

The republish ran only when this run's own counters were nonzero. A resumed
index whose cursor was already at the end, or an embed phase whose last page
landed before the process died, wrote its rows in an earlier process and so
left the pre-backfill `table_counts` row in place. Both phase ends now
republish unconditionally; a republish is one query per row.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The embed phase republishes the counts only for an org it declared

An embed phase with nothing pending republished without declaring its org, so a
mistyped --org wrote counts and coverage rows that the cell never gated. With
nothing pending, the phase now declares and republishes only a namespace that
already has a counts row; a mistyped org has none and writes nothing.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A full index run republishes the counts after its watermark

The full-run path republished in `_close_index`, before it wrote `git_head`.
Both rows carry the counts fingerprint, `git_head` included, so `code.coverage`
rejected the new coverage row and the next reader ran the aggregates again. A
full run now republishes after the watermark and the backfill stamps; a hold,
a repair and a twin label write no watermark and republish in `_close_index`
as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The Anthropic client sends a JSON Schema as the Messages API's structured output (#1311)

* The Anthropic client sends a JSON Schema as the Messages API's structured output

A json_schema response format was dropped, so the conflict resolver's Claude answers came back in a shape parse_verdicts could not read and every judgement failed while still being billed. The schema now goes in output_config.format and into the JSON directive, which keeps the shape when a model refuses output_config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A refusal of one output_config key drops that key alone

A 400 naming output_config.effort recorded a refusal of the whole output_config, so later schema requests to the same model lost output_config.format. traits.refused_key records output_config.effort or output_config.format on its own, and the Anthropic client leaves the other key in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A rejected schema drops the format for that request alone

A 400 that points inside the sent schema (output_config.format.schema...)
rejects that schema, not the model's structured output. The call is re-sent
without the format and nothing is remembered for the model, so later
requests still send their schema. Refusals of output_config.format itself
are still learned per model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

---------

Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* The embed phase binds its candidate keys a slice at a time (#1547)

`loom code backfill --phase embed` failed on a ClickHouse at its default
`http_max_field_value_size` (128 KiB) with "HTML Form Exception: Field value
too long". `pending_embed_chunks` asks phase 1 for four times the page size
(2,000 keys for the CLI's page of 500) and bound every (path, chunk_id) pair
as one form field in the phase-2 FINAL read; at ordinary path lengths that
list is several hundred KiB.

Phase 2 goes through `query_all_sliced`, as other keyed reads do. Each slice
keeps its own oldest `limit` rows and the slices' rows are ordered and capped
together, so the page is the oldest-first page one statement would return.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Link the memory selector from the agent documentation index (#1574)

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings (#1572)

* Format the coding-agent memory selector page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings

Resolve local actions from the workflow commit, verify translations from a scheduled job, install npm packages from lockfiles, and validate each docs destination as a parsed link.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Include the selector page in the IndexNow route test

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Pin the coverage action to its full commit SHA

The plugin scanner requires a full SHA for action references it treats as remote.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep queued translation requests during scheduled checks

Finalizer polls and translation batches share one queue. Keep pending requests available while the current run finishes.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption shows active reported contact domains (#1577)

List domains with successful requests over 90 complete days. Use report version 2 to keep domains collected under the private notice out of the public list.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Replay how Loom memory follows source edits (#1588)

* Replay how Loom memory follows source edits

Show branch-specific lesson states from a recorded comparison and let readers repeat the evaluation on a disposable hosted runner.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scope evaluation cleanup to its server job

Finish the fork instructions and apply the site formatter.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep pytest node paths out of code anchors (#1589)

* Keep pytest node paths out of code anchors

A pytest command can make a file extension look like a qualified symbol. Skip selectors with explicit Python paths so a note can link the declarations it names.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Handle class-only and nested pytest node selectors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep attached decorators in Python test examples (#1592)

A context window that starts at the function declaration hides decorators that still belong to the test. Reuse the retained chunk to prove the decorator prefix and stay within the requested radius.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Grep cursors keep their path filters (#1594)

A page offset belongs to the original file selection. Bind that scope before reading the saved pool or retrying the query.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code edges keep distinct relationship kinds across index tiers (#1595)

A compiler call and a parser read at the same location describe different relationships. Collapse the rows only when their kinds agree.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Search cursors keep their original filters (#1596)

A page offset belongs to the results selected by the original filters. Verify those filters before serving a saved page or rerunning the search.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-target edit context returns verified member source (#1598)

* Single-target edit context returns verified member source

Agents can use one exact name and get the same revision-verified member source as a one-name batch.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Describe member sources for both edit context forms

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* File-qualified symbols resolve unique indexed path suffixes (#1600)

When a relative spelling omits a source directory, look up the symbol on the one live indexed file with that complete suffix. Keep an existing path as the lookup boundary and leave ambiguous suffixes unresolved.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Edit batches share verified test source reads (#1601)

* Edit batches share verified test source reads

Reuse a verified source window when several named targets cite the same test. Keep each citation and deadline and drain pending reads before the batch exits.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bound shared edit example reads

Apply the enrichment deadline to the shared source read. A later waiter can retry after a stalled read reaches its deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lessons verify the commit while reading source (#1602)

* Single-file lessons verify the commit while reading source

A successful bounded local blob read proves that the mirror holds the pinned commit. Use one Git process for that case and keep the mirror availability check when the local read cannot supply the file.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lesson reads share one parse deadline

The fallback spends only the source-read time left after a local miss. Keep the mirror availability check and bound both paths with the same deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Erasing a code namespace removes its cached code.ask answers (#1585)

* A code namespace erasure deletes the cached code.ask answers asked in it

The erasure step for cached code.ask answers deleted only those that quoted the
erased namespace's memories (`memory_namespace`). An answer asked in the erased code
namespace carries the repository's code in its text and was left in
`loom.code_answers`, uncounted by the residue census. After a re-index of the same
commit it was served again, since the cache invalidates only when a cited file changes.

The step and the census now match a row by `namespace` as well as `memory_namespace`.
The delete stays a lightweight delete read sequentially, and the census still skips a
tombstone that holds no text.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Align the answer-cache erasure docs and comments with the changed step

The architecture doc still said an answer drawn from the code index alone stays;
a namespace erasure now deletes it with the code namespace it was asked in. The
module docstring of the answer-cache erasure tests, the `namespace_tables`
docstring and one test docstring described the old predicate, and the comment on
`KEEP_TABLES` now says only what is not purged there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Guard every cached answer against an erasure, not only memory-quoting ones

An ask can finish synthesizing after the namespace delete and the final
census. The answer cache skipped its erasure check when the answer quoted no
memory, so a code-only answer could land in the erased namespace. Run the
before-and-after write guard for every answer, and delete a code-only answer
that lands after the mark by its own key.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* An abstain's negative cache entry is guarded against an erasure and counted by its census

An abstaining ask that overlapped a namespace delete could recreate its cached
question afterwards: the negative entry was written without the erasure check,
and the census skipped it because its answer and citations are empty. The
negative write now runs the same before-and-after guard as a synthesized
answer, and the namespace census counts a row that holds a question.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refresh the analyzer shapes and the tombstone sentence for the code-only guard

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits (#1562)

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits

The pass ordered every entry's pending commits by commit time, floored at a
24-hour horizon. A mirror far behind on older history therefore outranked
every recent commit of every other entry, and while its backlog lasted a
branch with one new merge stayed at 0 of 1 pass after pass.

Each round now gives every waiting entry one commit, the entry with the
fewest landed this pass first, then entry order. Within an entry commits
stay oldest first, so the watermark still moves one commit at a time. At the
budget the entry the scheduler would have served next is cut first, and the
next pass starts there through the existing `commits` cut and `rotate_to`.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A sliced commit counts as its entry's turn in the round-robin

A commit sliced at the share clock returned before the entry's landed count
moved, so it was deferred at the same key as the entries the round had not
reached and won the tie on entry order. The `commits` cut then named the entry
that had just been served, and a small entry behind sliced large ones stayed at
0 of 1 pass after pass.

A sliced entry is now deferred one turn later than its landed count, so the cut
names the entry the round did not reach and the next pass starts there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The commit-phase tests state the round-robin order and drop unused commit times

The scheduler no longer reads commit times, but the test helpers still took a
`times` map and patched `commit_meta_many`, so the dates passed to every
fixture were inert and two test names read as if a date were an input. The
helpers lose the parameter and the patch, the cases are named by backlog
size, and the lanes and round-robin docstrings and one assertion message now
describe the order across entries as round-robin.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The ingest cut names an entry by org and namespace, so two orgs sharing a namespace alternate

The cursor a cut pass leaves named the entry by namespace alone, and
`rotate_to` took the first entry of that name. With `code-widgets` in two
orgs and a budget for one commit, both cuts named the second org's entry and
both passes served the first org's.

A cut is now kept as `<org>/<namespace>:<leg>` and the commit, bootstrap and
walk phases rotate on `cut_key` (org and namespace). `cut_phase` reads the leg
after the last colon, so an org name containing one still parses. A cursor
written before this names no org and matches no entry: the pass keeps the
configured order once, and the next cut is written in the new form. A build
without this change reads the new form the same way (rolling-upgrades, rule 4).

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the leftover commit-times argument from two ingest tests

Two callers still passed a map of commit times as the helper's third
argument, which since the helper dropped its times parameter is the
per-commit file count. A time of about 1.7 billion became that many
file names, so the run grew until the memory limit killed it. Both
callers use the helper's defaults now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The budget-cut test expects the org-keyed resume point

The cut now resumes at org/namespace:leg, so the existing test reads
o/code-x:walk.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* A refused compiler-tier delta holds its tier on the whole run, not on its target and caps (#1582)

The hold a refused delta leaves (<watermark>_refused) recorded only the target
and the three caps its open read. The run's window starts at the tier's
watermark, which other writers move (`loom code scip-full`, a batch apply, a
base-unknown reset), and the harness reads inputs the key did not carry
(exclude_generated for Go, scip_ts_projects and code_scip_ts_paths for
TypeScript, code_scip_delta_max_tus for C/C++). So a tier stayed held after its
watermark moved, after a branch was force-pushed back to the refused commit,
and after the entry's generated-file rule changed, each of which makes the next
run a different one.

The record is now {base, target, caps, inputs, loom}, written as sorted JSON so
code_index_state shows why a tier is held. `base` is the watermark the run
started from, `inputs` is what the tier's harness reads besides the window (an
empty object for Python), and `loom` is the release. Each delta worker reads
those inputs once per pass and builds the harness environment and the hold from
that one snapshot, so a setting changed while the harness runs cannot make the
record differ from the run. A hold that cannot be written fails its pass with
the store error, and the next pass runs the harness again.

Holds written by the previous format never match, so each held tier runs once
more after the upgrade and holds again. The operations guide names what the
hold keys on and what releases it, and no longer says extra Go deltas hold.

The tests are the three cases the review found, on a moved base, a branch
pushed back to a refused commit and a changed generated-file rule, plus the
translation-unit cap read once per pass and each tier's inputs in the record.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes (#1552)

* loom code backfill keeps an owed edge pass across a resume

A first full backfill implies the edges-only second pass, but only while
its cursor is empty. A first backfill stopped in its index phase (a held
org, a SIGTERM, a crash) resumes with the cursor set, and a rerun after an
interrupted edge pass finds the cursor at its end: both finish, write
`git_head` and drop the pass, so the namespace's cross-file references
stay unbound and nothing says so.

The run now records why it owes the pass (`first-backfill`, or
`requested` for `--edges-second-pass`) under
`backfill_edges_owed:index<suffix>` before its first batch, and clears the
record once the pass is done. A resumed run or a rerun reads the record and
runs the pass; `--no-edges-second-pass` declines it and clears the record.
A `--paths-file` repair records nothing, as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom runs a parsed command through one entry, dispatch.run_parsed

A command's context is bound in two places: `main` wires the process's
seams, and `_dispatch` binds the traffic class, the query tag, the actor
and the org the command bills. A second process that runs a share of a
command's work needs exactly that, so it is one function now,
`run_parsed(args)`, in its own module, `server/cli/dispatch.py`, with
`_dispatch`. `app.main` parses and calls it. A family module may import
`dispatch` without importing `app`, so the package's one-way import rule
holds. Nothing a command does changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill runs its batches through one run, cut at the header/source boundary

The index phase's reader and ingest and the edge pass's ingest move from
closures in `_backfill` and `_second_edge_pass` into `_Run`, built once
from the entry, the head, the embedder and the denylist; a batch of either
pass is a method on it. The code is the closures' code, reading its fields
from `self`.

`_cursor_batches` hands out the batches with their first index. The
headers `headers_first` puts first end their own batch, so no batch holds
both a header and a source and every header can be written before any
source batch starts. A resumed run starts at its cursor wherever an
earlier build cut.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes

One backfill process parses and extracts at about one core, whatever
--concurrency says: every tree-sitter parse holds the interpreter lock and
runs one at a time per process, and the extraction after it walks the tree
in Python. A tree does not pickle and a file's extraction reads the index
between its steps, so a worker takes a whole cursor batch: its own
connection, reads, parse, extraction and writes.

A worker is the command itself. The parent starts N spawned processes on
its own parsed arguments; each enters through dispatch.run_parsed, as
`loom` does, so it runs under every binding the command runs under: the
background traffic class, the cli.code.backfill query tag and operation,
the org it bills, logging, telemetry, SIGTERM and Ctrl-C handling, the
wired seams, the model-work admission and the registry read. `_backfill`
then serves the batches it is sent instead of walking the tree, each
awaited in the command's own task. One pipe per worker carries its batches
and their counters; nothing crosses but paths, counters and the reason a
batch was held.

The parent hands a worker its next batch when the worker reports its
last, so once a batch is held nothing more starts, and the batches still
running are counted. The cursor moves past a batch once every earlier one
is written. The header batches are all written before the first source
batch is handed out. A worker caches what it reads of the index (header
texts, the import resolver's live path set, layouts and listings), and
another worker's writes do not reach those caches, so it forgets them when
it moves to the sources and to the edge pass, which therefore reads the
finished index. The edge pass forgets them in one process too: the Go
listing and the other resolver caches outlived the index phase by up to
their TTL, so the pass did not re-derive what it claimed to. The same
workers serve both passes, admitted once, as the parent is.

A run whose workers wrote batches side by side owes the edge pass whatever
the flags say, recorded as `workers`: a file there resolved against what
its worker had read while the others were still writing. `--paths-file`
and `--no-edges-second-pass` runs with --workers run it, and a later
backfill that finds it owed runs it.

Stopping: a closing pipe cancels the worker's command task, as its own
SIGTERM or Ctrl-C does, so a stop of the parent, of the worker or of the
whole process group unwinds through the batch before the worker retires.
The parent closes the pipes when the run ends, fails or is cancelled, and
a killed parent closes them too. The parent reads every exit code: a
worker that exits before its run opened, in a batch (named with its first
index, and with the signal when one killed it), or on close (a failed
drain or retirement) fails the command; on close only after the command
has written its own end of the run, as one process retires after its
command returns. --workers is refused below 1 and with --phase embed, and
no more workers start than a pass has batches. --workers 1, the default,
keeps one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep the edge pass owed when a pass ends with errors

A worker's edge batch can return with errors when a file write fails.
The owed record now clears only when the pass reports none, so a resume
runs the pass again. The test fails an edge write in a two-worker run
and resumes in one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Index embed-excluded paths without a description or a vector (#1564)

* Index embed-excluded paths without a description or a vector

A repository entry's `embed_exclude` globs (`LOOM_CODE_EMBED_EXCLUDE` for
the scalar entry, the `exclude` glob semantics) keep a path in the index:
it is chunked, its symbols, edges and test map are derived, and code.search
reaches its chunks through the lexical leg. Its new chunks are neither
described nor embedded, in the file ingest and in the round's prefetch, and
`loom code describe` leaves them alone. The rows carry
`unembedded by design: embed_exclude`.

Embed recovery and the coverage counts now match the shared prefix
`unembedded by design`, so reference fixtures and embed-excluded chunks
are neither stubs to fill nor counted in the embeddable denominator. Rows
already stored under the reference marker match it unchanged.

Test files are often a large share of a repository's chunks; this lets an
operator spend the embedder on source and reach tests from the source hit
through the test map.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep unembedded-by-design chunks without a vector in reembed

`loom code reembed` copies a row that carries the `unembedded by design` marker under the second label with its marker and no vector, so an embed-excluded path or a reference fixture is not embedded there and that label's recovery leaves it alone.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep every vector and description writer off embed-excluded paths

The provider rebuild embedded every live `code_chunks` row and cleared
`embed_last_error`, so a staged embedder switch gave embed-excluded chunks
and reference fixtures a vector and erased their marker. It now stages a
row marked unembedded by design without a vector and keeps the marker.

The `code_summary` pass wrote an LLM card and a card vector for an
embed-excluded file, and could carry a twin's card across models. It now
takes the entry's `embed_exclude` globs (`denylist_for`), writes and carries
no card for a matching file, and clears a card written before the glob: the
row keeps its rank and carries the marker, so recovery and the card leg of
code.search skip it. Removing the glob lets the next pass write the card.

`unembedded_by_design` is the one predicate the Python writers read the
marker with. A test discovers every code-plane module that calls an
embedder or an LLM and fails until a new one is declared as a writer gated
on the marker or the globs, or as a query-side reader; the round prefetch
filter, the describe skip and the marker precedence get their own tests.
`ReembedStats.rows_unembedded` had no reader and is dropped.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Resolve the ingest denylist once per file

`ingest_file` resolved `default_denylist()` in `_refused` and again for the
embed rule; it now resolves it once and passes it down. The chunk stage's
`embed_excluded` has its one caller pass it, and the marker choice reads as
one expression.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Document embed_exclude on a changed glob, a rollback and self-service entries

The operations guide states what a changed glob does: adding one leaves
existing vectors until a chunk changes, and removing one leaves the chunks
unembedded and outside the coverage denominator, embedded again when their
content changes or when the repository is indexed into a new namespace.
`embed_exclude` applies to configured entries only. A rolling-upgrades entry
records how an older build reads the marker as a stub. The coverage
comments name both kinds of rows unembedded by design, and the setting's
comment is cut to two lines; the generated references are regenerated.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* simplify: N-1-safe marker, drop the enumeration test and the card clear

The embed_exclude marker now extends the reference fixtures' marker
(`unembedded by design: reference (embed_exclude)`), so the previous build's
recovery, backfill embed phase and coverage counts, which match
`unembedded by design: reference` as a prefix, skip it as this build's do.
The recovery and coverage reads keep main's parameter.

A test pins the reference literal, and a cross-version test checks that the
row ingest stores is skipped by the previous build's recovery predicate and by
this build's.

The code_summary pass no longer clears a card written before its file's glob:
a card, like a chunk, keeps the state it had when the glob was set. The
candidate and carry filters stay.

The model-caller enumeration test is gone: it was a closed list that every new
caller had to edit, and it passed with the ingest gate removed. The reembed,
provider rebuild and card tests move beside their existing fakes, and the
recovery parameter check already in test_code_reference_files.py stays the
only one. reembed partitions its rows in one loop and reads the column it
always selects. Rule 63 and the operations guide say what is true now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An embed-excluded file's card goes once the file changes

The code_summary pass leaves embed-excluded paths out of its candidates, so a
card written before the path's glob was never rewritten or removed after the
file changed: code.map and the cards leg kept serving a description of the old
content.

The pass now tombstones the live card of an excluded path whose inputs_hash no
longer matches the file's content hash, a deleted file included. A card that
still matches the file stays, as before, and a rank row without a card is left
alone. The next code_graph_stats pass writes the file's rank row back. The
operations guide says the card stays until the file changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Spell the full setting name in the coverage description

code_ready_embed_coverage named embed_exclude by its suffix; it now
names code_embed_exclude, and the example file and schema follow.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Regenerate the configuration reference for the coverage description

scripts/codegen/settings_reference.py after 59fc1016f's catalog wording change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Write the graph-stats rank copy just above the card it read

The ranks leg reads a live file card, then inserts a mirror of it with the
new rank at the clock version. A tombstone or a new summary written in
between carries an earlier version than that copy, so the copy won under
FINAL and brought back a card retired meanwhile.

The copy now takes the read card's version plus one. Every other writer
takes its version from the clock, so a later tombstone or summary is
higher and wins; with no write in between the copy is still the newest
row.

The test reads a card, lets the tombstone land during the read and checks
that FINAL keeps the tombstone. It fails without the change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The operations guide says LOOM_CODE_GIT_CA_FILE sets trust, not reach (#1580)

* The operations guide says what LOOM_CODE_GIT_CA_FILE settles and what it does not

The guide's paragraph for LOOM_CODE_GIT_CA_FILE read as if the setting made a
forge under a private authority indexable. It settles trust only: in the
repository-job sandbox the egress proxy still refuses a remote whose name
resolves to a loopback, private or link-local address, and no setting admits
one, so such a forge indexes only as an operator repository on a host without
the sandbox. The guide now says so.

It also says what the bundle applies to (every git a repository job runs, the
compiler tier's dependency fetches and submodule updates included, so the
bundle must hold the public roots when any of those reach a public host) and
that the path is not checked when the setting loads: it must be absolute and
inside the sandbox's read-only /etc/ssl, and a relative or `~/` path, or a link
leaving /etc/ssl, fails in git's own words. The "CA bundles" paragraph now
counts three bundles and says which one git uses through the proxy.

The unit test imports asyncio at the top of the module. No behaviour changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Name the trees the repository-job sandbox mounts for the git CA bundle

A link out of /etc/ssl can still work: the sandbox also mounts /usr and
/etc/ca-certificates read-only, so a link into /usr/share/ca-certificates
resolves to the same file. Say the target must be visible to the job and
keep /etc/ssl as the suggested location.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The mirror sweep keeps the tier checkouts of an entry that names no producer (#1584)

* The mirror sweep keeps the tier checkouts of an entry that names no producer

`_named_paths` named `checkout_for(c, "")` for each entry. For an entry with
no `scip_producer` that is `<checkout>.`, a path no tier uses, so the
checkout of the tier its tree calls for (`<checkout>.python`,
`<checkout>.typescript`, `<checkout>.go`) was named by nothing. `_sweep_root`
removes an unnamed `checkout-*` directory older than 600 s, so a self-service
entry's tier checkout was deleted and copied again over and over. A
configured entry is unaffected unless its checkout sits under
`code_repos_root`.

Name `checkout_for(c, p)` for every producer the tiers can run, plus the
entry's `scip_extra_producers`, and for each registry row its checkout and
the sibling of every producer. `repos.sibling_checkout` holds the one
spelling of a sibling path, so the sweep and `checkout_for` cannot drift.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the clause about the removed call from the sweep comment

The comment above `checkouts` in `_named_paths` described a line the previous
commit removed. It now says what the code does.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Sweep only the named tiers of an entry that names its producer

An entry with a scip_producer runs that tier and its extras only, yet the
sweep named every tier's checkout for it, so the old checkout of a tier
removed from its extras stayed on disk until the repository went. Keep all
candidate tiers for an entry naming no producer and only the named ones
otherwise.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The CLI embed phase republishes only when behind, once, with coverage first (#1581)

* A backfill phase republishes once, last, and only where the counts trail

With nothing pending, the embed phase declared its org and republished
whenever a `table_counts` row existed. Readers write that row: `loom code
stats` with a mistyped --org leaves a row of zeros, so the same typo on
`--phase embed` declared the org, and every idle embed run on an indexed
namespace paid the org gate, the count scans and the coverage aggregates.
It now declares only when rows are pending or the published chunk counts
differ from the chunk table. That comparison is a store read,
`CodeRepo.published_chunks_behind`, over the shared counts and the chunk
aggregate.

The index phase writes `git_head` and the backfill stamps first, then
`_close_index` compacts, records the pass and republishes last on every
exit (a full run, a run resumed at the end of its cursor, a hold, a repair,
a twin label), so the `republish` flag is gone. The cursor is cleared after
the republish, so a run interrupted while it publishes resumes at the end
and publishes then.

The republish writes the coverage row first and the counts row only once the
coverage has landed. An embed phase stopped between the two, by Ctrl-C or a
failed coverage refresh, otherwise left the counts current and the coverage
at the pre-embed vectors with a matching fingerprint, and the rerun found
nothing behind. It also reads with sequential consistency: the fingerprint
it stamps carries the `git_head` the run has just written, which the replica
serving the read may not have yet.

The tests drive `_backfill` and `_backfill_embed` against the real
`CodeRepo` over a replica that lags the run's writes, and read the rows
back.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused coverage write keeps the counts behind

The CLI writes the counts row only once the coverage row has landed, but
`refresh_coverage` swallowed its own write failure, so the counts landed
anyway and the next embed phase found nothing behind. The CLI now passes
`must_land=True`, which makes the coverage write raise.

`published_chunks_behind` also reads the coverage row's embedded figure,
so current counts over a coverage row that trails the chunks still count
as behind. That state comes from vectors landing between the two writes,
or from an earlier build that published counts after a failed coverage
write.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An existing coverage row is compared even when the counts row is missing

When the index phase published coverage and its first counts write failed,
an embed phase that landed its last vectors and stopped before publishing
left an idle rerun reading a missing counts row as nothing to republish.
published_chunks_behind now compares the coverage row on its own.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* Show repository freshness from mirror health (#1604)

A successful mirror fetch can leave the same commit indexed for days. Use the server’s overdue-fetch flag for the badge and keep deployment worker errors in the worker diagnostics.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires (#1002)

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires

A confirmed renewal can extend the deadline while the previous wait resumes. Use the current freshness before stopping workers, and retain genuine expiry controls.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover the review provenance default in Cell proof refusals

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

---------

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Edit context includes verified indexed forwarding targets (#1494)

* Edit context includes verified indexed forwarding targets

When one typed forwarding call resolves in the same index revision, cite the target in read_sources. Share the bounded lookup between single and batched edits and keep existing member reads independent.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Load forwarding helpers after the code modules initialize

Initialize grep and edit context in either order by loading forwarding helpers only when the optional source lookup runs.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Use scoped cursors in vector continuation fixtures

Keep the original search scope on stored cursors so the fixture exercises continuation without fresh retrieval.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bump the actions group across 1 directory with 3 updates (#1516)

* Bump the actions group across 1 directory with 3 updates

Bumps the actions group with 3 updates in the / directory: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv), [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `astral-sh/setup-uv` from 10.3.3 to 10.4.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/68559e99cc807c1eb7e9238fd43a15bba460eec2...1db35dd8eee11c5894872e0b383ae6c406cf738d)

Updates `ossf/scorecard-action` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/fa7117db83c52d787ae5a89f350999701505d78e...23f22cd43608bae7a1f1fa2603d7314dee9538a5)

Updates `github/codeql-action/upload-sarif` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.1...33d7b85da1a04171e211befe2c739303b9a4c066)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>

* Scorecard fails when the API rejects a publication

The updated action warns by default. Opt into failure on API rejection so a stale public result is visible in the workflow status.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scorecard uploads SARIF when publishing fails

Upload the completed scan when the file exists so a publication rejection still leaves results in code scanning.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep excerpt bounds in the compact coding schema (#1613)

Numeric bounds in JSON Schema do not constrain string values. List the
grep context radius as an integer so its existing bounds apply while
the server still accepts and validates numeric strings.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code read accepts same-file line pairs (#1614)

* Read same-file line pairs in one source request

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Advertise code read pair endpoints as integers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP validation errors omit rejected retry examples (#1612)

* Omit invalid retry examples from tool errors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep retry examples faithful to supplied values

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Validate corrected arguments and keep explicit scope out of retry guidance

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show missing-field templates only for fillable arguments

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep spelling corrections within their original argument object

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Compact SCIP replies omit documentation present in function bodies (#1617)

SCIP wraps declarations and can unquote forward references. Compare the
Python function headers and docstrings before dropping a description.
Keep any description whose declaration or documentation adds evidence.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The assistant runs natively with caller-scoped tools (#995)

* Run the assistant natively without a bundled chat service

Own bounded streaming model turns and authenticated MCP tools in the web process. Validate citations against answer receipts and capture usage before completion. Retain external state and provisioning metadata for an approved cutover.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Use shared signing for native assistant streams

Streaming requests share endpoint resolution, credential refresh and private
header filtering with the provider transport. Cancellation joins pending
signing before the producer exits. Reuse the deployment region setting and
regenerate its settings artifacts. Verify native enablement with serving TLS.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native answers retain publication proofs through response delivery

Whole replies retain nested source-access proofs through required accounting
and response delivery. Citations use returned help anchors, and native
configuration failures remain visible in the dashboard. Retained provisioning
credentials keep their rotation coverage while replaced polling paths are removed.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native authorization fixtures use the retained evidence paths

Route fixtures bind the answer-owned MCP app. Protected ledger fixtures exercise
the pure support rule with all authorization and marked-outcome expectations kept.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Assistant fixtures follow asynchronous credential admission

Keep authorization, revocation and whole-response publication assertions on
the provisioning-aware credential boundary used by the served routes.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant evidence uses request-owned receipts

Remove unused persisted-answer query code and preserve receipt-based support
assertions. Cover configuration admission and model-alias pricing, correct
configuration documentation and bounds, and align the disabled chat fixture
with the native refusal contract.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe SQL citations using answer-owned receipts

Keep persisted query metadata separate from citation verification and remove
unused support fixtures after the polling path is retired.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native display steps use the receipt formatter

Keep step labels and protected-row rules in the shared formatter. Retain the
local-model routing and container networking guidance alongside assistant setup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Translated setup links point to the native assistant guide

Regenerate the published setup destinations when the English guide is replaced.
Keep the translated text and source stamps for the translation updater.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Keep assistant archives private and bound retained credential writes

Create converted archives exclusively with owner-only permissions and keep
credential resealing statements inside the retained provisioning lease.
Remove unused ticket and accounting state and obsolete test seams.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Retain streamed source proofs and bound help citations

Keep nested tool publication guards through final accounting and refuse citations to unread help outline sections.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Exercise the terminal publication boundary in stream delivery tests

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover source proof loss before streamed assistant content

Exercise access changes during model generation and an awaited send while preserving final accounting and stream cleanup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Renew streamed source proofs at each HTTP send

Share retained source proofs with the HTTP request tail while keeping streamed accounting open until its terminal event. The new source-loss regressions reproduce unchecked private content before this repair.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant tests retain mirror admission and private accounting

Exercise real admission and response accounting through source activation, marked refusal, failed private delivery and repeated provider cancellation.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Clarify provider setup and failure diagnostics

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit d6675819a9447ce97f5f21e1b72747c8b1a1cd7b)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Refresh the provider architecture summary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Route the conflict judge in the single-provider recipe

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit f93385b019dc0978daa33b08392e717348c7643c)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe the dashboard model selection boundary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a6d8a1279a4a8fe4a4eae3b170610c662b52e0b5)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit cb594d01ade7d2b883849670db9f314a46f4abc4)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a94d2f909a47d61532d0f6ac24aad79b09ac42b9)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Isolate retirement fixture timing in assistant qualification

Compose the reviewed retirement fixture clock so handler startup does not consume cancellation checks. Keep the original deadline and assertion bodies.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Verify assistant code citations against complete returned source

Code cards and skeletons retain original line bounds while withholding source. Require a complete unelided unit or file body with matching line bounds before verifying a code citation. Cover malformed and withheld spans while preserving full-source positives and other citation kinds.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Grep fallback tests separate deadlines from response handling

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a909dad266915b5ad6202d8d3c7d5a16bb635bbc)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound native gateway refusal reads before stream parsing

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 9ea1817ab4f9e5273c45666a00bf5fdd6544ec88)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant checks use receipt verdicts and caller context

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Redaction cost samples meet their CPU clock floor

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe assistant support from answer-owned receipts

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bedrock rejects content block indices after close

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Remove an unused citation test…
* Edit context ranks indirect tests across requested definitions (#1532)

Tests behind a caller cover the edit batch when they share its related names. Use the same ranking evidence as the direct test path.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code enrichment reads candidate limits from settings (#1503)

* Code enrichment reads candidate limits from settings

The unit gate rejects module-level candidate bounds. Validate both limits in the settings catalog before using them in edge queries.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Enrichment settings preserve the lookup work limits

Usage example coverage reads at most 50 paths. Bounding indirect candidates at 30 callers keeps synchronous source-window ranking within its existing workload.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The Loom site accepts self-hosted adoption reports (#1534)

The dashboard and report endpoint share a deployment. Serve the existing collector and daily repository snapshot from the site so self-hosted installs can reach them through the public origin.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP grep batches exact and related source reads (#1542)

* MCP grep batches exact and related source reads

A literal batch can return an exact test declaration and related source for another query. Include valid ranges from both evidence groups in the same source read suggestion.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep mixed grep reads for location-only matches

Validated ranges can drive a combined read when a caller requests zero excerpt lines. Preserve the continuation for languages without a named edit selector.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Complete grep excerpts at the verified indexed revision (#1545)

* Complete grep excerpts at the verified indexed revision

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep enrichment deadlines local to each page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep indirect test evidence for shared call sites (#1546)

Use the qualified caller and source location to recognize one call site across the parser and compiler index. Keep both symbol IDs for reading incoming test edges.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Mutation tests use pytest 9.1.1 (#1543)

Match the main test environment and give the dependency graph a fresh lockfile to scan.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption telemetry includes contact domains by default (#1544)

* Adoption telemetry includes contact domains by default

Use eligible namespace contacts from password and federated accounts so deployments can report aggregate domain activity across sign-in methods.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The adoption report test counts password contacts

Exercise the expanded contact scope in the live report test, including requests attributed to a password account.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Return fresh lessons from verified callers in code edit context (#1554)

* Keep fresh lessons for verified forwarding callers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep distinct verified caller lessons eligible

Select fresh links before reading a limited set of excerpts. Use the complete excerpt to distinguish lessons written under a shared key.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require fingerprint proof for verified caller lessons

Restrict exact-revision lesson reads to compatible, nonempty fingerprint comparisons. Ordinary symbol reads keep their existing state fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Verify restored caller lessons against their original source

Trust the checked hash only while its stored link still identifies located code. Keep ordinary symbol reads on their existing fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Link coding-agent memory guides to their verification steps (#1561)

Readers can check a cross-client handoff, a code-linked lesson and the SQL audit before choosing a team setup.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Preserve Python member reads when SCIP is indexed (#1566)

* Preserve Python member reads when SCIP is indexed

Resolve typed reads from the parser candidates in the same name query so a compiler ID for the same member cannot displace its parser edge.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Retain compiler-only Python member candidates

Prefer parser candidates per qualified name so a compiler-only member with the same short name remains readable.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Name agent memory capabilities in documentation search titles (#1567)

* Name agent memory capabilities in documentation search titles

Put each page’s task in its title and description so it makes sense outside the sidebar.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Distinguish request IDs from worker query tags in telemetry metadata

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show how edit context returns a caller’s saved lesson (#1569)

* Show how edit context returns a caller’s saved lesson

A coding agent can read the constraints that apply at a forwarding call before changing its dependency.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* State the source and access requirements for caller lessons

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Add an evaluation checklist for choosing coding-agent memory (#1571)

* Add an evaluation checklist for choosing coding-agent memory

Teams can use their requirements to choose a starting setup and copy the checks into a pilot.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require authenticated writes in the selector’s SQL audit check

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* LOOM_CODE_GIT_CA_FILE lets git trust a remote under a private authority (#1549)

Repository-job git reads no system or global git config and inherits no
environment beyond PATH, HOME, LANG and TMPDIR, so neither `http.sslCAInfo`
in a git config nor GIT_SSL_CAINFO or SSL_CERT_FILE reaches it: it verifies
with the image's default roots, and a git server whose certificate a private
authority issued fails every clone with "server verification failed:
certificate signer not trusted". The one setting that hands git a bundle,
LOOM_CODE_GIT_PROXY_CA_FILE, applies only through a forward proxy.

The new setting names a PEM bundle that `auth_env` passes to every repository
job as `http.sslCAInfo`. Through the proxy, LOOM_CODE_GIT_PROXY_CA_FILE is
appended after it and wins when set, so proxied deployments behave as before.
A deployment that does not set it is unchanged.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused compiler-tier delta holds its tier until a cap or the target changes (#1551)

* A refused compiler-tier delta holds its tier until a cap or the target changes

A delta tier whose delta `open_delta` refused (over a cap, a link, not a
regular file) recorded the failure and left its watermark, so every pass
ran the full harness again at the same commit and was refused the same way.

The tier now keeps the refused target and the delta caps in effect. While
both match, the next pass skips the entry before the checkout moves and the
failing record keeps its fix. A raised cap, a live setting, or a new branch
head releases it on the next pass. A delta that changed while it was read
holds nothing. The C/C++, TypeScript, Python and Go delta tiers share it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refusal hold records the caps its open read

The hold sampled the delta caps after `open_delta` failed, so a cap raised
while the open ran was recorded as the one the delta was refused under: a
1.5 MB delta refused at a 1 MB cap that was raised to 2 MB stayed held at
2 MB, where it opens.

`delta_caps` now reads the three caps once; `open_tier_delta` passes that
snapshot to `open_delta` and records the same one in the hold.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the namespace's counts and coverage (#1550)

* CLI backfill phases republish the namespace's counts and coverage

`code.index_status` and `code.repos` read `chunks_embedded` and
`embedding_coverage` from the shared `table_counts` row, and the Repositories
page reads per-language coverage from the shared `coverage` row. The ingest
pass republishes both after it moves rows; `loom code backfill` moves rows
outside it. A reader serves the counts row whatever watermarks it was computed
at, so after `--phase embed` status kept reporting the pre-embed coverage
(`embedding_coverage: 0.0`, `searchable: false`, `code.search` answering
lexically) until an ingest pass moved the namespace's rows again. Embedding
moves no watermark, so the coverage row stayed current to its readers as well.

Each phase that wrote something republishes both rows at its end, as the
ingest pass does. A failed refresh is printed and does not fail the finished
phase.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the counts at every phase end

The republish ran only when this run's own counters were nonzero. A resumed
index whose cursor was already at the end, or an embed phase whose last page
landed before the process died, wrote its rows in an earlier process and so
left the pre-backfill `table_counts` row in place. Both phase ends now
republish unconditionally; a republish is one query per row.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The embed phase republishes the counts only for an org it declared

An embed phase with nothing pending republished without declaring its org, so a
mistyped --org wrote counts and coverage rows that the cell never gated. With
nothing pending, the phase now declares and republishes only a namespace that
already has a counts row; a mistyped org has none and writes nothing.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A full index run republishes the counts after its watermark

The full-run path republished in `_close_index`, before it wrote `git_head`.
Both rows carry the counts fingerprint, `git_head` included, so `code.coverage`
rejected the new coverage row and the next reader ran the aggregates again. A
full run now republishes after the watermark and the backfill stamps; a hold,
a repair and a twin label write no watermark and republish in `_close_index`
as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The Anthropic client sends a JSON Schema as the Messages API's structured output (#1311)

* The Anthropic client sends a JSON Schema as the Messages API's structured output

A json_schema response format was dropped, so the conflict resolver's Claude answers came back in a shape parse_verdicts could not read and every judgement failed while still being billed. The schema now goes in output_config.format and into the JSON directive, which keeps the shape when a model refuses output_config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A refusal of one output_config key drops that key alone

A 400 naming output_config.effort recorded a refusal of the whole output_config, so later schema requests to the same model lost output_config.format. traits.refused_key records output_config.effort or output_config.format on its own, and the Anthropic client leaves the other key in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A rejected schema drops the format for that request alone

A 400 that points inside the sent schema (output_config.format.schema...)
rejects that schema, not the model's structured output. The call is re-sent
without the format and nothing is remembered for the model, so later
requests still send their schema. Refusals of output_config.format itself
are still learned per model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

---------

Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* The embed phase binds its candidate keys a slice at a time (#1547)

`loom code backfill --phase embed` failed on a ClickHouse at its default
`http_max_field_value_size` (128 KiB) with "HTML Form Exception: Field value
too long". `pending_embed_chunks` asks phase 1 for four times the page size
(2,000 keys for the CLI's page of 500) and bound every (path, chunk_id) pair
as one form field in the phase-2 FINAL read; at ordinary path lengths that
list is several hundred KiB.

Phase 2 goes through `query_all_sliced`, as other keyed reads do. Each slice
keeps its own oldest `limit` rows and the slices' rows are ordered and capped
together, so the page is the oldest-first page one statement would return.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Link the memory selector from the agent documentation index (#1574)

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings (#1572)

* Format the coding-agent memory selector page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings

Resolve local actions from the workflow commit, verify translations from a scheduled job, install npm packages from lockfiles, and validate each docs destination as a parsed link.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Include the selector page in the IndexNow route test

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Pin the coverage action to its full commit SHA

The plugin scanner requires a full SHA for action references it treats as remote.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep queued translation requests during scheduled checks

Finalizer polls and translation batches share one queue. Keep pending requests available while the current run finishes.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption shows active reported contact domains (#1577)

List domains with successful requests over 90 complete days. Use report version 2 to keep domains collected under the private notice out of the public list.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Replay how Loom memory follows source edits (#1588)

* Replay how Loom memory follows source edits

Show branch-specific lesson states from a recorded comparison and let readers repeat the evaluation on a disposable hosted runner.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scope evaluation cleanup to its server job

Finish the fork instructions and apply the site formatter.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep pytest node paths out of code anchors (#1589)

* Keep pytest node paths out of code anchors

A pytest command can make a file extension look like a qualified symbol. Skip selectors with explicit Python paths so a note can link the declarations it names.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Handle class-only and nested pytest node selectors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep attached decorators in Python test examples (#1592)

A context window that starts at the function declaration hides decorators that still belong to the test. Reuse the retained chunk to prove the decorator prefix and stay within the requested radius.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Grep cursors keep their path filters (#1594)

A page offset belongs to the original file selection. Bind that scope before reading the saved pool or retrying the query.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code edges keep distinct relationship kinds across index tiers (#1595)

A compiler call and a parser read at the same location describe different relationships. Collapse the rows only when their kinds agree.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Search cursors keep their original filters (#1596)

A page offset belongs to the results selected by the original filters. Verify those filters before serving a saved page or rerunning the search.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-target edit context returns verified member source (#1598)

* Single-target edit context returns verified member source

Agents can use one exact name and get the same revision-verified member source as a one-name batch.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Describe member sources for both edit context forms

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* File-qualified symbols resolve unique indexed path suffixes (#1600)

When a relative spelling omits a source directory, look up the symbol on the one live indexed file with that complete suffix. Keep an existing path as the lookup boundary and leave ambiguous suffixes unresolved.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Edit batches share verified test source reads (#1601)

* Edit batches share verified test source reads

Reuse a verified source window when several named targets cite the same test. Keep each citation and deadline and drain pending reads before the batch exits.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bound shared edit example reads

Apply the enrichment deadline to the shared source read. A later waiter can retry after a stalled read reaches its deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lessons verify the commit while reading source (#1602)

* Single-file lessons verify the commit while reading source

A successful bounded local blob read proves that the mirror holds the pinned commit. Use one Git process for that case and keep the mirror availability check when the local read cannot supply the file.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lesson reads share one parse deadline

The fallback spends only the source-read time left after a local miss. Keep the mirror availability check and bound both paths with the same deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Erasing a code namespace removes its cached code.ask answers (#1585)

* A code namespace erasure deletes the cached code.ask answers asked in it

The erasure step for cached code.ask answers deleted only those that quoted the
erased namespace's memories (`memory_namespace`). An answer asked in the erased code
namespace carries the repository's code in its text and was left in
`loom.code_answers`, uncounted by the residue census. After a re-index of the same
commit it was served again, since the cache invalidates only when a cited file changes.

The step and the census now match a row by `namespace` as well as `memory_namespace`.
The delete stays a lightweight delete read sequentially, and the census still skips a
tombstone that holds no text.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Align the answer-cache erasure docs and comments with the changed step

The architecture doc still said an answer drawn from the code index alone stays;
a namespace erasure now deletes it with the code namespace it was asked in. The
module docstring of the answer-cache erasure tests, the `namespace_tables`
docstring and one test docstring described the old predicate, and the comment on
`KEEP_TABLES` now says only what is not purged there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Guard every cached answer against an erasure, not only memory-quoting ones

An ask can finish synthesizing after the namespace delete and the final
census. The answer cache skipped its erasure check when the answer quoted no
memory, so a code-only answer could land in the erased namespace. Run the
before-and-after write guard for every answer, and delete a code-only answer
that lands after the mark by its own key.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* An abstain's negative cache entry is guarded against an erasure and counted by its census

An abstaining ask that overlapped a namespace delete could recreate its cached
question afterwards: the negative entry was written without the erasure check,
and the census skipped it because its answer and citations are empty. The
negative write now runs the same before-and-after guard as a synthesized
answer, and the namespace census counts a row that holds a question.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refresh the analyzer shapes and the tombstone sentence for the code-only guard

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits (#1562)

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits

The pass ordered every entry's pending commits by commit time, floored at a
24-hour horizon. A mirror far behind on older history therefore outranked
every recent commit of every other entry, and while its backlog lasted a
branch with one new merge stayed at 0 of 1 pass after pass.

Each round now gives every waiting entry one commit, the entry with the
fewest landed this pass first, then entry order. Within an entry commits
stay oldest first, so the watermark still moves one commit at a time. At the
budget the entry the scheduler would have served next is cut first, and the
next pass starts there through the existing `commits` cut and `rotate_to`.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A sliced commit counts as its entry's turn in the round-robin

A commit sliced at the share clock returned before the entry's landed count
moved, so it was deferred at the same key as the entries the round had not
reached and won the tie on entry order. The `commits` cut then named the entry
that had just been served, and a small entry behind sliced large ones stayed at
0 of 1 pass after pass.

A sliced entry is now deferred one turn later than its landed count, so the cut
names the entry the round did not reach and the next pass starts there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The commit-phase tests state the round-robin order and drop unused commit times

The scheduler no longer reads commit times, but the test helpers still took a
`times` map and patched `commit_meta_many`, so the dates passed to every
fixture were inert and two test names read as if a date were an input. The
helpers lose the parameter and the patch, the cases are named by backlog
size, and the lanes and round-robin docstrings and one assertion message now
describe the order across entries as round-robin.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The ingest cut names an entry by org and namespace, so two orgs sharing a namespace alternate

The cursor a cut pass leaves named the entry by namespace alone, and
`rotate_to` took the first entry of that name. With `code-widgets` in two
orgs and a budget for one commit, both cuts named the second org's entry and
both passes served the first org's.

A cut is now kept as `<org>/<namespace>:<leg>` and the commit, bootstrap and
walk phases rotate on `cut_key` (org and namespace). `cut_phase` reads the leg
after the last colon, so an org name containing one still parses. A cursor
written before this names no org and matches no entry: the pass keeps the
configured order once, and the next cut is written in the new form. A build
without this change reads the new form the same way (rolling-upgrades, rule 4).

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the leftover commit-times argument from two ingest tests

Two callers still passed a map of commit times as the helper's third
argument, which since the helper dropped its times parameter is the
per-commit file count. A time of about 1.7 billion became that many
file names, so the run grew until the memory limit killed it. Both
callers use the helper's defaults now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The budget-cut test expects the org-keyed resume point

The cut now resumes at org/namespace:leg, so the existing test reads
o/code-x:walk.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* A refused compiler-tier delta holds its tier on the whole run, not on its target and caps (#1582)

The hold a refused delta leaves (<watermark>_refused) recorded only the target
and the three caps its open read. The run's window starts at the tier's
watermark, which other writers move (`loom code scip-full`, a batch apply, a
base-unknown reset), and the harness reads inputs the key did not carry
(exclude_generated for Go, scip_ts_projects and code_scip_ts_paths for
TypeScript, code_scip_delta_max_tus for C/C++). So a tier stayed held after its
watermark moved, after a branch was force-pushed back to the refused commit,
and after the entry's generated-file rule changed, each of which makes the next
run a different one.

The record is now {base, target, caps, inputs, loom}, written as sorted JSON so
code_index_state shows why a tier is held. `base` is the watermark the run
started from, `inputs` is what the tier's harness reads besides the window (an
empty object for Python), and `loom` is the release. Each delta worker reads
those inputs once per pass and builds the harness environment and the hold from
that one snapshot, so a setting changed while the harness runs cannot make the
record differ from the run. A hold that cannot be written fails its pass with
the store error, and the next pass runs the harness again.

Holds written by the previous format never match, so each held tier runs once
more after the upgrade and holds again. The operations guide names what the
hold keys on and what releases it, and no longer says extra Go deltas hold.

The tests are the three cases the review found, on a moved base, a branch
pushed back to a refused commit and a changed generated-file rule, plus the
translation-unit cap read once per pass and each tier's inputs in the record.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes (#1552)

* loom code backfill keeps an owed edge pass across a resume

A first full backfill implies the edges-only second pass, but only while
its cursor is empty. A first backfill stopped in its index phase (a held
org, a SIGTERM, a crash) resumes with the cursor set, and a rerun after an
interrupted edge pass finds the cursor at its end: both finish, write
`git_head` and drop the pass, so the namespace's cross-file references
stay unbound and nothing says so.

The run now records why it owes the pass (`first-backfill`, or
`requested` for `--edges-second-pass`) under
`backfill_edges_owed:index<suffix>` before its first batch, and clears the
record once the pass is done. A resumed run or a rerun reads the record and
runs the pass; `--no-edges-second-pass` declines it and clears the record.
A `--paths-file` repair records nothing, as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom runs a parsed command through one entry, dispatch.run_parsed

A command's context is bound in two places: `main` wires the process's
seams, and `_dispatch` binds the traffic class, the query tag, the actor
and the org the command bills. A second process that runs a share of a
command's work needs exactly that, so it is one function now,
`run_parsed(args)`, in its own module, `server/cli/dispatch.py`, with
`_dispatch`. `app.main` parses and calls it. A family module may import
`dispatch` without importing `app`, so the package's one-way import rule
holds. Nothing a command does changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill runs its batches through one run, cut at the header/source boundary

The index phase's reader and ingest and the edge pass's ingest move from
closures in `_backfill` and `_second_edge_pass` into `_Run`, built once
from the entry, the head, the embedder and the denylist; a batch of either
pass is a method on it. The code is the closures' code, reading its fields
from `self`.

`_cursor_batches` hands out the batches with their first index. The
headers `headers_first` puts first end their own batch, so no batch holds
both a header and a source and every header can be written before any
source batch starts. A resumed run starts at its cursor wherever an
earlier build cut.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes

One backfill process parses and extracts at about one core, whatever
--concurrency says: every tree-sitter parse holds the interpreter lock and
runs one at a time per process, and the extraction after it walks the tree
in Python. A tree does not pickle and a file's extraction reads the index
between its steps, so a worker takes a whole cursor batch: its own
connection, reads, parse, extraction and writes.

A worker is the command itself. The parent starts N spawned processes on
its own parsed arguments; each enters through dispatch.run_parsed, as
`loom` does, so it runs under every binding the command runs under: the
background traffic class, the cli.code.backfill query tag and operation,
the org it bills, logging, telemetry, SIGTERM and Ctrl-C handling, the
wired seams, the model-work admission and the registry read. `_backfill`
then serves the batches it is sent instead of walking the tree, each
awaited in the command's own task. One pipe per worker carries its batches
and their counters; nothing crosses but paths, counters and the reason a
batch was held.

The parent hands a worker its next batch when the worker reports its
last, so once a batch is held nothing more starts, and the batches still
running are counted. The cursor moves past a batch once every earlier one
is written. The header batches are all written before the first source
batch is handed out. A worker caches what it reads of the index (header
texts, the import resolver's live path set, layouts and listings), and
another worker's writes do not reach those caches, so it forgets them when
it moves to the sources and to the edge pass, which therefore reads the
finished index. The edge pass forgets them in one process too: the Go
listing and the other resolver caches outlived the index phase by up to
their TTL, so the pass did not re-derive what it claimed to. The same
workers serve both passes, admitted once, as the parent is.

A run whose workers wrote batches side by side owes the edge pass whatever
the flags say, recorded as `workers`: a file there resolved against what
its worker had read while the others were still writing. `--paths-file`
and `--no-edges-second-pass` runs with --workers run it, and a later
backfill that finds it owed runs it.

Stopping: a closing pipe cancels the worker's command task, as its own
SIGTERM or Ctrl-C does, so a stop of the parent, of the worker or of the
whole process group unwinds through the batch before the worker retires.
The parent closes the pipes when the run ends, fails or is cancelled, and
a killed parent closes them too. The parent reads every exit code: a
worker that exits before its run opened, in a batch (named with its first
index, and with the signal when one killed it), or on close (a failed
drain or retirement) fails the command; on close only after the command
has written its own end of the run, as one process retires after its
command returns. --workers is refused below 1 and with --phase embed, and
no more workers start than a pass has batches. --workers 1, the default,
keeps one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep the edge pass owed when a pass ends with errors

A worker's edge batch can return with errors when a file write fails.
The owed record now clears only when the pass reports none, so a resume
runs the pass again. The test fails an edge write in a two-worker run
and resumes in one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Index embed-excluded paths without a description or a vector (#1564)

* Index embed-excluded paths without a description or a vector

A repository entry's `embed_exclude` globs (`LOOM_CODE_EMBED_EXCLUDE` for
the scalar entry, the `exclude` glob semantics) keep a path in the index:
it is chunked, its symbols, edges and test map are derived, and code.search
reaches its chunks through the lexical leg. Its new chunks are neither
described nor embedded, in the file ingest and in the round's prefetch, and
`loom code describe` leaves them alone. The rows carry
`unembedded by design: embed_exclude`.

Embed recovery and the coverage counts now match the shared prefix
`unembedded by design`, so reference fixtures and embed-excluded chunks
are neither stubs to fill nor counted in the embeddable denominator. Rows
already stored under the reference marker match it unchanged.

Test files are often a large share of a repository's chunks; this lets an
operator spend the embedder on source and reach tests from the source hit
through the test map.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep unembedded-by-design chunks without a vector in reembed

`loom code reembed` copies a row that carries the `unembedded by design` marker under the second label with its marker and no vector, so an embed-excluded path or a reference fixture is not embedded there and that label's recovery leaves it alone.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep every vector and description writer off embed-excluded paths

The provider rebuild embedded every live `code_chunks` row and cleared
`embed_last_error`, so a staged embedder switch gave embed-excluded chunks
and reference fixtures a vector and erased their marker. It now stages a
row marked unembedded by design without a vector and keeps the marker.

The `code_summary` pass wrote an LLM card and a card vector for an
embed-excluded file, and could carry a twin's card across models. It now
takes the entry's `embed_exclude` globs (`denylist_for`), writes and carries
no card for a matching file, and clears a card written before the glob: the
row keeps its rank and carries the marker, so recovery and the card leg of
code.search skip it. Removing the glob lets the next pass write the card.

`unembedded_by_design` is the one predicate the Python writers read the
marker with. A test discovers every code-plane module that calls an
embedder or an LLM and fails until a new one is declared as a writer gated
on the marker or the globs, or as a query-side reader; the round prefetch
filter, the describe skip and the marker precedence get their own tests.
`ReembedStats.rows_unembedded` had no reader and is dropped.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Resolve the ingest denylist once per file

`ingest_file` resolved `default_denylist()` in `_refused` and again for the
embed rule; it now resolves it once and passes it down. The chunk stage's
`embed_excluded` has its one caller pass it, and the marker choice reads as
one expression.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Document embed_exclude on a changed glob, a rollback and self-service entries

The operations guide states what a changed glob does: adding one leaves
existing vectors until a chunk changes, and removing one leaves the chunks
unembedded and outside the coverage denominator, embedded again when their
content changes or when the repository is indexed into a new namespace.
`embed_exclude` applies to configured entries only. A rolling-upgrades entry
records how an older build reads the marker as a stub. The coverage
comments name both kinds of rows unembedded by design, and the setting's
comment is cut to two lines; the generated references are regenerated.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* simplify: N-1-safe marker, drop the enumeration test and the card clear

The embed_exclude marker now extends the reference fixtures' marker
(`unembedded by design: reference (embed_exclude)`), so the previous build's
recovery, backfill embed phase and coverage counts, which match
`unembedded by design: reference` as a prefix, skip it as this build's do.
The recovery and coverage reads keep main's parameter.

A test pins the reference literal, and a cross-version test checks that the
row ingest stores is skipped by the previous build's recovery predicate and by
this build's.

The code_summary pass no longer clears a card written before its file's glob:
a card, like a chunk, keeps the state it had when the glob was set. The
candidate and carry filters stay.

The model-caller enumeration test is gone: it was a closed list that every new
caller had to edit, and it passed with the ingest gate removed. The reembed,
provider rebuild and card tests move beside their existing fakes, and the
recovery parameter check already in test_code_reference_files.py stays the
only one. reembed partitions its rows in one loop and reads the column it
always selects. Rule 63 and the operations guide say what is true now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An embed-excluded file's card goes once the file changes

The code_summary pass leaves embed-excluded paths out of its candidates, so a
card written before the path's glob was never rewritten or removed after the
file changed: code.map and the cards leg kept serving a description of the old
content.

The pass now tombstones the live card of an excluded path whose inputs_hash no
longer matches the file's content hash, a deleted file included. A card that
still matches the file stays, as before, and a rank row without a card is left
alone. The next code_graph_stats pass writes the file's rank row back. The
operations guide says the card stays until the file changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Spell the full setting name in the coverage description

code_ready_embed_coverage named embed_exclude by its suffix; it now
names code_embed_exclude, and the example file and schema follow.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Regenerate the configuration reference for the coverage description

scripts/codegen/settings_reference.py after 59fc1016f's catalog wording change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Write the graph-stats rank copy just above the card it read

The ranks leg reads a live file card, then inserts a mirror of it with the
new rank at the clock version. A tombstone or a new summary written in
between carries an earlier version than that copy, so the copy won under
FINAL and brought back a card retired meanwhile.

The copy now takes the read card's version plus one. Every other writer
takes its version from the clock, so a later tombstone or summary is
higher and wins; with no write in between the copy is still the newest
row.

The test reads a card, lets the tombstone land during the read and checks
that FINAL keeps the tombstone. It fails without the change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The operations guide says LOOM_CODE_GIT_CA_FILE sets trust, not reach (#1580)

* The operations guide says what LOOM_CODE_GIT_CA_FILE settles and what it does not

The guide's paragraph for LOOM_CODE_GIT_CA_FILE read as if the setting made a
forge under a private authority indexable. It settles trust only: in the
repository-job sandbox the egress proxy still refuses a remote whose name
resolves to a loopback, private or link-local address, and no setting admits
one, so such a forge indexes only as an operator repository on a host without
the sandbox. The guide now says so.

It also says what the bundle applies to (every git a repository job runs, the
compiler tier's dependency fetches and submodule updates included, so the
bundle must hold the public roots when any of those reach a public host) and
that the path is not checked when the setting loads: it must be absolute and
inside the sandbox's read-only /etc/ssl, and a relative or `~/` path, or a link
leaving /etc/ssl, fails in git's own words. The "CA bundles" paragraph now
counts three bundles and says which one git uses through the proxy.

The unit test imports asyncio at the top of the module. No behaviour changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Name the trees the repository-job sandbox mounts for the git CA bundle

A link out of /etc/ssl can still work: the sandbox also mounts /usr and
/etc/ca-certificates read-only, so a link into /usr/share/ca-certificates
resolves to the same file. Say the target must be visible to the job and
keep /etc/ssl as the suggested location.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The mirror sweep keeps the tier checkouts of an entry that names no producer (#1584)

* The mirror sweep keeps the tier checkouts of an entry that names no producer

`_named_paths` named `checkout_for(c, "")` for each entry. For an entry with
no `scip_producer` that is `<checkout>.`, a path no tier uses, so the
checkout of the tier its tree calls for (`<checkout>.python`,
`<checkout>.typescript`, `<checkout>.go`) was named by nothing. `_sweep_root`
removes an unnamed `checkout-*` directory older than 600 s, so a self-service
entry's tier checkout was deleted and copied again over and over. A
configured entry is unaffected unless its checkout sits under
`code_repos_root`.

Name `checkout_for(c, p)` for every producer the tiers can run, plus the
entry's `scip_extra_producers`, and for each registry row its checkout and
the sibling of every producer. `repos.sibling_checkout` holds the one
spelling of a sibling path, so the sweep and `checkout_for` cannot drift.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the clause about the removed call from the sweep comment

The comment above `checkouts` in `_named_paths` described a line the previous
commit removed. It now says what the code does.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Sweep only the named tiers of an entry that names its producer

An entry with a scip_producer runs that tier and its extras only, yet the
sweep named every tier's checkout for it, so the old checkout of a tier
removed from its extras stayed on disk until the repository went. Keep all
candidate tiers for an entry naming no producer and only the named ones
otherwise.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The CLI embed phase republishes only when behind, once, with coverage first (#1581)

* A backfill phase republishes once, last, and only where the counts trail

With nothing pending, the embed phase declared its org and republished
whenever a `table_counts` row existed. Readers write that row: `loom code
stats` with a mistyped --org leaves a row of zeros, so the same typo on
`--phase embed` declared the org, and every idle embed run on an indexed
namespace paid the org gate, the count scans and the coverage aggregates.
It now declares only when rows are pending or the published chunk counts
differ from the chunk table. That comparison is a store read,
`CodeRepo.published_chunks_behind`, over the shared counts and the chunk
aggregate.

The index phase writes `git_head` and the backfill stamps first, then
`_close_index` compacts, records the pass and republishes last on every
exit (a full run, a run resumed at the end of its cursor, a hold, a repair,
a twin label), so the `republish` flag is gone. The cursor is cleared after
the republish, so a run interrupted while it publishes resumes at the end
and publishes then.

The republish writes the coverage row first and the counts row only once the
coverage has landed. An embed phase stopped between the two, by Ctrl-C or a
failed coverage refresh, otherwise left the counts current and the coverage
at the pre-embed vectors with a matching fingerprint, and the rerun found
nothing behind. It also reads with sequential consistency: the fingerprint
it stamps carries the `git_head` the run has just written, which the replica
serving the read may not have yet.

The tests drive `_backfill` and `_backfill_embed` against the real
`CodeRepo` over a replica that lags the run's writes, and read the rows
back.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused coverage write keeps the counts behind

The CLI writes the counts row only once the coverage row has landed, but
`refresh_coverage` swallowed its own write failure, so the counts landed
anyway and the next embed phase found nothing behind. The CLI now passes
`must_land=True`, which makes the coverage write raise.

`published_chunks_behind` also reads the coverage row's embedded figure,
so current counts over a coverage row that trails the chunks still count
as behind. That state comes from vectors landing between the two writes,
or from an earlier build that published counts after a failed coverage
write.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An existing coverage row is compared even when the counts row is missing

When the index phase published coverage and its first counts write failed,
an embed phase that landed its last vectors and stopped before publishing
left an idle rerun reading a missing counts row as nothing to republish.
published_chunks_behind now compares the coverage row on its own.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* Show repository freshness from mirror health (#1604)

A successful mirror fetch can leave the same commit indexed for days. Use the server’s overdue-fetch flag for the badge and keep deployment worker errors in the worker diagnostics.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires (#1002)

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires

A confirmed renewal can extend the deadline while the previous wait resumes. Use the current freshness before stopping workers, and retain genuine expiry controls.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover the review provenance default in Cell proof refusals

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

---------

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Edit context includes verified indexed forwarding targets (#1494)

* Edit context includes verified indexed forwarding targets

When one typed forwarding call resolves in the same index revision, cite the target in read_sources. Share the bounded lookup between single and batched edits and keep existing member reads independent.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Load forwarding helpers after the code modules initialize

Initialize grep and edit context in either order by loading forwarding helpers only when the optional source lookup runs.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Use scoped cursors in vector continuation fixtures

Keep the original search scope on stored cursors so the fixture exercises continuation without fresh retrieval.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bump the actions group across 1 directory with 3 updates (#1516)

* Bump the actions group across 1 directory with 3 updates

Bumps the actions group with 3 updates in the / directory: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv), [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `astral-sh/setup-uv` from 10.3.3 to 10.4.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/68559e99cc807c1eb7e9238fd43a15bba460eec2...1db35dd8eee11c5894872e0b383ae6c406cf738d)

Updates `ossf/scorecard-action` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/fa7117db83c52d787ae5a89f350999701505d78e...23f22cd43608bae7a1f1fa2603d7314dee9538a5)

Updates `github/codeql-action/upload-sarif` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.1...33d7b85da1a04171e211befe2c739303b9a4c066)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>

* Scorecard fails when the API rejects a publication

The updated action warns by default. Opt into failure on API rejection so a stale public result is visible in the workflow status.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scorecard uploads SARIF when publishing fails

Upload the completed scan when the file exists so a publication rejection still leaves results in code scanning.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep excerpt bounds in the compact coding schema (#1613)

Numeric bounds in JSON Schema do not constrain string values. List the
grep context radius as an integer so its existing bounds apply while
the server still accepts and validates numeric strings.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code read accepts same-file line pairs (#1614)

* Read same-file line pairs in one source request

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Advertise code read pair endpoints as integers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP validation errors omit rejected retry examples (#1612)

* Omit invalid retry examples from tool errors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep retry examples faithful to supplied values

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Validate corrected arguments and keep explicit scope out of retry guidance

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show missing-field templates only for fillable arguments

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep spelling corrections within their original argument object

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Compact SCIP replies omit documentation present in function bodies (#1617)

SCIP wraps declarations and can unquote forward references. Compare the
Python function headers and docstrings before dropping a description.
Keep any description whose declaration or documentation adds evidence.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The assistant runs natively with caller-scoped tools (#995)

* Run the assistant natively without a bundled chat service

Own bounded streaming model turns and authenticated MCP tools in the web process. Validate citations against answer receipts and capture usage before completion. Retain external state and provisioning metadata for an approved cutover.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Use shared signing for native assistant streams

Streaming requests share endpoint resolution, credential refresh and private
header filtering with the provider transport. Cancellation joins pending
signing before the producer exits. Reuse the deployment region setting and
regenerate its settings artifacts. Verify native enablement with serving TLS.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native answers retain publication proofs through response delivery

Whole replies retain nested source-access proofs through required accounting
and response delivery. Citations use returned help anchors, and native
configuration failures remain visible in the dashboard. Retained provisioning
credentials keep their rotation coverage while replaced polling paths are removed.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native authorization fixtures use the retained evidence paths

Route fixtures bind the answer-owned MCP app. Protected ledger fixtures exercise
the pure support rule with all authorization and marked-outcome expectations kept.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Assistant fixtures follow asynchronous credential admission

Keep authorization, revocation and whole-response publication assertions on
the provisioning-aware credential boundary used by the served routes.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant evidence uses request-owned receipts

Remove unused persisted-answer query code and preserve receipt-based support
assertions. Cover configuration admission and model-alias pricing, correct
configuration documentation and bounds, and align the disabled chat fixture
with the native refusal contract.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe SQL citations using answer-owned receipts

Keep persisted query metadata separate from citation verification and remove
unused support fixtures after the polling path is retired.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native display steps use the receipt formatter

Keep step labels and protected-row rules in the shared formatter. Retain the
local-model routing and container networking guidance alongside assistant setup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Translated setup links point to the native assistant guide

Regenerate the published setup destinations when the English guide is replaced.
Keep the translated text and source stamps for the translation updater.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Keep assistant archives private and bound retained credential writes

Create converted archives exclusively with owner-only permissions and keep
credential resealing statements inside the retained provisioning lease.
Remove unused ticket and accounting state and obsolete test seams.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Retain streamed source proofs and bound help citations

Keep nested tool publication guards through final accounting and refuse citations to unread help outline sections.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Exercise the terminal publication boundary in stream delivery tests

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover source proof loss before streamed assistant content

Exercise access changes during model generation and an awaited send while preserving final accounting and stream cleanup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Renew streamed source proofs at each HTTP send

Share retained source proofs with the HTTP request tail while keeping streamed accounting open until its terminal event. The new source-loss regressions reproduce unchecked private content before this repair.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant tests retain mirror admission and private accounting

Exercise real admission and response accounting through source activation, marked refusal, failed private delivery and repeated provider cancellation.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Clarify provider setup and failure diagnostics

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit d6675819a9447ce97f5f21e1b72747c8b1a1cd7b)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Refresh the provider architecture summary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Route the conflict judge in the single-provider recipe

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit f93385b019dc0978daa33b08392e717348c7643c)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe the dashboard model selection boundary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a6d8a1279a4a8fe4a4eae3b170610c662b52e0b5)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit cb594d01ade7d2b883849670db9f314a46f4abc4)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a94d2f909a47d61532d0f6ac24aad79b09ac42b9)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Isolate retirement fixture timing in assistant qualification

Compose the reviewed retirement fixture clock so handler startup does not consume cancellation checks. Keep the original deadline and assertion bodies.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Verify assistant code citations against complete returned source

Code cards and skeletons retain original line bounds while withholding source. Require a complete unelided unit or file body with matching line bounds before verifying a code citation. Cover malformed and withheld spans while preserving full-source positives and other citation kinds.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Grep fallback tests separate deadlines from response handling

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a909dad266915b5ad6202d8d3c7d5a16bb635bbc)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound native gateway refusal reads before stream parsing

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 9ea1817ab4f9e5273c45666a00bf5fdd6544ec88)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant checks use receipt verdicts and caller context

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Redaction cost samples meet their CPU clock floor

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe assistant support from answer-owned receipts

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bedrock rejects content block indices after close

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Remove an unused citation test constant

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Grep fallback tests separate deadlines from response handling

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compose canonical cleanup and fallback fixture controls

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

*…
* The Loom site accepts self-hosted adoption reports (#1534)

The dashboard and report endpoint share a deployment. Serve the existing collector and daily repository snapshot from the site so self-hosted installs can reach them through the public origin.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP grep batches exact and related source reads (#1542)

* MCP grep batches exact and related source reads

A literal batch can return an exact test declaration and related source for another query. Include valid ranges from both evidence groups in the same source read suggestion.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep mixed grep reads for location-only matches

Validated ranges can drive a combined read when a caller requests zero excerpt lines. Preserve the continuation for languages without a named edit selector.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Complete grep excerpts at the verified indexed revision (#1545)

* Complete grep excerpts at the verified indexed revision

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep enrichment deadlines local to each page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep indirect test evidence for shared call sites (#1546)

Use the qualified caller and source location to recognize one call site across the parser and compiler index. Keep both symbol IDs for reading incoming test edges.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Mutation tests use pytest 9.1.1 (#1543)

Match the main test environment and give the dependency graph a fresh lockfile to scan.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption telemetry includes contact domains by default (#1544)

* Adoption telemetry includes contact domains by default

Use eligible namespace contacts from password and federated accounts so deployments can report aggregate domain activity across sign-in methods.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The adoption report test counts password contacts

Exercise the expanded contact scope in the live report test, including requests attributed to a password account.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Return fresh lessons from verified callers in code edit context (#1554)

* Keep fresh lessons for verified forwarding callers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep distinct verified caller lessons eligible

Select fresh links before reading a limited set of excerpts. Use the complete excerpt to distinguish lessons written under a shared key.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require fingerprint proof for verified caller lessons

Restrict exact-revision lesson reads to compatible, nonempty fingerprint comparisons. Ordinary symbol reads keep their existing state fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Verify restored caller lessons against their original source

Trust the checked hash only while its stored link still identifies located code. Keep ordinary symbol reads on their existing fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Link coding-agent memory guides to their verification steps (#1561)

Readers can check a cross-client handoff, a code-linked lesson and the SQL audit before choosing a team setup.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Preserve Python member reads when SCIP is indexed (#1566)

* Preserve Python member reads when SCIP is indexed

Resolve typed reads from the parser candidates in the same name query so a compiler ID for the same member cannot displace its parser edge.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Retain compiler-only Python member candidates

Prefer parser candidates per qualified name so a compiler-only member with the same short name remains readable.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Name agent memory capabilities in documentation search titles (#1567)

* Name agent memory capabilities in documentation search titles

Put each page’s task in its title and description so it makes sense outside the sidebar.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Distinguish request IDs from worker query tags in telemetry metadata

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show how edit context returns a caller’s saved lesson (#1569)

* Show how edit context returns a caller’s saved lesson

A coding agent can read the constraints that apply at a forwarding call before changing its dependency.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* State the source and access requirements for caller lessons

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Add an evaluation checklist for choosing coding-agent memory (#1571)

* Add an evaluation checklist for choosing coding-agent memory

Teams can use their requirements to choose a starting setup and copy the checks into a pilot.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require authenticated writes in the selector’s SQL audit check

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* LOOM_CODE_GIT_CA_FILE lets git trust a remote under a private authority (#1549)

Repository-job git reads no system or global git config and inherits no
environment beyond PATH, HOME, LANG and TMPDIR, so neither `http.sslCAInfo`
in a git config nor GIT_SSL_CAINFO or SSL_CERT_FILE reaches it: it verifies
with the image's default roots, and a git server whose certificate a private
authority issued fails every clone with "server verification failed:
certificate signer not trusted". The one setting that hands git a bundle,
LOOM_CODE_GIT_PROXY_CA_FILE, applies only through a forward proxy.

The new setting names a PEM bundle that `auth_env` passes to every repository
job as `http.sslCAInfo`. Through the proxy, LOOM_CODE_GIT_PROXY_CA_FILE is
appended after it and wins when set, so proxied deployments behave as before.
A deployment that does not set it is unchanged.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused compiler-tier delta holds its tier until a cap or the target changes (#1551)

* A refused compiler-tier delta holds its tier until a cap or the target changes

A delta tier whose delta `open_delta` refused (over a cap, a link, not a
regular file) recorded the failure and left its watermark, so every pass
ran the full harness again at the same commit and was refused the same way.

The tier now keeps the refused target and the delta caps in effect. While
both match, the next pass skips the entry before the checkout moves and the
failing record keeps its fix. A raised cap, a live setting, or a new branch
head releases it on the next pass. A delta that changed while it was read
holds nothing. The C/C++, TypeScript, Python and Go delta tiers share it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refusal hold records the caps its open read

The hold sampled the delta caps after `open_delta` failed, so a cap raised
while the open ran was recorded as the one the delta was refused under: a
1.5 MB delta refused at a 1 MB cap that was raised to 2 MB stayed held at
2 MB, where it opens.

`delta_caps` now reads the three caps once; `open_tier_delta` passes that
snapshot to `open_delta` and records the same one in the hold.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the namespace's counts and coverage (#1550)

* CLI backfill phases republish the namespace's counts and coverage

`code.index_status` and `code.repos` read `chunks_embedded` and
`embedding_coverage` from the shared `table_counts` row, and the Repositories
page reads per-language coverage from the shared `coverage` row. The ingest
pass republishes both after it moves rows; `loom code backfill` moves rows
outside it. A reader serves the counts row whatever watermarks it was computed
at, so after `--phase embed` status kept reporting the pre-embed coverage
(`embedding_coverage: 0.0`, `searchable: false`, `code.search` answering
lexically) until an ingest pass moved the namespace's rows again. Embedding
moves no watermark, so the coverage row stayed current to its readers as well.

Each phase that wrote something republishes both rows at its end, as the
ingest pass does. A failed refresh is printed and does not fail the finished
phase.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the counts at every phase end

The republish ran only when this run's own counters were nonzero. A resumed
index whose cursor was already at the end, or an embed phase whose last page
landed before the process died, wrote its rows in an earlier process and so
left the pre-backfill `table_counts` row in place. Both phase ends now
republish unconditionally; a republish is one query per row.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The embed phase republishes the counts only for an org it declared

An embed phase with nothing pending republished without declaring its org, so a
mistyped --org wrote counts and coverage rows that the cell never gated. With
nothing pending, the phase now declares and republishes only a namespace that
already has a counts row; a mistyped org has none and writes nothing.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A full index run republishes the counts after its watermark

The full-run path republished in `_close_index`, before it wrote `git_head`.
Both rows carry the counts fingerprint, `git_head` included, so `code.coverage`
rejected the new coverage row and the next reader ran the aggregates again. A
full run now republishes after the watermark and the backfill stamps; a hold,
a repair and a twin label write no watermark and republish in `_close_index`
as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The Anthropic client sends a JSON Schema as the Messages API's structured output (#1311)

* The Anthropic client sends a JSON Schema as the Messages API's structured output

A json_schema response format was dropped, so the conflict resolver's Claude answers came back in a shape parse_verdicts could not read and every judgement failed while still being billed. The schema now goes in output_config.format and into the JSON directive, which keeps the shape when a model refuses output_config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A refusal of one output_config key drops that key alone

A 400 naming output_config.effort recorded a refusal of the whole output_config, so later schema requests to the same model lost output_config.format. traits.refused_key records output_config.effort or output_config.format on its own, and the Anthropic client leaves the other key in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A rejected schema drops the format for that request alone

A 400 that points inside the sent schema (output_config.format.schema...)
rejects that schema, not the model's structured output. The call is re-sent
without the format and nothing is remembered for the model, so later
requests still send their schema. Refusals of output_config.format itself
are still learned per model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

---------

Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* The embed phase binds its candidate keys a slice at a time (#1547)

`loom code backfill --phase embed` failed on a ClickHouse at its default
`http_max_field_value_size` (128 KiB) with "HTML Form Exception: Field value
too long". `pending_embed_chunks` asks phase 1 for four times the page size
(2,000 keys for the CLI's page of 500) and bound every (path, chunk_id) pair
as one form field in the phase-2 FINAL read; at ordinary path lengths that
list is several hundred KiB.

Phase 2 goes through `query_all_sliced`, as other keyed reads do. Each slice
keeps its own oldest `limit` rows and the slices' rows are ordered and capped
together, so the page is the oldest-first page one statement would return.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Link the memory selector from the agent documentation index (#1574)

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings (#1572)

* Format the coding-agent memory selector page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings

Resolve local actions from the workflow commit, verify translations from a scheduled job, install npm packages from lockfiles, and validate each docs destination as a parsed link.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Include the selector page in the IndexNow route test

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Pin the coverage action to its full commit SHA

The plugin scanner requires a full SHA for action references it treats as remote.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep queued translation requests during scheduled checks

Finalizer polls and translation batches share one queue. Keep pending requests available while the current run finishes.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption shows active reported contact domains (#1577)

List domains with successful requests over 90 complete days. Use report version 2 to keep domains collected under the private notice out of the public list.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Replay how Loom memory follows source edits (#1588)

* Replay how Loom memory follows source edits

Show branch-specific lesson states from a recorded comparison and let readers repeat the evaluation on a disposable hosted runner.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scope evaluation cleanup to its server job

Finish the fork instructions and apply the site formatter.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep pytest node paths out of code anchors (#1589)

* Keep pytest node paths out of code anchors

A pytest command can make a file extension look like a qualified symbol. Skip selectors with explicit Python paths so a note can link the declarations it names.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Handle class-only and nested pytest node selectors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep attached decorators in Python test examples (#1592)

A context window that starts at the function declaration hides decorators that still belong to the test. Reuse the retained chunk to prove the decorator prefix and stay within the requested radius.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Grep cursors keep their path filters (#1594)

A page offset belongs to the original file selection. Bind that scope before reading the saved pool or retrying the query.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code edges keep distinct relationship kinds across index tiers (#1595)

A compiler call and a parser read at the same location describe different relationships. Collapse the rows only when their kinds agree.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Search cursors keep their original filters (#1596)

A page offset belongs to the results selected by the original filters. Verify those filters before serving a saved page or rerunning the search.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-target edit context returns verified member source (#1598)

* Single-target edit context returns verified member source

Agents can use one exact name and get the same revision-verified member source as a one-name batch.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Describe member sources for both edit context forms

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* File-qualified symbols resolve unique indexed path suffixes (#1600)

When a relative spelling omits a source directory, look up the symbol on the one live indexed file with that complete suffix. Keep an existing path as the lookup boundary and leave ambiguous suffixes unresolved.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Edit batches share verified test source reads (#1601)

* Edit batches share verified test source reads

Reuse a verified source window when several named targets cite the same test. Keep each citation and deadline and drain pending reads before the batch exits.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bound shared edit example reads

Apply the enrichment deadline to the shared source read. A later waiter can retry after a stalled read reaches its deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lessons verify the commit while reading source (#1602)

* Single-file lessons verify the commit while reading source

A successful bounded local blob read proves that the mirror holds the pinned commit. Use one Git process for that case and keep the mirror availability check when the local read cannot supply the file.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lesson reads share one parse deadline

The fallback spends only the source-read time left after a local miss. Keep the mirror availability check and bound both paths with the same deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Erasing a code namespace removes its cached code.ask answers (#1585)

* A code namespace erasure deletes the cached code.ask answers asked in it

The erasure step for cached code.ask answers deleted only those that quoted the
erased namespace's memories (`memory_namespace`). An answer asked in the erased code
namespace carries the repository's code in its text and was left in
`loom.code_answers`, uncounted by the residue census. After a re-index of the same
commit it was served again, since the cache invalidates only when a cited file changes.

The step and the census now match a row by `namespace` as well as `memory_namespace`.
The delete stays a lightweight delete read sequentially, and the census still skips a
tombstone that holds no text.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Align the answer-cache erasure docs and comments with the changed step

The architecture doc still said an answer drawn from the code index alone stays;
a namespace erasure now deletes it with the code namespace it was asked in. The
module docstring of the answer-cache erasure tests, the `namespace_tables`
docstring and one test docstring described the old predicate, and the comment on
`KEEP_TABLES` now says only what is not purged there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Guard every cached answer against an erasure, not only memory-quoting ones

An ask can finish synthesizing after the namespace delete and the final
census. The answer cache skipped its erasure check when the answer quoted no
memory, so a code-only answer could land in the erased namespace. Run the
before-and-after write guard for every answer, and delete a code-only answer
that lands after the mark by its own key.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* An abstain's negative cache entry is guarded against an erasure and counted by its census

An abstaining ask that overlapped a namespace delete could recreate its cached
question afterwards: the negative entry was written without the erasure check,
and the census skipped it because its answer and citations are empty. The
negative write now runs the same before-and-after guard as a synthesized
answer, and the namespace census counts a row that holds a question.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refresh the analyzer shapes and the tombstone sentence for the code-only guard

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits (#1562)

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits

The pass ordered every entry's pending commits by commit time, floored at a
24-hour horizon. A mirror far behind on older history therefore outranked
every recent commit of every other entry, and while its backlog lasted a
branch with one new merge stayed at 0 of 1 pass after pass.

Each round now gives every waiting entry one commit, the entry with the
fewest landed this pass first, then entry order. Within an entry commits
stay oldest first, so the watermark still moves one commit at a time. At the
budget the entry the scheduler would have served next is cut first, and the
next pass starts there through the existing `commits` cut and `rotate_to`.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A sliced commit counts as its entry's turn in the round-robin

A commit sliced at the share clock returned before the entry's landed count
moved, so it was deferred at the same key as the entries the round had not
reached and won the tie on entry order. The `commits` cut then named the entry
that had just been served, and a small entry behind sliced large ones stayed at
0 of 1 pass after pass.

A sliced entry is now deferred one turn later than its landed count, so the cut
names the entry the round did not reach and the next pass starts there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The commit-phase tests state the round-robin order and drop unused commit times

The scheduler no longer reads commit times, but the test helpers still took a
`times` map and patched `commit_meta_many`, so the dates passed to every
fixture were inert and two test names read as if a date were an input. The
helpers lose the parameter and the patch, the cases are named by backlog
size, and the lanes and round-robin docstrings and one assertion message now
describe the order across entries as round-robin.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The ingest cut names an entry by org and namespace, so two orgs sharing a namespace alternate

The cursor a cut pass leaves named the entry by namespace alone, and
`rotate_to` took the first entry of that name. With `code-widgets` in two
orgs and a budget for one commit, both cuts named the second org's entry and
both passes served the first org's.

A cut is now kept as `<org>/<namespace>:<leg>` and the commit, bootstrap and
walk phases rotate on `cut_key` (org and namespace). `cut_phase` reads the leg
after the last colon, so an org name containing one still parses. A cursor
written before this names no org and matches no entry: the pass keeps the
configured order once, and the next cut is written in the new form. A build
without this change reads the new form the same way (rolling-upgrades, rule 4).

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the leftover commit-times argument from two ingest tests

Two callers still passed a map of commit times as the helper's third
argument, which since the helper dropped its times parameter is the
per-commit file count. A time of about 1.7 billion became that many
file names, so the run grew until the memory limit killed it. Both
callers use the helper's defaults now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The budget-cut test expects the org-keyed resume point

The cut now resumes at org/namespace:leg, so the existing test reads
o/code-x:walk.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* A refused compiler-tier delta holds its tier on the whole run, not on its target and caps (#1582)

The hold a refused delta leaves (<watermark>_refused) recorded only the target
and the three caps its open read. The run's window starts at the tier's
watermark, which other writers move (`loom code scip-full`, a batch apply, a
base-unknown reset), and the harness reads inputs the key did not carry
(exclude_generated for Go, scip_ts_projects and code_scip_ts_paths for
TypeScript, code_scip_delta_max_tus for C/C++). So a tier stayed held after its
watermark moved, after a branch was force-pushed back to the refused commit,
and after the entry's generated-file rule changed, each of which makes the next
run a different one.

The record is now {base, target, caps, inputs, loom}, written as sorted JSON so
code_index_state shows why a tier is held. `base` is the watermark the run
started from, `inputs` is what the tier's harness reads besides the window (an
empty object for Python), and `loom` is the release. Each delta worker reads
those inputs once per pass and builds the harness environment and the hold from
that one snapshot, so a setting changed while the harness runs cannot make the
record differ from the run. A hold that cannot be written fails its pass with
the store error, and the next pass runs the harness again.

Holds written by the previous format never match, so each held tier runs once
more after the upgrade and holds again. The operations guide names what the
hold keys on and what releases it, and no longer says extra Go deltas hold.

The tests are the three cases the review found, on a moved base, a branch
pushed back to a refused commit and a changed generated-file rule, plus the
translation-unit cap read once per pass and each tier's inputs in the record.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes (#1552)

* loom code backfill keeps an owed edge pass across a resume

A first full backfill implies the edges-only second pass, but only while
its cursor is empty. A first backfill stopped in its index phase (a held
org, a SIGTERM, a crash) resumes with the cursor set, and a rerun after an
interrupted edge pass finds the cursor at its end: both finish, write
`git_head` and drop the pass, so the namespace's cross-file references
stay unbound and nothing says so.

The run now records why it owes the pass (`first-backfill`, or
`requested` for `--edges-second-pass`) under
`backfill_edges_owed:index<suffix>` before its first batch, and clears the
record once the pass is done. A resumed run or a rerun reads the record and
runs the pass; `--no-edges-second-pass` declines it and clears the record.
A `--paths-file` repair records nothing, as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom runs a parsed command through one entry, dispatch.run_parsed

A command's context is bound in two places: `main` wires the process's
seams, and `_dispatch` binds the traffic class, the query tag, the actor
and the org the command bills. A second process that runs a share of a
command's work needs exactly that, so it is one function now,
`run_parsed(args)`, in its own module, `server/cli/dispatch.py`, with
`_dispatch`. `app.main` parses and calls it. A family module may import
`dispatch` without importing `app`, so the package's one-way import rule
holds. Nothing a command does changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill runs its batches through one run, cut at the header/source boundary

The index phase's reader and ingest and the edge pass's ingest move from
closures in `_backfill` and `_second_edge_pass` into `_Run`, built once
from the entry, the head, the embedder and the denylist; a batch of either
pass is a method on it. The code is the closures' code, reading its fields
from `self`.

`_cursor_batches` hands out the batches with their first index. The
headers `headers_first` puts first end their own batch, so no batch holds
both a header and a source and every header can be written before any
source batch starts. A resumed run starts at its cursor wherever an
earlier build cut.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes

One backfill process parses and extracts at about one core, whatever
--concurrency says: every tree-sitter parse holds the interpreter lock and
runs one at a time per process, and the extraction after it walks the tree
in Python. A tree does not pickle and a file's extraction reads the index
between its steps, so a worker takes a whole cursor batch: its own
connection, reads, parse, extraction and writes.

A worker is the command itself. The parent starts N spawned processes on
its own parsed arguments; each enters through dispatch.run_parsed, as
`loom` does, so it runs under every binding the command runs under: the
background traffic class, the cli.code.backfill query tag and operation,
the org it bills, logging, telemetry, SIGTERM and Ctrl-C handling, the
wired seams, the model-work admission and the registry read. `_backfill`
then serves the batches it is sent instead of walking the tree, each
awaited in the command's own task. One pipe per worker carries its batches
and their counters; nothing crosses but paths, counters and the reason a
batch was held.

The parent hands a worker its next batch when the worker reports its
last, so once a batch is held nothing more starts, and the batches still
running are counted. The cursor moves past a batch once every earlier one
is written. The header batches are all written before the first source
batch is handed out. A worker caches what it reads of the index (header
texts, the import resolver's live path set, layouts and listings), and
another worker's writes do not reach those caches, so it forgets them when
it moves to the sources and to the edge pass, which therefore reads the
finished index. The edge pass forgets them in one process too: the Go
listing and the other resolver caches outlived the index phase by up to
their TTL, so the pass did not re-derive what it claimed to. The same
workers serve both passes, admitted once, as the parent is.

A run whose workers wrote batches side by side owes the edge pass whatever
the flags say, recorded as `workers`: a file there resolved against what
its worker had read while the others were still writing. `--paths-file`
and `--no-edges-second-pass` runs with --workers run it, and a later
backfill that finds it owed runs it.

Stopping: a closing pipe cancels the worker's command task, as its own
SIGTERM or Ctrl-C does, so a stop of the parent, of the worker or of the
whole process group unwinds through the batch before the worker retires.
The parent closes the pipes when the run ends, fails or is cancelled, and
a killed parent closes them too. The parent reads every exit code: a
worker that exits before its run opened, in a batch (named with its first
index, and with the signal when one killed it), or on close (a failed
drain or retirement) fails the command; on close only after the command
has written its own end of the run, as one process retires after its
command returns. --workers is refused below 1 and with --phase embed, and
no more workers start than a pass has batches. --workers 1, the default,
keeps one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep the edge pass owed when a pass ends with errors

A worker's edge batch can return with errors when a file write fails.
The owed record now clears only when the pass reports none, so a resume
runs the pass again. The test fails an edge write in a two-worker run
and resumes in one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Index embed-excluded paths without a description or a vector (#1564)

* Index embed-excluded paths without a description or a vector

A repository entry's `embed_exclude` globs (`LOOM_CODE_EMBED_EXCLUDE` for
the scalar entry, the `exclude` glob semantics) keep a path in the index:
it is chunked, its symbols, edges and test map are derived, and code.search
reaches its chunks through the lexical leg. Its new chunks are neither
described nor embedded, in the file ingest and in the round's prefetch, and
`loom code describe` leaves them alone. The rows carry
`unembedded by design: embed_exclude`.

Embed recovery and the coverage counts now match the shared prefix
`unembedded by design`, so reference fixtures and embed-excluded chunks
are neither stubs to fill nor counted in the embeddable denominator. Rows
already stored under the reference marker match it unchanged.

Test files are often a large share of a repository's chunks; this lets an
operator spend the embedder on source and reach tests from the source hit
through the test map.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep unembedded-by-design chunks without a vector in reembed

`loom code reembed` copies a row that carries the `unembedded by design` marker under the second label with its marker and no vector, so an embed-excluded path or a reference fixture is not embedded there and that label's recovery leaves it alone.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep every vector and description writer off embed-excluded paths

The provider rebuild embedded every live `code_chunks` row and cleared
`embed_last_error`, so a staged embedder switch gave embed-excluded chunks
and reference fixtures a vector and erased their marker. It now stages a
row marked unembedded by design without a vector and keeps the marker.

The `code_summary` pass wrote an LLM card and a card vector for an
embed-excluded file, and could carry a twin's card across models. It now
takes the entry's `embed_exclude` globs (`denylist_for`), writes and carries
no card for a matching file, and clears a card written before the glob: the
row keeps its rank and carries the marker, so recovery and the card leg of
code.search skip it. Removing the glob lets the next pass write the card.

`unembedded_by_design` is the one predicate the Python writers read the
marker with. A test discovers every code-plane module that calls an
embedder or an LLM and fails until a new one is declared as a writer gated
on the marker or the globs, or as a query-side reader; the round prefetch
filter, the describe skip and the marker precedence get their own tests.
`ReembedStats.rows_unembedded` had no reader and is dropped.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Resolve the ingest denylist once per file

`ingest_file` resolved `default_denylist()` in `_refused` and again for the
embed rule; it now resolves it once and passes it down. The chunk stage's
`embed_excluded` has its one caller pass it, and the marker choice reads as
one expression.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Document embed_exclude on a changed glob, a rollback and self-service entries

The operations guide states what a changed glob does: adding one leaves
existing vectors until a chunk changes, and removing one leaves the chunks
unembedded and outside the coverage denominator, embedded again when their
content changes or when the repository is indexed into a new namespace.
`embed_exclude` applies to configured entries only. A rolling-upgrades entry
records how an older build reads the marker as a stub. The coverage
comments name both kinds of rows unembedded by design, and the setting's
comment is cut to two lines; the generated references are regenerated.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* simplify: N-1-safe marker, drop the enumeration test and the card clear

The embed_exclude marker now extends the reference fixtures' marker
(`unembedded by design: reference (embed_exclude)`), so the previous build's
recovery, backfill embed phase and coverage counts, which match
`unembedded by design: reference` as a prefix, skip it as this build's do.
The recovery and coverage reads keep main's parameter.

A test pins the reference literal, and a cross-version test checks that the
row ingest stores is skipped by the previous build's recovery predicate and by
this build's.

The code_summary pass no longer clears a card written before its file's glob:
a card, like a chunk, keeps the state it had when the glob was set. The
candidate and carry filters stay.

The model-caller enumeration test is gone: it was a closed list that every new
caller had to edit, and it passed with the ingest gate removed. The reembed,
provider rebuild and card tests move beside their existing fakes, and the
recovery parameter check already in test_code_reference_files.py stays the
only one. reembed partitions its rows in one loop and reads the column it
always selects. Rule 63 and the operations guide say what is true now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An embed-excluded file's card goes once the file changes

The code_summary pass leaves embed-excluded paths out of its candidates, so a
card written before the path's glob was never rewritten or removed after the
file changed: code.map and the cards leg kept serving a description of the old
content.

The pass now tombstones the live card of an excluded path whose inputs_hash no
longer matches the file's content hash, a deleted file included. A card that
still matches the file stays, as before, and a rank row without a card is left
alone. The next code_graph_stats pass writes the file's rank row back. The
operations guide says the card stays until the file changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Spell the full setting name in the coverage description

code_ready_embed_coverage named embed_exclude by its suffix; it now
names code_embed_exclude, and the example file and schema follow.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Regenerate the configuration reference for the coverage description

scripts/codegen/settings_reference.py after 59fc1016f's catalog wording change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Write the graph-stats rank copy just above the card it read

The ranks leg reads a live file card, then inserts a mirror of it with the
new rank at the clock version. A tombstone or a new summary written in
between carries an earlier version than that copy, so the copy won under
FINAL and brought back a card retired meanwhile.

The copy now takes the read card's version plus one. Every other writer
takes its version from the clock, so a later tombstone or summary is
higher and wins; with no write in between the copy is still the newest
row.

The test reads a card, lets the tombstone land during the read and checks
that FINAL keeps the tombstone. It fails without the change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The operations guide says LOOM_CODE_GIT_CA_FILE sets trust, not reach (#1580)

* The operations guide says what LOOM_CODE_GIT_CA_FILE settles and what it does not

The guide's paragraph for LOOM_CODE_GIT_CA_FILE read as if the setting made a
forge under a private authority indexable. It settles trust only: in the
repository-job sandbox the egress proxy still refuses a remote whose name
resolves to a loopback, private or link-local address, and no setting admits
one, so such a forge indexes only as an operator repository on a host without
the sandbox. The guide now says so.

It also says what the bundle applies to (every git a repository job runs, the
compiler tier's dependency fetches and submodule updates included, so the
bundle must hold the public roots when any of those reach a public host) and
that the path is not checked when the setting loads: it must be absolute and
inside the sandbox's read-only /etc/ssl, and a relative or `~/` path, or a link
leaving /etc/ssl, fails in git's own words. The "CA bundles" paragraph now
counts three bundles and says which one git uses through the proxy.

The unit test imports asyncio at the top of the module. No behaviour changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Name the trees the repository-job sandbox mounts for the git CA bundle

A link out of /etc/ssl can still work: the sandbox also mounts /usr and
/etc/ca-certificates read-only, so a link into /usr/share/ca-certificates
resolves to the same file. Say the target must be visible to the job and
keep /etc/ssl as the suggested location.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The mirror sweep keeps the tier checkouts of an entry that names no producer (#1584)

* The mirror sweep keeps the tier checkouts of an entry that names no producer

`_named_paths` named `checkout_for(c, "")` for each entry. For an entry with
no `scip_producer` that is `<checkout>.`, a path no tier uses, so the
checkout of the tier its tree calls for (`<checkout>.python`,
`<checkout>.typescript`, `<checkout>.go`) was named by nothing. `_sweep_root`
removes an unnamed `checkout-*` directory older than 600 s, so a self-service
entry's tier checkout was deleted and copied again over and over. A
configured entry is unaffected unless its checkout sits under
`code_repos_root`.

Name `checkout_for(c, p)` for every producer the tiers can run, plus the
entry's `scip_extra_producers`, and for each registry row its checkout and
the sibling of every producer. `repos.sibling_checkout` holds the one
spelling of a sibling path, so the sweep and `checkout_for` cannot drift.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the clause about the removed call from the sweep comment

The comment above `checkouts` in `_named_paths` described a line the previous
commit removed. It now says what the code does.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Sweep only the named tiers of an entry that names its producer

An entry with a scip_producer runs that tier and its extras only, yet the
sweep named every tier's checkout for it, so the old checkout of a tier
removed from its extras stayed on disk until the repository went. Keep all
candidate tiers for an entry naming no producer and only the named ones
otherwise.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The CLI embed phase republishes only when behind, once, with coverage first (#1581)

* A backfill phase republishes once, last, and only where the counts trail

With nothing pending, the embed phase declared its org and republished
whenever a `table_counts` row existed. Readers write that row: `loom code
stats` with a mistyped --org leaves a row of zeros, so the same typo on
`--phase embed` declared the org, and every idle embed run on an indexed
namespace paid the org gate, the count scans and the coverage aggregates.
It now declares only when rows are pending or the published chunk counts
differ from the chunk table. That comparison is a store read,
`CodeRepo.published_chunks_behind`, over the shared counts and the chunk
aggregate.

The index phase writes `git_head` and the backfill stamps first, then
`_close_index` compacts, records the pass and republishes last on every
exit (a full run, a run resumed at the end of its cursor, a hold, a repair,
a twin label), so the `republish` flag is gone. The cursor is cleared after
the republish, so a run interrupted while it publishes resumes at the end
and publishes then.

The republish writes the coverage row first and the counts row only once the
coverage has landed. An embed phase stopped between the two, by Ctrl-C or a
failed coverage refresh, otherwise left the counts current and the coverage
at the pre-embed vectors with a matching fingerprint, and the rerun found
nothing behind. It also reads with sequential consistency: the fingerprint
it stamps carries the `git_head` the run has just written, which the replica
serving the read may not have yet.

The tests drive `_backfill` and `_backfill_embed` against the real
`CodeRepo` over a replica that lags the run's writes, and read the rows
back.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused coverage write keeps the counts behind

The CLI writes the counts row only once the coverage row has landed, but
`refresh_coverage` swallowed its own write failure, so the counts landed
anyway and the next embed phase found nothing behind. The CLI now passes
`must_land=True`, which makes the coverage write raise.

`published_chunks_behind` also reads the coverage row's embedded figure,
so current counts over a coverage row that trails the chunks still count
as behind. That state comes from vectors landing between the two writes,
or from an earlier build that published counts after a failed coverage
write.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An existing coverage row is compared even when the counts row is missing

When the index phase published coverage and its first counts write failed,
an embed phase that landed its last vectors and stopped before publishing
left an idle rerun reading a missing counts row as nothing to republish.
published_chunks_behind now compares the coverage row on its own.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* Show repository freshness from mirror health (#1604)

A successful mirror fetch can leave the same commit indexed for days. Use the server’s overdue-fetch flag for the badge and keep deployment worker errors in the worker diagnostics.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires (#1002)

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires

A confirmed renewal can extend the deadline while the previous wait resumes. Use the current freshness before stopping workers, and retain genuine expiry controls.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover the review provenance default in Cell proof refusals

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

---------

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Edit context includes verified indexed forwarding targets (#1494)

* Edit context includes verified indexed forwarding targets

When one typed forwarding call resolves in the same index revision, cite the target in read_sources. Share the bounded lookup between single and batched edits and keep existing member reads independent.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Load forwarding helpers after the code modules initialize

Initialize grep and edit context in either order by loading forwarding helpers only when the optional source lookup runs.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Use scoped cursors in vector continuation fixtures

Keep the original search scope on stored cursors so the fixture exercises continuation without fresh retrieval.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bump the actions group across 1 directory with 3 updates (#1516)

* Bump the actions group across 1 directory with 3 updates

Bumps the actions group with 3 updates in the / directory: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv), [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `astral-sh/setup-uv` from 10.3.3 to 10.4.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/68559e99cc807c1eb7e9238fd43a15bba460eec2...1db35dd8eee11c5894872e0b383ae6c406cf738d)

Updates `ossf/scorecard-action` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/fa7117db83c52d787ae5a89f350999701505d78e...23f22cd43608bae7a1f1fa2603d7314dee9538a5)

Updates `github/codeql-action/upload-sarif` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.1...33d7b85da1a04171e211befe2c739303b9a4c066)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>

* Scorecard fails when the API rejects a publication

The updated action warns by default. Opt into failure on API rejection so a stale public result is visible in the workflow status.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scorecard uploads SARIF when publishing fails

Upload the completed scan when the file exists so a publication rejection still leaves results in code scanning.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep excerpt bounds in the compact coding schema (#1613)

Numeric bounds in JSON Schema do not constrain string values. List the
grep context radius as an integer so its existing bounds apply while
the server still accepts and validates numeric strings.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code read accepts same-file line pairs (#1614)

* Read same-file line pairs in one source request

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Advertise code read pair endpoints as integers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP validation errors omit rejected retry examples (#1612)

* Omit invalid retry examples from tool errors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep retry examples faithful to supplied values

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Validate corrected arguments and keep explicit scope out of retry guidance

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show missing-field templates only for fillable arguments

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep spelling corrections within their original argument object

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Compact SCIP replies omit documentation present in function bodies (#1617)

SCIP wraps declarations and can unquote forward references. Compare the
Python function headers and docstrings before dropping a description.
Keep any description whose declaration or documentation adds evidence.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The assistant runs natively with caller-scoped tools (#995)

* Run the assistant natively without a bundled chat service

Own bounded streaming model turns and authenticated MCP tools in the web process. Validate citations against answer receipts and capture usage before completion. Retain external state and provisioning metadata for an approved cutover.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Use shared signing for native assistant streams

Streaming requests share endpoint resolution, credential refresh and private
header filtering with the provider transport. Cancellation joins pending
signing before the producer exits. Reuse the deployment region setting and
regenerate its settings artifacts. Verify native enablement with serving TLS.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native answers retain publication proofs through response delivery

Whole replies retain nested source-access proofs through required accounting
and response delivery. Citations use returned help anchors, and native
configuration failures remain visible in the dashboard. Retained provisioning
credentials keep their rotation coverage while replaced polling paths are removed.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native authorization fixtures use the retained evidence paths

Route fixtures bind the answer-owned MCP app. Protected ledger fixtures exercise
the pure support rule with all authorization and marked-outcome expectations kept.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Assistant fixtures follow asynchronous credential admission

Keep authorization, revocation and whole-response publication assertions on
the provisioning-aware credential boundary used by the served routes.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant evidence uses request-owned receipts

Remove unused persisted-answer query code and preserve receipt-based support
assertions. Cover configuration admission and model-alias pricing, correct
configuration documentation and bounds, and align the disabled chat fixture
with the native refusal contract.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe SQL citations using answer-owned receipts

Keep persisted query metadata separate from citation verification and remove
unused support fixtures after the polling path is retired.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native display steps use the receipt formatter

Keep step labels and protected-row rules in the shared formatter. Retain the
local-model routing and container networking guidance alongside assistant setup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Translated setup links point to the native assistant guide

Regenerate the published setup destinations when the English guide is replaced.
Keep the translated text and source stamps for the translation updater.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Keep assistant archives private and bound retained credential writes

Create converted archives exclusively with owner-only permissions and keep
credential resealing statements inside the retained provisioning lease.
Remove unused ticket and accounting state and obsolete test seams.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Retain streamed source proofs and bound help citations

Keep nested tool publication guards through final accounting and refuse citations to unread help outline sections.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Exercise the terminal publication boundary in stream delivery tests

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover source proof loss before streamed assistant content

Exercise access changes during model generation and an awaited send while preserving final accounting and stream cleanup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Renew streamed source proofs at each HTTP send

Share retained source proofs with the HTTP request tail while keeping streamed accounting open until its terminal event. The new source-loss regressions reproduce unchecked private content before this repair.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant tests retain mirror admission and private accounting

Exercise real admission and response accounting through source activation, marked refusal, failed private delivery and repeated provider cancellation.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Clarify provider setup and failure diagnostics

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit d6675819a9447ce97f5f21e1b72747c8b1a1cd7b)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Refresh the provider architecture summary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Route the conflict judge in the single-provider recipe

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit f93385b019dc0978daa33b08392e717348c7643c)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe the dashboard model selection boundary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a6d8a1279a4a8fe4a4eae3b170610c662b52e0b5)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit cb594d01ade7d2b883849670db9f314a46f4abc4)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a94d2f909a47d61532d0f6ac24aad79b09ac42b9)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Isolate retirement fixture timing in assistant qualification

Compose the reviewed retirement fixture clock so handler startup does not consume cancellation checks. Keep the original deadline and assertion bodies.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Verify assistant code citations against complete returned source

Code cards and skeletons retain original line bounds while withholding source. Require a complete unelided unit or file body with matching line bounds before verifying a code citation. Cover malformed and withheld spans while preserving full-source positives and other citation kinds.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Grep fallback tests separate deadlines from response handling

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a909dad266915b5ad6202d8d3c7d5a16bb635bbc)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound native gateway refusal reads before stream parsing

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 9ea1817ab4f9e5273c45666a00bf5fdd6544ec88)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant checks use receipt verdicts and caller context

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Redaction cost samples meet their CPU clock floor

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe assistant support from answer-owned receipts

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bedrock rejects content block indices after close

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Remove an unused citation test constant

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Grep fallback tests separate deadlines from response handling

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compose canonical cleanup and fallback fixture controls

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Reserve assistant tool provider costs before sending

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bind tool price reservations to text inference protocols

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* test: enforce assistant tool budget through authenticated MCP

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Prove grep fallback aborts an admitted stalled fetch

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Allow native assistant reads to select user and session rows

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Keep retained qualification state out of version control

Qualification state and JSON results can contain credentials. Keep their
three path-specific ignore patterns after removing the integration.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Check retired chat sources without traversing retained data

Qualification state and results rem…
* MCP grep batches exact and related source reads (#1542)

* MCP grep batches exact and related source reads

A literal batch can return an exact test declaration and related source for another query. Include valid ranges from both evidence groups in the same source read suggestion.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep mixed grep reads for location-only matches

Validated ranges can drive a combined read when a caller requests zero excerpt lines. Preserve the continuation for languages without a named edit selector.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Complete grep excerpts at the verified indexed revision (#1545)

* Complete grep excerpts at the verified indexed revision

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep enrichment deadlines local to each page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep indirect test evidence for shared call sites (#1546)

Use the qualified caller and source location to recognize one call site across the parser and compiler index. Keep both symbol IDs for reading incoming test edges.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Mutation tests use pytest 9.1.1 (#1543)

Match the main test environment and give the dependency graph a fresh lockfile to scan.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption telemetry includes contact domains by default (#1544)

* Adoption telemetry includes contact domains by default

Use eligible namespace contacts from password and federated accounts so deployments can report aggregate domain activity across sign-in methods.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The adoption report test counts password contacts

Exercise the expanded contact scope in the live report test, including requests attributed to a password account.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Return fresh lessons from verified callers in code edit context (#1554)

* Keep fresh lessons for verified forwarding callers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep distinct verified caller lessons eligible

Select fresh links before reading a limited set of excerpts. Use the complete excerpt to distinguish lessons written under a shared key.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require fingerprint proof for verified caller lessons

Restrict exact-revision lesson reads to compatible, nonempty fingerprint comparisons. Ordinary symbol reads keep their existing state fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Verify restored caller lessons against their original source

Trust the checked hash only while its stored link still identifies located code. Keep ordinary symbol reads on their existing fallback.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Link coding-agent memory guides to their verification steps (#1561)

Readers can check a cross-client handoff, a code-linked lesson and the SQL audit before choosing a team setup.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Preserve Python member reads when SCIP is indexed (#1566)

* Preserve Python member reads when SCIP is indexed

Resolve typed reads from the parser candidates in the same name query so a compiler ID for the same member cannot displace its parser edge.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Retain compiler-only Python member candidates

Prefer parser candidates per qualified name so a compiler-only member with the same short name remains readable.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Name agent memory capabilities in documentation search titles (#1567)

* Name agent memory capabilities in documentation search titles

Put each page’s task in its title and description so it makes sense outside the sidebar.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Distinguish request IDs from worker query tags in telemetry metadata

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show how edit context returns a caller’s saved lesson (#1569)

* Show how edit context returns a caller’s saved lesson

A coding agent can read the constraints that apply at a forwarding call before changing its dependency.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* State the source and access requirements for caller lessons

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Add an evaluation checklist for choosing coding-agent memory (#1571)

* Add an evaluation checklist for choosing coding-agent memory

Teams can use their requirements to choose a starting setup and copy the checks into a pilot.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Require authenticated writes in the selector’s SQL audit check

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* LOOM_CODE_GIT_CA_FILE lets git trust a remote under a private authority (#1549)

Repository-job git reads no system or global git config and inherits no
environment beyond PATH, HOME, LANG and TMPDIR, so neither `http.sslCAInfo`
in a git config nor GIT_SSL_CAINFO or SSL_CERT_FILE reaches it: it verifies
with the image's default roots, and a git server whose certificate a private
authority issued fails every clone with "server verification failed:
certificate signer not trusted". The one setting that hands git a bundle,
LOOM_CODE_GIT_PROXY_CA_FILE, applies only through a forward proxy.

The new setting names a PEM bundle that `auth_env` passes to every repository
job as `http.sslCAInfo`. Through the proxy, LOOM_CODE_GIT_PROXY_CA_FILE is
appended after it and wins when set, so proxied deployments behave as before.
A deployment that does not set it is unchanged.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused compiler-tier delta holds its tier until a cap or the target changes (#1551)

* A refused compiler-tier delta holds its tier until a cap or the target changes

A delta tier whose delta `open_delta` refused (over a cap, a link, not a
regular file) recorded the failure and left its watermark, so every pass
ran the full harness again at the same commit and was refused the same way.

The tier now keeps the refused target and the delta caps in effect. While
both match, the next pass skips the entry before the checkout moves and the
failing record keeps its fix. A raised cap, a live setting, or a new branch
head releases it on the next pass. A delta that changed while it was read
holds nothing. The C/C++, TypeScript, Python and Go delta tiers share it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refusal hold records the caps its open read

The hold sampled the delta caps after `open_delta` failed, so a cap raised
while the open ran was recorded as the one the delta was refused under: a
1.5 MB delta refused at a 1 MB cap that was raised to 2 MB stayed held at
2 MB, where it opens.

`delta_caps` now reads the three caps once; `open_tier_delta` passes that
snapshot to `open_delta` and records the same one in the hold.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the namespace's counts and coverage (#1550)

* CLI backfill phases republish the namespace's counts and coverage

`code.index_status` and `code.repos` read `chunks_embedded` and
`embedding_coverage` from the shared `table_counts` row, and the Repositories
page reads per-language coverage from the shared `coverage` row. The ingest
pass republishes both after it moves rows; `loom code backfill` moves rows
outside it. A reader serves the counts row whatever watermarks it was computed
at, so after `--phase embed` status kept reporting the pre-embed coverage
(`embedding_coverage: 0.0`, `searchable: false`, `code.search` answering
lexically) until an ingest pass moved the namespace's rows again. Embedding
moves no watermark, so the coverage row stayed current to its readers as well.

Each phase that wrote something republishes both rows at its end, as the
ingest pass does. A failed refresh is printed and does not fail the finished
phase.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* CLI backfill phases republish the counts at every phase end

The republish ran only when this run's own counters were nonzero. A resumed
index whose cursor was already at the end, or an embed phase whose last page
landed before the process died, wrote its rows in an earlier process and so
left the pre-backfill `table_counts` row in place. Both phase ends now
republish unconditionally; a republish is one query per row.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The embed phase republishes the counts only for an org it declared

An embed phase with nothing pending republished without declaring its org, so a
mistyped --org wrote counts and coverage rows that the cell never gated. With
nothing pending, the phase now declares and republishes only a namespace that
already has a counts row; a mistyped org has none and writes nothing.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A full index run republishes the counts after its watermark

The full-run path republished in `_close_index`, before it wrote `git_head`.
Both rows carry the counts fingerprint, `git_head` included, so `code.coverage`
rejected the new coverage row and the next reader ran the aggregates again. A
full run now republishes after the watermark and the backfill stamps; a hold,
a repair and a twin label write no watermark and republish in `_close_index`
as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The Anthropic client sends a JSON Schema as the Messages API's structured output (#1311)

* The Anthropic client sends a JSON Schema as the Messages API's structured output

A json_schema response format was dropped, so the conflict resolver's Claude answers came back in a shape parse_verdicts could not read and every judgement failed while still being billed. The schema now goes in output_config.format and into the JSON directive, which keeps the shape when a model refuses output_config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A refusal of one output_config key drops that key alone

A 400 naming output_config.effort recorded a refusal of the whole output_config, so later schema requests to the same model lost output_config.format. traits.refused_key records output_config.effort or output_config.format on its own, and the Anthropic client leaves the other key in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

* A rejected schema drops the format for that request alone

A 400 that points inside the sent schema (output_config.format.schema...)
rejects that schema, not the model's structured output. The call is re-sent
without the format and nothing is remembered for the model, so later
requests still send their schema. Refusals of output_config.format itself
are still learned per model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>

---------

Signed-off-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Paulo Budal <1210892+pauloeduardo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* The embed phase binds its candidate keys a slice at a time (#1547)

`loom code backfill --phase embed` failed on a ClickHouse at its default
`http_max_field_value_size` (128 KiB) with "HTML Form Exception: Field value
too long". `pending_embed_chunks` asks phase 1 for four times the page size
(2,000 keys for the CLI's page of 500) and bound every (path, chunk_id) pair
as one form field in the phase-2 FINAL read; at ordinary path lengths that
list is several hundred KiB.

Phase 2 goes through `query_all_sliced`, as other keyed reads do. Each slice
keeps its own oldest `limit` rows and the slices' rows are ordered and capped
together, so the page is the oldest-first page one statement would return.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Link the memory selector from the agent documentation index (#1574)

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings (#1572)

* Format the coding-agent memory selector page

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Fix the open code-scanning findings

Resolve local actions from the workflow commit, verify translations from a scheduled job, install npm packages from lockfiles, and validate each docs destination as a parsed link.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Include the selector page in the IndexNow route test

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Pin the coverage action to its full commit SHA

The plugin scanner requires a full SHA for action references it treats as remote.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep queued translation requests during scheduled checks

Finalizer polls and translation batches share one queue. Keep pending requests available while the current run finishes.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Adoption shows active reported contact domains (#1577)

List domains with successful requests over 90 complete days. Use report version 2 to keep domains collected under the private notice out of the public list.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Replay how Loom memory follows source edits (#1588)

* Replay how Loom memory follows source edits

Show branch-specific lesson states from a recorded comparison and let readers repeat the evaluation on a disposable hosted runner.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scope evaluation cleanup to its server job

Finish the fork instructions and apply the site formatter.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep pytest node paths out of code anchors (#1589)

* Keep pytest node paths out of code anchors

A pytest command can make a file extension look like a qualified symbol. Skip selectors with explicit Python paths so a note can link the declarations it names.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Handle class-only and nested pytest node selectors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep attached decorators in Python test examples (#1592)

A context window that starts at the function declaration hides decorators that still belong to the test. Reuse the retained chunk to prove the decorator prefix and stay within the requested radius.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Grep cursors keep their path filters (#1594)

A page offset belongs to the original file selection. Bind that scope before reading the saved pool or retrying the query.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code edges keep distinct relationship kinds across index tiers (#1595)

A compiler call and a parser read at the same location describe different relationships. Collapse the rows only when their kinds agree.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Search cursors keep their original filters (#1596)

A page offset belongs to the results selected by the original filters. Verify those filters before serving a saved page or rerunning the search.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-target edit context returns verified member source (#1598)

* Single-target edit context returns verified member source

Agents can use one exact name and get the same revision-verified member source as a one-name batch.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Describe member sources for both edit context forms

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* File-qualified symbols resolve unique indexed path suffixes (#1600)

When a relative spelling omits a source directory, look up the symbol on the one live indexed file with that complete suffix. Keep an existing path as the lookup boundary and leave ambiguous suffixes unresolved.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Edit batches share verified test source reads (#1601)

* Edit batches share verified test source reads

Reuse a verified source window when several named targets cite the same test. Keep each citation and deadline and drain pending reads before the batch exits.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bound shared edit example reads

Apply the enrichment deadline to the shared source read. A later waiter can retry after a stalled read reaches its deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lessons verify the commit while reading source (#1602)

* Single-file lessons verify the commit while reading source

A successful bounded local blob read proves that the mirror holds the pinned commit. Use one Git process for that case and keep the mirror availability check when the local read cannot supply the file.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Single-file lesson reads share one parse deadline

The fallback spends only the source-read time left after a local miss. Keep the mirror availability check and bound both paths with the same deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Erasing a code namespace removes its cached code.ask answers (#1585)

* A code namespace erasure deletes the cached code.ask answers asked in it

The erasure step for cached code.ask answers deleted only those that quoted the
erased namespace's memories (`memory_namespace`). An answer asked in the erased code
namespace carries the repository's code in its text and was left in
`loom.code_answers`, uncounted by the residue census. After a re-index of the same
commit it was served again, since the cache invalidates only when a cited file changes.

The step and the census now match a row by `namespace` as well as `memory_namespace`.
The delete stays a lightweight delete read sequentially, and the census still skips a
tombstone that holds no text.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Align the answer-cache erasure docs and comments with the changed step

The architecture doc still said an answer drawn from the code index alone stays;
a namespace erasure now deletes it with the code namespace it was asked in. The
module docstring of the answer-cache erasure tests, the `namespace_tables`
docstring and one test docstring described the old predicate, and the comment on
`KEEP_TABLES` now says only what is not purged there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Guard every cached answer against an erasure, not only memory-quoting ones

An ask can finish synthesizing after the namespace delete and the final
census. The answer cache skipped its erasure check when the answer quoted no
memory, so a code-only answer could land in the erased namespace. Run the
before-and-after write guard for every answer, and delete a code-only answer
that lands after the mark by its own key.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* An abstain's negative cache entry is guarded against an erasure and counted by its census

An abstaining ask that overlapped a namespace delete could recreate its cached
question afterwards: the negative entry was written without the erasure check,
and the census skipped it because its answer and citations are empty. The
negative write now runs the same before-and-after guard as a synthesized
answer, and the namespace census counts a row that holds a question.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refresh the analyzer shapes and the tombstone sentence for the code-only guard

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits (#1562)

* The commit phase serves entries round-robin, so a long backlog no longer starves another entry's new commits

The pass ordered every entry's pending commits by commit time, floored at a
24-hour horizon. A mirror far behind on older history therefore outranked
every recent commit of every other entry, and while its backlog lasted a
branch with one new merge stayed at 0 of 1 pass after pass.

Each round now gives every waiting entry one commit, the entry with the
fewest landed this pass first, then entry order. Within an entry commits
stay oldest first, so the watermark still moves one commit at a time. At the
budget the entry the scheduler would have served next is cut first, and the
next pass starts there through the existing `commits` cut and `rotate_to`.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A sliced commit counts as its entry's turn in the round-robin

A commit sliced at the share clock returned before the entry's landed count
moved, so it was deferred at the same key as the entries the round had not
reached and won the tie on entry order. The `commits` cut then named the entry
that had just been served, and a small entry behind sliced large ones stayed at
0 of 1 pass after pass.

A sliced entry is now deferred one turn later than its landed count, so the cut
names the entry the round did not reach and the next pass starts there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The commit-phase tests state the round-robin order and drop unused commit times

The scheduler no longer reads commit times, but the test helpers still took a
`times` map and patched `commit_meta_many`, so the dates passed to every
fixture were inert and two test names read as if a date were an input. The
helpers lose the parameter and the patch, the cases are named by backlog
size, and the lanes and round-robin docstrings and one assertion message now
describe the order across entries as round-robin.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The ingest cut names an entry by org and namespace, so two orgs sharing a namespace alternate

The cursor a cut pass leaves named the entry by namespace alone, and
`rotate_to` took the first entry of that name. With `code-widgets` in two
orgs and a budget for one commit, both cuts named the second org's entry and
both passes served the first org's.

A cut is now kept as `<org>/<namespace>:<leg>` and the commit, bootstrap and
walk phases rotate on `cut_key` (org and namespace). `cut_phase` reads the leg
after the last colon, so an org name containing one still parses. A cursor
written before this names no org and matches no entry: the pass keeps the
configured order once, and the next cut is written in the new form. A build
without this change reads the new form the same way (rolling-upgrades, rule 4).

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the leftover commit-times argument from two ingest tests

Two callers still passed a map of commit times as the helper's third
argument, which since the helper dropped its times parameter is the
per-commit file count. A time of about 1.7 billion became that many
file names, so the run grew until the memory limit killed it. Both
callers use the helper's defaults now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The budget-cut test expects the org-keyed resume point

The cut now resumes at org/namespace:leg, so the existing test reads
o/code-x:walk.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* A refused compiler-tier delta holds its tier on the whole run, not on its target and caps (#1582)

The hold a refused delta leaves (<watermark>_refused) recorded only the target
and the three caps its open read. The run's window starts at the tier's
watermark, which other writers move (`loom code scip-full`, a batch apply, a
base-unknown reset), and the harness reads inputs the key did not carry
(exclude_generated for Go, scip_ts_projects and code_scip_ts_paths for
TypeScript, code_scip_delta_max_tus for C/C++). So a tier stayed held after its
watermark moved, after a branch was force-pushed back to the refused commit,
and after the entry's generated-file rule changed, each of which makes the next
run a different one.

The record is now {base, target, caps, inputs, loom}, written as sorted JSON so
code_index_state shows why a tier is held. `base` is the watermark the run
started from, `inputs` is what the tier's harness reads besides the window (an
empty object for Python), and `loom` is the release. Each delta worker reads
those inputs once per pass and builds the harness environment and the hold from
that one snapshot, so a setting changed while the harness runs cannot make the
record differ from the run. A hold that cannot be written fails its pass with
the store error, and the next pass runs the harness again.

Holds written by the previous format never match, so each held tier runs once
more after the upgrade and holds again. The operations guide names what the
hold keys on and what releases it, and no longer says extra Go deltas hold.

The tests are the three cases the review found, on a moved base, a branch
pushed back to a refused commit and a changed generated-file rule, plus the
translation-unit cap read once per pass and each tier's inputs in the record.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes (#1552)

* loom code backfill keeps an owed edge pass across a resume

A first full backfill implies the edges-only second pass, but only while
its cursor is empty. A first backfill stopped in its index phase (a held
org, a SIGTERM, a crash) resumes with the cursor set, and a rerun after an
interrupted edge pass finds the cursor at its end: both finish, write
`git_head` and drop the pass, so the namespace's cross-file references
stay unbound and nothing says so.

The run now records why it owes the pass (`first-backfill`, or
`requested` for `--edges-second-pass`) under
`backfill_edges_owed:index<suffix>` before its first batch, and clears the
record once the pass is done. A resumed run or a rerun reads the record and
runs the pass; `--no-edges-second-pass` declines it and clears the record.
A `--paths-file` repair records nothing, as before.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom runs a parsed command through one entry, dispatch.run_parsed

A command's context is bound in two places: `main` wires the process's
seams, and `_dispatch` binds the traffic class, the query tag, the actor
and the org the command bills. A second process that runs a share of a
command's work needs exactly that, so it is one function now,
`run_parsed(args)`, in its own module, `server/cli/dispatch.py`, with
`_dispatch`. `app.main` parses and calls it. A family module may import
`dispatch` without importing `app`, so the package's one-way import rule
holds. Nothing a command does changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill runs its batches through one run, cut at the header/source boundary

The index phase's reader and ingest and the edge pass's ingest move from
closures in `_backfill` and `_second_edge_pass` into `_Run`, built once
from the entry, the head, the embedder and the denylist; a batch of either
pass is a method on it. The code is the closures' code, reading its fields
from `self`.

`_cursor_batches` hands out the batches with their first index. The
headers `headers_first` puts first end their own batch, so no batch holds
both a header and a source and every header can be written before any
source batch starts. A resumed run starts at its cursor wherever an
earlier build cut.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* loom code backfill --workers N indexes and runs the edge pass in N processes

One backfill process parses and extracts at about one core, whatever
--concurrency says: every tree-sitter parse holds the interpreter lock and
runs one at a time per process, and the extraction after it walks the tree
in Python. A tree does not pickle and a file's extraction reads the index
between its steps, so a worker takes a whole cursor batch: its own
connection, reads, parse, extraction and writes.

A worker is the command itself. The parent starts N spawned processes on
its own parsed arguments; each enters through dispatch.run_parsed, as
`loom` does, so it runs under every binding the command runs under: the
background traffic class, the cli.code.backfill query tag and operation,
the org it bills, logging, telemetry, SIGTERM and Ctrl-C handling, the
wired seams, the model-work admission and the registry read. `_backfill`
then serves the batches it is sent instead of walking the tree, each
awaited in the command's own task. One pipe per worker carries its batches
and their counters; nothing crosses but paths, counters and the reason a
batch was held.

The parent hands a worker its next batch when the worker reports its
last, so once a batch is held nothing more starts, and the batches still
running are counted. The cursor moves past a batch once every earlier one
is written. The header batches are all written before the first source
batch is handed out. A worker caches what it reads of the index (header
texts, the import resolver's live path set, layouts and listings), and
another worker's writes do not reach those caches, so it forgets them when
it moves to the sources and to the edge pass, which therefore reads the
finished index. The edge pass forgets them in one process too: the Go
listing and the other resolver caches outlived the index phase by up to
their TTL, so the pass did not re-derive what it claimed to. The same
workers serve both passes, admitted once, as the parent is.

A run whose workers wrote batches side by side owes the edge pass whatever
the flags say, recorded as `workers`: a file there resolved against what
its worker had read while the others were still writing. `--paths-file`
and `--no-edges-second-pass` runs with --workers run it, and a later
backfill that finds it owed runs it.

Stopping: a closing pipe cancels the worker's command task, as its own
SIGTERM or Ctrl-C does, so a stop of the parent, of the worker or of the
whole process group unwinds through the batch before the worker retires.
The parent closes the pipes when the run ends, fails or is cancelled, and
a killed parent closes them too. The parent reads every exit code: a
worker that exits before its run opened, in a batch (named with its first
index, and with the signal when one killed it), or on close (a failed
drain or retirement) fails the command; on close only after the command
has written its own end of the run, as one process retires after its
command returns. --workers is refused below 1 and with --phase embed, and
no more workers start than a pass has batches. --workers 1, the default,
keeps one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep the edge pass owed when a pass ends with errors

A worker's edge batch can return with errors when a file write fails.
The owed record now clears only when the pass reports none, so a resume
runs the pass again. The test fails an edge write in a two-worker run
and resumes in one process.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Index embed-excluded paths without a description or a vector (#1564)

* Index embed-excluded paths without a description or a vector

A repository entry's `embed_exclude` globs (`LOOM_CODE_EMBED_EXCLUDE` for
the scalar entry, the `exclude` glob semantics) keep a path in the index:
it is chunked, its symbols, edges and test map are derived, and code.search
reaches its chunks through the lexical leg. Its new chunks are neither
described nor embedded, in the file ingest and in the round's prefetch, and
`loom code describe` leaves them alone. The rows carry
`unembedded by design: embed_exclude`.

Embed recovery and the coverage counts now match the shared prefix
`unembedded by design`, so reference fixtures and embed-excluded chunks
are neither stubs to fill nor counted in the embeddable denominator. Rows
already stored under the reference marker match it unchanged.

Test files are often a large share of a repository's chunks; this lets an
operator spend the embedder on source and reach tests from the source hit
through the test map.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep unembedded-by-design chunks without a vector in reembed

`loom code reembed` copies a row that carries the `unembedded by design` marker under the second label with its marker and no vector, so an embed-excluded path or a reference fixture is not embedded there and that label's recovery leaves it alone.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Keep every vector and description writer off embed-excluded paths

The provider rebuild embedded every live `code_chunks` row and cleared
`embed_last_error`, so a staged embedder switch gave embed-excluded chunks
and reference fixtures a vector and erased their marker. It now stages a
row marked unembedded by design without a vector and keeps the marker.

The `code_summary` pass wrote an LLM card and a card vector for an
embed-excluded file, and could carry a twin's card across models. It now
takes the entry's `embed_exclude` globs (`denylist_for`), writes and carries
no card for a matching file, and clears a card written before the glob: the
row keeps its rank and carries the marker, so recovery and the card leg of
code.search skip it. Removing the glob lets the next pass write the card.

`unembedded_by_design` is the one predicate the Python writers read the
marker with. A test discovers every code-plane module that calls an
embedder or an LLM and fails until a new one is declared as a writer gated
on the marker or the globs, or as a query-side reader; the round prefetch
filter, the describe skip and the marker precedence get their own tests.
`ReembedStats.rows_unembedded` had no reader and is dropped.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Resolve the ingest denylist once per file

`ingest_file` resolved `default_denylist()` in `_refused` and again for the
embed rule; it now resolves it once and passes it down. The chunk stage's
`embed_excluded` has its one caller pass it, and the marker choice reads as
one expression.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Document embed_exclude on a changed glob, a rollback and self-service entries

The operations guide states what a changed glob does: adding one leaves
existing vectors until a chunk changes, and removing one leaves the chunks
unembedded and outside the coverage denominator, embedded again when their
content changes or when the repository is indexed into a new namespace.
`embed_exclude` applies to configured entries only. A rolling-upgrades entry
records how an older build reads the marker as a stub. The coverage
comments name both kinds of rows unembedded by design, and the setting's
comment is cut to two lines; the generated references are regenerated.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* simplify: N-1-safe marker, drop the enumeration test and the card clear

The embed_exclude marker now extends the reference fixtures' marker
(`unembedded by design: reference (embed_exclude)`), so the previous build's
recovery, backfill embed phase and coverage counts, which match
`unembedded by design: reference` as a prefix, skip it as this build's do.
The recovery and coverage reads keep main's parameter.

A test pins the reference literal, and a cross-version test checks that the
row ingest stores is skipped by the previous build's recovery predicate and by
this build's.

The code_summary pass no longer clears a card written before its file's glob:
a card, like a chunk, keeps the state it had when the glob was set. The
candidate and carry filters stay.

The model-caller enumeration test is gone: it was a closed list that every new
caller had to edit, and it passed with the ingest gate removed. The reembed,
provider rebuild and card tests move beside their existing fakes, and the
recovery parameter check already in test_code_reference_files.py stays the
only one. reembed partitions its rows in one loop and reads the column it
always selects. Rule 63 and the operations guide say what is true now.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An embed-excluded file's card goes once the file changes

The code_summary pass leaves embed-excluded paths out of its candidates, so a
card written before the path's glob was never rewritten or removed after the
file changed: code.map and the cards leg kept serving a description of the old
content.

The pass now tombstones the live card of an excluded path whose inputs_hash no
longer matches the file's content hash, a deleted file included. A card that
still matches the file stays, as before, and a rank row without a card is left
alone. The next code_graph_stats pass writes the file's rank row back. The
operations guide says the card stays until the file changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Spell the full setting name in the coverage description

code_ready_embed_coverage named embed_exclude by its suffix; it now
names code_embed_exclude, and the example file and schema follow.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Regenerate the configuration reference for the coverage description

scripts/codegen/settings_reference.py after 59fc1016f's catalog wording change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Write the graph-stats rank copy just above the card it read

The ranks leg reads a live file card, then inserts a mirror of it with the
new rank at the clock version. A tombstone or a new summary written in
between carries an earlier version than that copy, so the copy won under
FINAL and brought back a card retired meanwhile.

The copy now takes the read card's version plus one. Every other writer
takes its version from the clock, so a later tombstone or summary is
higher and wins; with no write in between the copy is still the newest
row.

The test reads a card, lets the tombstone land during the read and checks
that FINAL keeps the tombstone. It fails without the change.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The operations guide says LOOM_CODE_GIT_CA_FILE sets trust, not reach (#1580)

* The operations guide says what LOOM_CODE_GIT_CA_FILE settles and what it does not

The guide's paragraph for LOOM_CODE_GIT_CA_FILE read as if the setting made a
forge under a private authority indexable. It settles trust only: in the
repository-job sandbox the egress proxy still refuses a remote whose name
resolves to a loopback, private or link-local address, and no setting admits
one, so such a forge indexes only as an operator repository on a host without
the sandbox. The guide now says so.

It also says what the bundle applies to (every git a repository job runs, the
compiler tier's dependency fetches and submodule updates included, so the
bundle must hold the public roots when any of those reach a public host) and
that the path is not checked when the setting loads: it must be absolute and
inside the sandbox's read-only /etc/ssl, and a relative or `~/` path, or a link
leaving /etc/ssl, fails in git's own words. The "CA bundles" paragraph now
counts three bundles and says which one git uses through the proxy.

The unit test imports asyncio at the top of the module. No behaviour changes.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Name the trees the repository-job sandbox mounts for the git CA bundle

A link out of /etc/ssl can still work: the sandbox also mounts /usr and
/etc/ca-certificates read-only, so a link into /usr/share/ca-certificates
resolves to the same file. Say the target must be visible to the job and
keep /etc/ssl as the suggested location.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* The mirror sweep keeps the tier checkouts of an entry that names no producer (#1584)

* The mirror sweep keeps the tier checkouts of an entry that names no producer

`_named_paths` named `checkout_for(c, "")` for each entry. For an entry with
no `scip_producer` that is `<checkout>.`, a path no tier uses, so the
checkout of the tier its tree calls for (`<checkout>.python`,
`<checkout>.typescript`, `<checkout>.go`) was named by nothing. `_sweep_root`
removes an unnamed `checkout-*` directory older than 600 s, so a self-service
entry's tier checkout was deleted and copied again over and over. A
configured entry is unaffected unless its checkout sits under
`code_repos_root`.

Name `checkout_for(c, p)` for every producer the tiers can run, plus the
entry's `scip_extra_producers`, and for each registry row its checkout and
the sibling of every producer. `repos.sibling_checkout` holds the one
spelling of a sibling path, so the sweep and `checkout_for` cannot drift.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* Drop the clause about the removed call from the sweep comment

The comment above `checkouts` in `_named_paths` described a line the previous
commit removed. It now says what the code does.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Sweep only the named tiers of an entry that names its producer

An entry with a scip_producer runs that tier and its extras only, yet the
sweep named every tier's checkout for it, so the old checkout of a tier
removed from its extras stayed on disk until the repository went. Keep all
candidate tiers for an entry naming no producer and only the named ones
otherwise.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* The CLI embed phase republishes only when behind, once, with coverage first (#1581)

* A backfill phase republishes once, last, and only where the counts trail

With nothing pending, the embed phase declared its org and republished
whenever a `table_counts` row existed. Readers write that row: `loom code
stats` with a mistyped --org leaves a row of zeros, so the same typo on
`--phase embed` declared the org, and every idle embed run on an indexed
namespace paid the org gate, the count scans and the coverage aggregates.
It now declares only when rows are pending or the published chunk counts
differ from the chunk table. That comparison is a store read,
`CodeRepo.published_chunks_behind`, over the shared counts and the chunk
aggregate.

The index phase writes `git_head` and the backfill stamps first, then
`_close_index` compacts, records the pass and republishes last on every
exit (a full run, a run resumed at the end of its cursor, a hold, a repair,
a twin label), so the `republish` flag is gone. The cursor is cleared after
the republish, so a run interrupted while it publishes resumes at the end
and publishes then.

The republish writes the coverage row first and the counts row only once the
coverage has landed. An embed phase stopped between the two, by Ctrl-C or a
failed coverage refresh, otherwise left the counts current and the coverage
at the pre-embed vectors with a matching fingerprint, and the rerun found
nothing behind. It also reads with sequential consistency: the fingerprint
it stamps carries the `git_head` the run has just written, which the replica
serving the read may not have yet.

The tests drive `_backfill` and `_backfill_embed` against the real
`CodeRepo` over a replica that lags the run's writes, and read the rows
back.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* A refused coverage write keeps the counts behind

The CLI writes the counts row only once the coverage row has landed, but
`refresh_coverage` swallowed its own write failure, so the counts landed
anyway and the next embed phase found nothing behind. The CLI now passes
`must_land=True`, which makes the coverage write raise.

`published_chunks_behind` also reads the coverage row's embedded figure,
so current counts over a coverage row that trails the chunks still count
as behind. That state comes from vectors landing between the two writes,
or from an earlier build that published counts after a failed coverage
write.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

* An existing coverage row is compared even when the counts row is missing

When the index phase published coverage and its first counts write failed,
an embed phase that landed its last vectors and stopped before publishing
left an idle rerun reading a missing counts row as nothing to republish.
published_chunks_behind now compares the coverage row on its own.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* Show repository freshness from mirror health (#1604)

A successful mirror fetch can leave the same commit indexed for days. Use the server’s overdue-fetch flag for the badge and keep deployment worker errors in the worker diagnostics.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires (#1002)

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Recheck renewed supervisor leases after a wait expires

A confirmed renewal can extend the deadline while the previous wait resumes. Use the current freshness before stopping workers, and retain genuine expiry controls.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Scope person-query observations to the decision task

Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5ea5778042f860cadf6cebec9eebb25821)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover the review provenance default in Cell proof refusals

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

---------

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Edit context includes verified indexed forwarding targets (#1494)

* Edit context includes verified indexed forwarding targets

When one typed forwarding call resolves in the same index revision, cite the target in read_sources. Share the bounded lookup between single and batched edits and keep existing member reads independent.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Load forwarding helpers after the code modules initialize

Initialize grep and edit context in either order by loading forwarding helpers only when the optional source lookup runs.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Use scoped cursors in vector continuation fixtures

Keep the original search scope on stored cursors so the fixture exercises continuation without fresh retrieval.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bump the actions group across 1 directory with 3 updates (#1516)

* Bump the actions group across 1 directory with 3 updates

Bumps the actions group with 3 updates in the / directory: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv), [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `astral-sh/setup-uv` from 10.3.3 to 10.4.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/68559e99cc807c1eb7e9238fd43a15bba460eec2...1db35dd8eee11c5894872e0b383ae6c406cf738d)

Updates `ossf/scorecard-action` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/fa7117db83c52d787ae5a89f350999701505d78e...23f22cd43608bae7a1f1fa2603d7314dee9538a5)

Updates `github/codeql-action/upload-sarif` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.1...33d7b85da1a04171e211befe2c739303b9a4c066)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>

* Scorecard fails when the API rejects a publication

The updated action warns by default. Opt into failure on API rejection so a stale public result is visible in the workflow status.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Scorecard uploads SARIF when publishing fails

Upload the completed scan when the file exists so a publication rejection still leaves results in code scanning.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep grep excerpt bounds in the compact coding schema (#1613)

Numeric bounds in JSON Schema do not constrain string values. List the
grep context radius as an integer so its existing bounds apply while
the server still accepts and validates numeric strings.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Code read accepts same-file line pairs (#1614)

* Read same-file line pairs in one source request

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Advertise code read pair endpoints as integers

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* MCP validation errors omit rejected retry examples (#1612)

* Omit invalid retry examples from tool errors

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep retry examples faithful to supplied values

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Validate corrected arguments and keep explicit scope out of retry guidance

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Show missing-field templates only for fillable arguments

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep spelling corrections within their original argument object

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Compact SCIP replies omit documentation present in function bodies (#1617)

SCIP wraps declarations and can unquote forward references. Compare the
Python function headers and docstrings before dropping a description.
Keep any description whose declaration or documentation adds evidence.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* The assistant runs natively with caller-scoped tools (#995)

* Run the assistant natively without a bundled chat service

Own bounded streaming model turns and authenticated MCP tools in the web process. Validate citations against answer receipts and capture usage before completion. Retain external state and provisioning metadata for an approved cutover.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Use shared signing for native assistant streams

Streaming requests share endpoint resolution, credential refresh and private
header filtering with the provider transport. Cancellation joins pending
signing before the producer exits. Reuse the deployment region setting and
regenerate its settings artifacts. Verify native enablement with serving TLS.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native answers retain publication proofs through response delivery

Whole replies retain nested source-access proofs through required accounting
and response delivery. Citations use returned help anchors, and native
configuration failures remain visible in the dashboard. Retained provisioning
credentials keep their rotation coverage while replaced polling paths are removed.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native authorization fixtures use the retained evidence paths

Route fixtures bind the answer-owned MCP app. Protected ledger fixtures exercise
the pure support rule with all authorization and marked-outcome expectations kept.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Assistant fixtures follow asynchronous credential admission

Keep authorization, revocation and whole-response publication assertions on
the provisioning-aware credential boundary used by the served routes.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant evidence uses request-owned receipts

Remove unused persisted-answer query code and preserve receipt-based support
assertions. Cover configuration admission and model-alias pricing, correct
configuration documentation and bounds, and align the disabled chat fixture
with the native refusal contract.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe SQL citations using answer-owned receipts

Keep persisted query metadata separate from citation verification and remove
unused support fixtures after the polling path is retired.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native display steps use the receipt formatter

Keep step labels and protected-row rules in the shared formatter. Retain the
local-model routing and container networking guidance alongside assistant setup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Translated setup links point to the native assistant guide

Regenerate the published setup destinations when the English guide is replaced.
Keep the translated text and source stamps for the translation updater.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Keep assistant archives private and bound retained credential writes

Create converted archives exclusively with owner-only permissions and keep
credential resealing statements inside the retained provisioning lease.
Remove unused ticket and accounting state and obsolete test seams.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Retain streamed source proofs and bound help citations

Keep nested tool publication guards through final accounting and refuse citations to unread help outline sections.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Exercise the terminal publication boundary in stream delivery tests

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cover source proof loss before streamed assistant content

Exercise access changes during model generation and an awaited send while preserving final accounting and stream cleanup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Renew streamed source proofs at each HTTP send

Share retained source proofs with the HTTP request tail while keeping streamed accounting open until its terminal event. The new source-loss regressions reproduce unchecked private content before this repair.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant tests retain mirror admission and private accounting

Exercise real admission and response accounting through source activation, marked refusal, failed private delivery and repeated provider cancellation.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Clarify provider setup and failure diagnostics

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit d6675819a9447ce97f5f21e1b72747c8b1a1cd7b)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Refresh the provider architecture summary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Route the conflict judge in the single-provider recipe

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit f93385b019dc0978daa33b08392e717348c7643c)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe the dashboard model selection boundary

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a6d8a1279a4a8fe4a4eae3b170610c662b52e0b5)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound JSON encoder setup in Cell proof regression cases

Exercise each default-field refusal and JSON numeric distinction before consolidating repeated default comparisons.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 73ef63b0b7b5e65254dc2618d19c267017fed904)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit cb594d01ade7d2b883849670db9f314a46f4abc4)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compare Cell proof defaults in one canonical mapping

Keep every default-field and JSON type check while avoiding a separate encoder setup for each field.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 0bfc712dcca9684e362af47a7e924432e87e53dd)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a94d2f909a47d61532d0f6ac24aad79b09ac42b9)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Cleanup tests measure their shared idle deadline

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 4b03db4d8e5ac44d69af2146c371066907a5ec06)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Isolate retirement fixture timing in assistant qualification

Compose the reviewed retirement fixture clock so handler startup does not consume cancellation checks. Keep the original deadline and assertion bodies.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Verify assistant code citations against complete returned source

Code cards and skeletons retain original line bounds while withholding source. Require a complete unelided unit or file body with matching line bounds before verifying a code citation. Cover malformed and withheld spans while preserving full-source positives and other citation kinds.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Grep fallback tests separate deadlines from response handling

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit a909dad266915b5ad6202d8d3c7d5a16bb635bbc)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bound native gateway refusal reads before stream parsing

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 9ea1817ab4f9e5273c45666a00bf5fdd6544ec88)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Native assistant checks use receipt verdicts and caller context

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Redaction cost samples meet their CPU clock floor

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Describe assistant support from answer-owned receipts

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bedrock rejects content block indices after close

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Remove an unused citation test constant

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Grep fallback tests separate deadlines from response handling

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Compose canonical cleanup and fallback fixture controls

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Reserve assistant tool provider costs before sending

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Bind tool price reservations to text inference protocols

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* test: enforce assistant tool budget through authenticated MCP

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Prove grep fallback aborts an admitted stalled fetch

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Allow native assistant reads to select user and session rows

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Keep retained qualification state out of version control

Qualification state and JSON results can contain credentials. Keep their
three path-specific ignore patterns after removing the integration.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Check retired chat sources without traversing retained data

Qualification state and results remain external data after runtime removal.
Assert absence of each retired source while allowing retained JSON files.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Derive assistant support from successful request receipts

Failed tools withhold completion and create no receipt. Keep support tied to
return…
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Use a fixed standard runner without dependency caches or redundant report artifacts. Preserve the read-only pull-request scan and trusted default-branch SARIF publisher.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@cursor

cursor Bot commented Nov 30, 2026

Copy link
Copy Markdown

This PR is too large for Bugbot to review. It changes 37,981 lines and 3,925,972 characters. Split the change into smaller pull requests to get a review.

@zlareb1
zlareb1 merged commit 9f872f8 into main Nov 30, 2026
76 of 79 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.

8 participants