Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
7eb744b
A rename revision that lost its key's lock is tried again by a later …
zlareb1 Nov 28, 2026
e57ba3a
A plugin connection's `?mode=` is trimmed, as the plugin's hooks read it
zlareb1 Nov 28, 2026
6564c2d
A plugin connection in code mode gets no authored profile at `initial…
zlareb1 Nov 28, 2026
222594e
A plugin connection's plane has one spelling on the URL: `?mode=`
zlareb1 Nov 28, 2026
8b4bf58
A code search that abstains on its fused list names the abstain score
zlareb1 Nov 28, 2026
9084949
The `retrieval_confidence` field comment is one sentence
zlareb1 Nov 28, 2026
8a57f02
The stand-in confidence is named for both of its uses
zlareb1 Nov 28, 2026
4979166
The docs say a memory the rename pass left is taken up when its link …
zlareb1 Nov 28, 2026
44c52aa
A rename revision committed with its publication pending counts as wr…
zlareb1 Nov 28, 2026
d8ffa29
Three paragraphs of the memory concepts page are wrapped at the page'…
zlareb1 Nov 28, 2026
54925e0
The docs say what a refused rename revision costs
zlareb1 Nov 28, 2026
8f175d0
A git grep error for a list of lines names how many, not the first one
zlareb1 Nov 28, 2026
845976a
A line with a NUL byte is not one a definition is searched for by
zlareb1 Nov 28, 2026
3f2643d
The bounds of a definition's own lines are named for `own_lines`
zlareb1 Nov 28, 2026
d4400e9
The `_may_be` docstring leaves each rule to the function that holds it
zlareb1 Nov 28, 2026
6ac54a2
The `_renamed_elsewhere` docstring says what is returned
zlareb1 Nov 28, 2026
ea231c0
A range git cannot search is logged once, not for each lost definition
zlareb1 Nov 28, 2026
4d8ccf0
A test reads one range under two limits
zlareb1 Nov 28, 2026
ef744c5
The extraction page sizes the session prompt by what a test pins
zlareb1 Nov 28, 2026
399f111
Vector rows with no distance sort last and leave the rest nearest first
zlareb1 Nov 28, 2026
e7c5bab
The symbol-lookup order test says why it asserts the bound keys
zlareb1 Nov 28, 2026
f985d2f
The architecture page states the path penalties of code-search ranking
zlareb1 Nov 28, 2026
5f1b05e
The architecture page lists the definition leg among what test intent…
zlareb1 Nov 28, 2026
938ad72
The intent-length tests pin the issue-body cap they index by
zlareb1 Nov 28, 2026
9c24812
A test covers the definition leg on a long report that mentions a test
zlareb1 Nov 28, 2026
cce8ea2
The intent head is documented as the opening of the question as sent
zlareb1 Nov 28, 2026
535135b
`_intent_lexemes` says a request's extra terms do not count toward it…
zlareb1 Nov 28, 2026
d2fa3b0
The fusion signals tokenize the query once
zlareb1 Nov 28, 2026
f9343ad
The lexical leg returns its read directly
zlareb1 Nov 28, 2026
5a19d26
The round prefetch says which paths it reads file rows for
zlareb1 Nov 28, 2026
c90983d
The buffered-key selector is typed by the names it may take
zlareb1 Nov 28, 2026
4353ff0
A round's reuse read counts a statement for each hundred paths
zlareb1 Nov 28, 2026
1aa7ea0
Tests cover a file-row write and the vectors of another org or model …
zlareb1 Nov 28, 2026
2092f53
A test covers the vector read's limit across batches of paths
zlareb1 Nov 28, 2026
7ca3fc6
The worker docstrings say a batch stops the run, held or after a fail…
zlareb1 Nov 28, 2026
4418279
The recorded failure count of a backfill pass says what it adds
zlareb1 Nov 28, 2026
1d3e93d
The `write_failed` docstring reads in one pass
zlareb1 Nov 28, 2026
23f1906
The operations page names the backfill's failed writes in plainer words
zlareb1 Nov 28, 2026
18d1b76
A comment says why a backfill round is written twice
zlareb1 Nov 28, 2026
455810b
The failed-write test asserts the status row the pass records
zlareb1 Nov 28, 2026
601d00e
The rewritten-row test builds its hit from the search document's day
zlareb1 Nov 28, 2026
fd40a12
The `lead` docstring shows both forms of the day
zlareb1 Nov 28, 2026
c5eb5b3
The restore tests raise the key lock's own error
zlareb1 Nov 28, 2026
49e58be
Merge main: the plugin's one hook process and first-call instructions
zlareb1 Nov 28, 2026
4957742
The primer tests read a text with no profile after the merge of main
zlareb1 Nov 28, 2026
88321a8
A line search git cannot run is still made for the next lost definition
zlareb1 Nov 28, 2026
cd187fc
`key_write_lock` lists `KeyBusy` among its names
zlareb1 Nov 28, 2026
7d85a43
The primer docstrings say code mode reads no memory at `initialize`
zlareb1 Nov 28, 2026
a3ccebc
The `_holding` docstring names each unsearched case with its log level
zlareb1 Nov 28, 2026
02da779
A line search git cannot run for its paths alone is made once over a …
zlareb1 Nov 28, 2026
1dc9d7d
Merge main: the fix record, the plugin's shorter skill listing and th…
zlareb1 Nov 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions docs/architecture/code-index-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,12 @@ the rows (`code/domain/index/search_confidence.py`, `code/app/search/calibrate.p
into its distractor range, or, with no calibration,
`LOOM_MEMORY_SEARCH_ABSTAIN_THRESHOLD` set at or over `LOOM_LLM_RERANK_SKIP_ABOVE`.
The search reads 0.5 then too, and `calibration_explanation` says so.
- **No results.** An abstain that returns no result reads 0.0.
- **A second vector model.** The scale is the served embedder's. A request's
`vector_model` with no shortlist ranks on its own cosines, which are read on that
scale all the same, as its abstention is.
- **No vector leg to read.** An exact symbol match reads a fixed 0.95 and the history
route 0.5.
- **Not abstention.** Abstention is decided apart from the confidence, on the fused
list: its top cosine under the abstain threshold (`below_threshold`), or a
route-aware score (that cosine, its margin over the second hit, route agreement and
Expand All @@ -670,15 +676,22 @@ questions about a named identifier. An unmatched identifier does not disable
saturation. Per-symbol deduplication still removes repeated chunks of one definition,
and continuation pages retain the final served order.

For a question about the implementation, ranking multiplies the score of a test,
example, fuzzer or benchmark path by 0.35 and the score of a prose file by
`LOOM_CODE_SEARCH_PROSE_PENALTY`: such a file is ranked lower, never dropped. The prose
penalty is off for a search constrained to paths and for a symbol lookup.

A question asks for tests when it holds a test word (`test`, `pytest`, `fixture`,
`ci`), and for documentation when it holds a documentation word (`docs`, `changelog`,
`tutorial`). Test intent turns off the test-path penalty, the fan-in prior, the kind
prior and per-file saturation; documentation intent turns off the prose penalty. A
prior and per-file saturation, and lets the definition leg return a definition on a
test path; documentation intent turns off the prose penalty. A
question with more lexemes than `LOOM_CODE_SEARCH_QUERY_MAX_TOKENS` is an issue body,
where such a word names where a fault showed: a traceback path, a version listing, a
link. Only its first 16 lexemes are read for intent, which hold the title of a report
or the request a long prompt opens with. A long prompt that states its request after
that opening is ranked as a report.
or the request a long prompt opens with. They are counted in the question as sent, so a
template's headings before the title are among them. A long prompt that states its
request after that opening is ranked as a report.

### Symbol bodies

Expand Down
5 changes: 3 additions & 2 deletions docs/architecture/rolling-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,9 @@ See the [participant lifecycle baseline](cells.md#participant-lifecycle-baseline
never marks a `moved` link, and its policy step clears a mark N wrote without
revising, so a rename followed during the rollout can leave its memory's text as
written: `namespace.validate` lists the edit, as before. A link that read `moved`
before N served is never marked, so its memory's text also stays as written and
listed: no backfill marks it. The revision is a `memory.update_by_id` write, which
before N served is marked only when a recheck next rewrites it (its file changed
and its lines shifted, for one): until then its memory's text stays as written and
listed, and no backfill marks it. The revision is a `memory.update_by_id` write, which
N-1 reads as any other version. `renamed` is one more number in the pass outcome. No
gate holds the rollout.

Expand Down
77 changes: 41 additions & 36 deletions docs/concepts/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,11 @@ files and the link's own are parsed, so a removed or kept definition in a file t
none of those lines contests nothing. That search is not made for a definition with no
such line of 12 characters or more, when those files are more than 32 with the link's
own, when more than `memory_code_links_mirror_changed_files` changed (a warning in the
server log names the range), or when git cannot run or finish it, which is then not tried
again for the other links of that range in the pass; nor is a range searched whose diff
cannot be read. Over a range not searched a live link is read as if nothing was renamed.
server log names the range), or when git cannot run it or finish it in its time; nor is a
range searched whose diff cannot be read. A search git did not finish in its time, or
could not run because the paths of those files are more than it takes in one command, is
not tried again for the other links of that range in the pass: the files are the same
for each. Over a range not searched a live link is read as if nothing was renamed.
An `unresolved` link is looked for from the commit its code was last read at, so its
range grows with every commit. While that range is within 32 files, the link is followed
once one definition that may be it is left. A wider range is read only where its lines
Expand Down Expand Up @@ -547,18 +549,17 @@ at. When its old text is gone from git, a link that matched it takes the text th
check finds and a changed one stays `changed`; one whose old text no longer parses keeps
its last state, and the worker reports it.

After a rename a memory's text still says the old name until it is revised, by the
link pass where the swap is certain ([below](#a-memorys-text-after-a-rename)) or by a
person. Until then the reads that serve its links (listed below, `namespace.validate`
apart) name where the code is now. A link that is `fresh`, `moved` or `changed` at another path or symbol than
the memory was written against is served with both: the current `path`, `symbol`,
`start_line` and `end_line` (trunk's, at the link's last check), and `was_path` and
`was_symbol`, the oldest of the identities the link keeps (its last 16; a claim the
`revise` policy found to hold is re-anchored where the code is and still carries them).
A link to a file carries the path it was written against and no lines. A definition
renamed back to its first name carries neither, nor does an `unresolved` or `missing`
link, nor a link to a definition that replaced a link to its file. In text the line
reads
After a rename a memory's text still says the old name until it is revised, by the link
pass where the swap is certain ([below](#a-memorys-text-after-a-rename)) or by a person.
Until then the reads that serve its links (listed below, `namespace.validate` apart) name
where the code is now. A link that is `fresh`, `moved` or `changed` at another path or
symbol than the memory was written against is served with both: the current `path`,
`symbol`, `start_line` and `end_line` (trunk's, at the link's last check), and `was_path`
and `was_symbol`, the oldest of the identities the link keeps (its last 16; a claim the
`revise` policy found to hold is re-anchored where the code is and still carries them). A
link to a file carries the path it was written against and no lines. A definition renamed
back to its first name carries neither, nor does an `unresolved` or `missing` link, nor a
link to a definition that replaced a link to its file. In text the line reads
``(code moved: `reader::fetch_rows` is now `reader::load_rows` at src/reader.py:12-40)``;
a line whose code also changed keeps its warning and adds the same clause. A line names
two such links and counts the rest. Naming the place moves no result: a `moved` memory
Expand Down Expand Up @@ -751,13 +752,16 @@ and applies them itself when all of these hold:
The revision is one `memory.update_by_id` write on the hash of the text the edits were
planned for, so a memory rewritten in the meantime is left alone. The write reads the
memory again under its key's lock, and one pinned, verified, attested or no longer
`active` since the pass read it keeps its text. It runs that write's
blacklist and conflict checks, embeds the new text and closes the facts the old value
stated, as any revision does. Nobody asked for it, so it changes that memory alone. It is
not written where a caller's revision would do more: the conflict check finds the revised
text a duplicate, a restatement, a refinement or a contradiction of another memory, or
the conflict resolver would judge it against one. It also retires no other row of the
same key. Such a memory keeps its text and is listed with its `edits`.
`active` since the pass read it keeps its text. A revision that fails, or that another
conditional write kept from the key's lock, is tried again by a later pass. It runs that
write's blacklist and conflict checks, embeds the new text and closes the facts the old
value stated, as any revision does. Nobody asked for it, so it changes that memory alone.
It is not written where a caller's revision would do more: the conflict check finds the
revised text a duplicate, a restatement, a refinement or a contradiction of another
memory, or the conflict resolver would judge it against one. It also retires no other row
of the same key. Such a memory keeps its text and is listed with its `edits`. The conflict
check runs on the new text's embedding, so a revision refused there has cost its writer
one embedding call, each time the pass takes the memory up.

The new version stays its writer's row (`actor` is kept) and leaves an audit row by
`process:code_rename` and a `memory.revised` event; `memory.history` keeps the text it
Expand All @@ -780,10 +784,12 @@ counted in Unicode code points of the text, where the text reads `old`) and the
the link pass left (held outside the repository's code namespace, held by a person,
attested, flagged `conflicted`, in a repository indexed on more than one branch, or
close to another memory once revised) or has not reached yet. The
pass decides once, when its link follows the rename: a memory it left then is not
revised later, and neither is one whose link already read `moved` under a build that
revises no text ([rule 67](../architecture/rolling-upgrades.md#the-rules)). Those stay
listed until a principal applies the edit. The report writes nothing: to apply an edit,
pass decides when a link follows the rename, and again each time a later recheck
rewrites that link while it reads `moved` (its file changed and its lines shifted, for
one). A memory it left, or one whose link already read `moved` under a build that
revises no text ([rule 67](../architecture/rolling-upgrades.md#the-rules)), is taken
up again then and revised if nothing holds it any more. Until then it stays listed, and
a principal may apply the edit. The report writes nothing: to apply an edit,
read the sentence it changes, then call `memory.update` on the key with the revised text and
`if_match_sha256` set to the listed hash. That is a revision by the caller, with its
conflict check, and it is refused when the memory changed after the report read it. The
Expand Down Expand Up @@ -815,16 +821,15 @@ first of these reasons that applies:
| `would_unlink` | would lose a link once revised: the new name is not one definition on the indexed trunk, or the revised text no longer names a definition or file it is linked to. |

A memory whose text names no old name or path is not listed, whatever its links, key, tags
and `files` say: its bare name still holds after a move, or the link is back where the text
says. A sentence ends after `.`, `!` or `?` and a space (not after a one-letter abbreviation
such as `e.g.`), at a blank line and before a list item; a line break alone does not end
one. The words that mark a sentence as
being about the name are English, and `call` or `calls` is not one: it is read as calling
the code. The finding reads the 2,000 memories whose `moved` link was last checked (of
those under `keys` when given), in the repositories the caller may read, and no
high-sensitivity memory; a link whose code also changed is listed under `code_links_stale`. Neither the
memory's key, tags, `files`, entities and concepts nor a line number written in its text
is edited.
and `files` say: its bare name still holds after a move, or the link is back where the
text says. A sentence ends after `.`, `!` or `?` and a space (not after a one-letter
abbreviation such as `e.g.`), at a blank line and before a list item; a line break alone
does not end one. The words that mark a sentence as being about the name are English, and
`call` or `calls` is not one: it is read as calling the code. The finding reads the 2,000
memories whose `moved` link was last checked (of those under `keys` when given), in the
repositories the caller may read, and no high-sensitivity memory; a link whose code also
changed is listed under `code_links_stale`. Neither the memory's key, tags, `files`,
entities and concepts nor a line number written in its text is edited.

## Time

Expand Down
6 changes: 3 additions & 3 deletions docs/features/memory/extraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ a release changed is kept; whether its CI was green at the time is dropped.

A plugin's session capture (a `source:` tag) is extracted with a prompt of its own, at
every capture size. It holds no conversation rule or example, and is under 9,000
characters where the conversation prompt is about 57,000 for a short input and 86,000 for
a longer one, because most captures hold nothing to keep and the prompt is then what the
call costs. A session that made a tested change is sent about 1,200 characters more (the
characters, less than a sixth of the conversation prompt for an input of either size,
because most captures hold nothing to keep and the prompt is then what the call costs. A
session that made a tested change is sent about 1,200 characters more (the
[fix record](#the-fix-record) rules). What the user states that holds beyond the session is kept: a standing rule, a
preference, a decision, a fact about their setup. What the user asks for the task alone is
not. Its schema asks for the fields a coding fact uses and for the end of a state the user
Expand Down
6 changes: 3 additions & 3 deletions docs/operations/code-index-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ docker exec loom-workers loom code backfill-prs --namespace code-myrepo --org ac
once the pass is done, so a resumed run, or a rerun after an interrupted pass, still
runs it. `--dialect-folder-pass` lets SQL files of undecided dialect take the dialect
their directory agrees on.
- A failed insert of the rows the index phase indexed, for example one that ran past
- A failed insert of rows the index phase buffered, for example one that ran past
`LOOM_CH_TIMEOUT_WRITE_S`, stops the run. The round of files that write belongs to
finishes, no later round or batch starts (under `--workers`, the batches already
running beside it finish), no watermark is written, and the command exits 1. Its last
Expand All @@ -296,8 +296,8 @@ docker exec loom-workers loom code backfill-prs --namespace code-myrepo --org ac
exits 0 with up to 1% of its files failing, a smaller run with none. The record of a
file over `LOOM_CODE_INGEST_MAX_FILE_BYTES` is written on its own, and a failure there
is that file's error. Any other failed write ends the command with the error itself
and no such lines: the write that closes a round a held model call or a signal had
already stopped, a cursor or watermark write, and the insert of
and no such lines: the closing write of a round that a held model call or a signal
had already stopped, a cursor or watermark write, and the insert of
`--dialect-folder-pass`.
- `backfill-prs` loads merged-PR history from GitHub, resumable by cursor and bounded by
GitHub's rate limit (`LOOM_CODE_PR_BACKFILL_MONTHS`, default 12). `backfill-reviews`
Expand Down
12 changes: 7 additions & 5 deletions docs/reference/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ Query parameters on the URL select what `tools/list` shows for that connection:
plane, for a plugin installed in that mode. `memory` lists the toolset without
its `code.*` tools and loads none up front. `code` lists the `code.*` tools
alone, with the repository header or without it, and no prompt and no
resource. The startup paragraph says that plane's sentence. `both`, any other
value, and a `mode` beside another profile change nothing. The lists follow
the URL alone, so a shared cache may keep them.
resource. The startup paragraph says that plane's sentence, and in `code` it is
the whole of the instructions: the caller's authored profile is not read. The
value is trimmed and read in any case. `both`, any other value, and a `mode`
beside another profile change nothing. The lists follow the URL alone, so a
shared cache may keep them.

Compact coding connections describe the common source workflows in the
startup instructions. Find the other tools through discovery. When the `coding`
Expand Down Expand Up @@ -115,8 +117,8 @@ Coding connections describe implicit code and memory scopes as defaults in
`initialize` and `server/discover`. The routing text can be reused across
sessions with different default bindings. When a call needs a namespace
argument, the instructions name the available namespaces. Authored profiles
remain in the instructions. Usage hints are available in tool results and
through `mentor.brief`.
remain in the instructions, except on a plugin connection in code mode. Usage
hints are available in tool results and through `mentor.brief`.

Methods served: `initialize`, `notifications/initialized`,
`notifications/cancelled`, `ping`, `tools/list`, `tools/call`, `prompts/list`,
Expand Down
9 changes: 7 additions & 2 deletions server/cli/code_backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def unwritten(counters: dict[str, int]) -> dict[str, int]:


def write_failed(counters: dict[str, int]) -> str:
"""Why a batch a failed write left rows out of stops its run, "" when none did."""
"""The reason a batch stops its run when a failed write left rows out of it, else
""."""
return "a write failed" if unwritten(counters) else ""


Expand Down Expand Up @@ -722,7 +723,8 @@ async def _close_index(
started=started,
done=counters["files"],
rows_written=counters["chunks"] + counters["symbols"] + counters["edges"],
# A row a failed write left out is a failure of the pass, as a file's error is.
# A row a failed write left out is a failure of the pass, as a file's error is:
# the number adds failed files and rows left out.
errors=counters["errors"] + sum(unwritten(counters).values()),
counters=counters,
phase="index",
Expand Down Expand Up @@ -852,6 +854,9 @@ async def _backfill_batch_rounds(
await gather_or_cancel(
*(one(reads, p, sources[p]) for p in rnd if p in sources)
)
# Written here so a failure is printed and counted. `__aexit__` then
# finds nothing buffered; after a hold or a cancellation it is the
# only write, and its failure ends the command.
try:
await reads.flush()
except Exception as e: # noqa: BLE001 — counted below; the run reports it
Expand Down
Loading
Loading