Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
79d54bb
docs: plan use guidance for retrieved knowledge
krishnadobhal Nov 25, 2026
180ecb6
feat: return revision-bound use guidance on knowledge reads
krishnadobhal Nov 25, 2026
f9112db
feat: show suggested use on dashboard search results
krishnadobhal Nov 25, 2026
e78e001
fix: bind retrieval guidance to the content served
krishnadobhal Nov 26, 2026
1a7cac6
Merge upstream main into retrieved use guidance
krishnadobhal Nov 26, 2026
c38e7b2
fix: honor procedure status and preserve authorized search totals
krishnadobhal Nov 26, 2026
b97a8b2
fix: preserve historical paging and bind retrieval guidance to served…
krishnadobhal Nov 26, 2026
cd4749b
Merge upstream main and fix historical search continuation
krishnadobhal Nov 26, 2026
89afa78
fix: preserve narrowed search pages and mirror TTL by stored digest
krishnadobhal Nov 26, 2026
7448894
fix: enforce historical expiry and preserve hashless TTL updates
krishnadobhal Nov 26, 2026
3588b51
Recalibrate search after guidance removes hits
krishnadobhal Nov 26, 2026
49ed545
Keep belief support for retained search hits
krishnadobhal Nov 26, 2026
3f324c9
Count belief support for exact search keys
krishnadobhal Nov 26, 2026
cbe0921
Merge upstream main for the caller lesson changes
krishnadobhal Nov 26, 2026
e9899c1
Preserve guidance and lesson fields on retrieval
krishnadobhal Nov 26, 2026
69ef6bc
Keep complete decision statements without a digest
krishnadobhal Nov 26, 2026
43a91ac
Keep retrieval guidance tied to the served row
krishnadobhal Nov 26, 2026
acf18cc
Return pack guidance only for complete citations
krishnadobhal Nov 26, 2026
c9e186b
Keep retrieved guidance tied to verified evidence
krishnadobhal Nov 27, 2026
51503a2
Preserve Unicode run counts in procedure guidance
krishnadobhal Nov 27, 2026
5452f04
Keep search and dashboard actions tied to the selected row
krishnadobhal Nov 27, 2026
1791fc3
Restore focus to the originating memory row
krishnadobhal Nov 27, 2026
b4bf9f7
Merge upstream main into retrieved use guidance
krishnadobhal Nov 27, 2026
1626055
Restore the inspected writer on browser history traversal
krishnadobhal Nov 27, 2026
46b64df
Merge upstream main into retrieved use guidance
krishnadobhal Nov 27, 2026
a048a2e
Honor field projection when serializing search writers
krishnadobhal Nov 27, 2026
769426b
Keep search guidance bound to current evidence
krishnadobhal Nov 27, 2026
794256d
Hide the matched-text label when search omits excerpts
krishnadobhal Nov 27, 2026
e1776c5
Merge upstream main into retrieved use guidance
krishnadobhal Nov 27, 2026
4b3575d
Verify legacy search writers and code freshness
krishnadobhal Nov 27, 2026
77e7462
The reach manifest counts memory.delete_version as called by the dash…
krishnadobhal Nov 27, 2026
43f92de
A search card's preview lookup advances by the rows the server returned
krishnadobhal Nov 27, 2026
6977c2c
A legacy hit's writer lookup sends the pinned user and never a refuse…
krishnadobhal Nov 27, 2026
a53adc3
Recall Lab names a legacy ranked hit's writer before it merges with t…
krishnadobhal Nov 27, 2026
1f85cf9
Biome formatting of the search lookups and their tests
krishnadobhal Nov 27, 2026
62f8683
Positive code guidance needs evidence that the head's recheck pass sa…
krishnadobhal Nov 27, 2026
0f97243
A link inserted while a recheck may have missed it is parked and rech…
krishnadobhal Nov 27, 2026
ebc0137
Merge upstream main into retrieved use guidance
krishnadobhal Nov 28, 2026
397c1c6
A link is parked pending before the fence reads and promoted only whe…
krishnadobhal Nov 28, 2026
fb064d0
Recall Lab draws its rows first and names a legacy hit's writer after…
krishnadobhal Nov 28, 2026
536a9a1
Recall Lab's writer patch keeps a cleared row list cleared
krishnadobhal Nov 28, 2026
b5b5a84
A parked page's plain lines are checked with the head's guidance evid…
krishnadobhal Nov 28, 2026
c4986ac
A promoted code link is parked again when a recheck pass moved in aft…
krishnadobhal Nov 28, 2026
686257a
Recall Lab keeps a legacy hit that another writer's keyword row of th…
krishnadobhal Nov 28, 2026
12ab289
A memory list page says how many rows it read before the authority dr…
krishnadobhal Nov 28, 2026
d2c91d0
Search lookups page by rows read, send an end-user token no user, and…
krishnadobhal Nov 28, 2026
81fcc99
The list-fields test counts the fifteen fields the page names and ski…
krishnadobhal Nov 28, 2026
de44f4f
Merge upstream main into retrieved use guidance
krishnadobhal Nov 28, 2026
7a854c2
A file link beside a stale pending move is kept with it
krishnadobhal Nov 28, 2026
21e7ea2
A score-sorted list page says how many rows it read, and a page readi…
krishnadobhal Nov 28, 2026
c3e71b9
A lesson served from trunk's state because the branch was unreadable …
krishnadobhal Nov 28, 2026
a4b986c
A parked search hit drops the change commit cached on page one when i…
krishnadobhal Nov 28, 2026
573d595
A link writer inserts under the repository's recheck lease at the hea…
krishnadobhal Nov 28, 2026
d39ef19
The Python SDK search hit carries version_text
krishnadobhal Nov 28, 2026
7a58b6a
Lessons served from trunk show an unknown code state, not a positive one
krishnadobhal Nov 28, 2026
9093221
A parked search hit drops the moved links it cached
krishnadobhal Nov 28, 2026
6dea395
A busy repository no longer stalls the links of the others in a batch
krishnadobhal Nov 28, 2026
7ea1857
A pass at an unchanged head rechecks links an older build inserted be…
krishnadobhal Nov 28, 2026
a688f3f
The recheck and rolling-upgrade pages describe the link fence in plai…
krishnadobhal Nov 28, 2026
6702cb0
A recheck of lost links leaves the catch-up digest unchanged
krishnadobhal Nov 28, 2026
a03b9a5
The catch-up never adopts a digest for links it has not rechecked, an…
krishnadobhal Nov 28, 2026
099a3e2
The link catch-up and guidance use the insert time ClickHouse stamps …
krishnadobhal Nov 28, 2026
9a0357c
schema.sql carries memory_code_links.inserted_at
krishnadobhal Nov 28, 2026
7ec4e18
The link catch-up and guidance overlap by the stamp-to-commit gap
krishnadobhal Nov 28, 2026
07c7839
The stamp-margin test calls guidance and pins the boundary
krishnadobhal Nov 28, 2026
3e9a043
Guidance trusts a link by the row it classified, not by a second lookup
krishnadobhal Nov 28, 2026
0b70710
A code lesson keeps the links its code moved to
krishnadobhal Nov 28, 2026
f74754a
Recall Lab keeps a legacy hit's score on the keyword row it resolves to
krishnadobhal Nov 28, 2026
67950fe
Recall Lab moves a ranked hit onto a keyword row only for the same re…
krishnadobhal Nov 28, 2026
34bd675
Guidance docstring says a missing catch-up read leaves links at the h…
krishnadobhal Nov 28, 2026
6b541ef
Merge upstream main into retrieved use guidance
krishnadobhal Nov 28, 2026
1a333f1
Recall Lab merges a ranked hit into a keyword row only when both revi…
krishnadobhal Nov 29, 2026
53f40cd
Merge upstream main into retrieved use guidance
krishnadobhal Nov 29, 2026
0a4895f
Merge upstream main into retrieved use guidance
krishnadobhal Nov 29, 2026
dcda059
The code link insert-stamp migration takes number 118
krishnadobhal Nov 29, 2026
6e8c49f
Remove the root work plan
krishnadobhal Nov 29, 2026
069a49d
Recall Lab shows a ranked hit beside a row of another revision as pre…
krishnadobhal Nov 29, 2026
ccb40d5
A search reads the previews of unseen hits four at a time
krishnadobhal Nov 29, 2026
4de9ed7
A narrowed caller's source-changed marker is checked against the sour…
krishnadobhal Nov 29, 2026
3f7d499
A code lesson keeps its revision and first-written time
krishnadobhal Nov 29, 2026
2c54889
The reviewed-body test binds the hit to the head version it serves
krishnadobhal Nov 29, 2026
7986628
The column inventory records inserted_at as filled by the DDL only
krishnadobhal Nov 29, 2026
fdcb8c7
The narrowed source-guidance test binds a real own_user read scope
krishnadobhal Nov 29, 2026
878b15d
The Memories list asks for version_text only, and the ranked-row fixt…
krishnadobhal Nov 29, 2026
694673b
Positive code guidance rests on a per-link covered flag, not on an in…
krishnadobhal Nov 29, 2026
2787db6
The catch-up leaves dropped links dropped and links checked past the …
krishnadobhal Nov 29, 2026
1e66002
Covered links count only on the checkpoint's history, and a link chec…
krishnadobhal Nov 29, 2026
18dd236
A full recheck covers the links that did not move, and the history re…
krishnadobhal Nov 29, 2026
ea97dda
The follow-without-range test pins each guard of the covering
krishnadobhal Nov 29, 2026
65e7644
Merge remote-tracking branch 'upstream/main' into merge/1510-upstream
krishnadobhal Nov 29, 2026
11c081e
Guidance reads check link history only for links that could serve, wi…
krishnadobhal Nov 30, 2026
d2c9102
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Nov 30, 2026
79063d4
Merge remote-tracking branch 'upstream/main' into feat/retrieved-use-…
krishnadobhal Nov 30, 2026
3709f7f
Guidance history reads end before search's own budget and skip a memo…
krishnadobhal Nov 30, 2026
0801ea4
Guidance code states narrow each namespace's checkpoint to a proof on…
krishnadobhal Nov 30, 2026
c29ada9
Guidance confirms the indexed head again after its ancestry reads, so…
krishnadobhal Nov 30, 2026
36f28f3
A list read that ends on an empty truncated page is incomplete, so a …
krishnadobhal Nov 30, 2026
1b7ecf6
Guidance re-reads the indexed head whenever it waited on git, so a ti…
krishnadobhal Nov 30, 2026
2006a33
A truncated list page never ends the read as complete, so the search …
krishnadobhal Nov 30, 2026
a8cd4c1
Guidance candidate selection and evidence line labels are their own h…
krishnadobhal Nov 30, 2026
fdc691f
A writer lookup that sees the namespace version change between pages …
krishnadobhal Dec 1, 2026
74d2ed6
Merge upstream main into the retrieved-use guidance branch
krishnadobhal Dec 1, 2026
45d6c87
A row from another owned namespace reaches guidance only while its Po…
krishnadobhal Dec 1, 2026
92958d2
A list page names a namespace version only when no write landed while…
krishnadobhal Dec 1, 2026
91379cd
The list namespace_version comment names the write-during-read case
krishnadobhal Dec 1, 2026
66e7432
The head check of the other namespaces' rows runs under their time bo…
krishnadobhal Dec 1, 2026
9eeebae
A list page with no namespace version never counts as stable
krishnadobhal Dec 1, 2026
3252833
A fallback to trunk's link state keeps the recorded code state and ho…
krishnadobhal Dec 1, 2026
db8d223
The memories search test file follows the Biome format
krishnadobhal Dec 1, 2026
08f733e
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Dec 1, 2026
4ba835c
A search preview and a writer lookup name a row only from a list read…
krishnadobhal Dec 1, 2026
981ac03
A search preview matches list entries in the namespace the list was r…
krishnadobhal Dec 1, 2026
2337ea9
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Dec 1, 2026
8bef618
A search preview keeps its namespace, and a hit with no writer opens …
krishnadobhal Dec 1, 2026
24198c6
A parked page of an older build expires when a tail hit is withheld
krishnadobhal Dec 1, 2026
560a409
A tier hit takes the head's review only for the body it served
krishnadobhal Dec 1, 2026
83a13af
Merge remote-tracking branch 'upstream/main' into feat/retrieved-use-…
krishnadobhal Dec 2, 2026
f5c0670
An older parked page expires when a namespace it recorded lost access
krishnadobhal Dec 2, 2026
4b8cf1e
Merge remote-tracking branch 'upstream/main' into feat/retrieved-use-…
krishnadobhal Dec 2, 2026
18c511c
A search cursor with no first-page scope expires
krishnadobhal Dec 2, 2026
24c4c13
A ranked preview from another namespace opens and acts in its own
krishnadobhal Dec 2, 2026
a37c937
Only the opened row is active when two namespaces hold the same row i…
krishnadobhal Dec 2, 2026
723a055
A ranked preview test names the namespace version a complete writer l…
krishnadobhal Dec 2, 2026
31df0d2
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Dec 2, 2026
f236277
A parked-page test builds a cursor with a first_page_scope
krishnadobhal Dec 2, 2026
caad1a7
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Dec 2, 2026
9afd536
A hit that names no writer is held by a row of its own namespace only…
krishnadobhal Dec 2, 2026
b21fb9d
A ranked hit that names less than its writer is resolved in its own n…
krishnadobhal Dec 2, 2026
bc73161
A ranked hit that names less than its writer commits its ranking once…
krishnadobhal Dec 2, 2026
7d14001
A ranked search shows the hits it already holds at once and keeps ran…
krishnadobhal Dec 2, 2026
7adbd0a
A ranked search shows neither no matches nor the low-confidence note …
krishnadobhal Dec 2, 2026
8d34747
Merge remote-tracking branch 'upstream/main' into feat/retrieved-use-…
krishnadobhal Dec 2, 2026
7764c1e
The memory stack drops a pinned or recent row whose validity has ended
krishnadobhal Dec 2, 2026
b741d21
A ranked preview from another namespace shows its own conflict status
krishnadobhal Dec 2, 2026
a44e835
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Dec 2, 2026
7c39cdd
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Dec 2, 2026
3b0af47
Merge upstream/main into feat/retrieved-use-guidance
krishnadobhal Dec 2, 2026
33b581b
Merge remote-tracking branch 'upstream/main' into feat/retrieved-use-…
krishnadobhal Dec 2, 2026
4a22cc9
Recall Lab asks the writer lookup about every legacy hit, so a key he…
krishnadobhal Dec 2, 2026
a5b30e1
A parked shared hit is kept only while its head is current, unexpired…
krishnadobhal Dec 2, 2026
9e9d84f
A parked shared hit's served digest is recorded on the live pass, so …
krishnadobhal Dec 2, 2026
b482833
A live shared hit is kept, without the head's guidance, when a newer …
krishnadobhal Dec 2, 2026
9f11354
A ranked preview's Conflicted badge reads its own status in every nam…
krishnadobhal Dec 2, 2026
788cece
Merge remote-tracking branch 'upstream/main' into feat/retrieved-use-…
krishnadobhal Dec 3, 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
49 changes: 49 additions & 0 deletions docs/architecture/code-index-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,55 @@ ranged `next` read. HTTP and MCP preserve that omission. Enclosing-body lookups
unavailable text, and verification cannot use an unread body as negative evidence.
No source text is fetched from a network or fabricated to fill a gap.

## Memory links written during a recheck

A recheck pass follows a repository's links from its checked head to its indexed head
under the repository's lease. A writer that links a memory inserts its links under the
same lease, so a pass that starts after the insert reads the new links.

A pass can run before the writer takes the lease and check a head the writer's links
were not built at. The writer then finds the indexed head moved and inserts nothing. It
parks that repository's memories behind the `*` marker, inserts the other repositories
of the batch and moves the queue cursor on. The pending scan, which runs under the
lease, links the parked memories at its own head. A writer that finds the lease held
does the same. No link is stored in a state that waits for a pass, and the read side
trusts a link only when the checked head is the indexed head.

The indexed head and every read a pass makes of the links run under
`sequential_reads()`, so the pass sees a head another replica indexed and a link another
replica inserted under the lease. That holds when state writes are visible to a
sequential read, which `loom doctor` checks through `select_sequential_consistency`.

A build without the lease, such as the previous build during a rolling upgrade, can
insert a link built at an older commit after a pass read the table, however long its
insert takes. Each link row has a `covered` flag. A writer that holds the lease inserts
its links covered, because the pass that follows sees them. A recheck writes every link
it moves or finds unchanged covered. A row from the previous build is not covered.

The catch-up (`_catch_up`) rechecks every live link that is not covered and not checked
at the head, from its own checked commit, and writes it covered. It reads a page of
`memory_code_links_batch` links in key order per pass and keeps its place in the `seen/`
cursor, which it clears after the last page. A lost link keeps its commit and is
rechecked once. A link on a file that does not parse stays uncovered and is retried.

The read side trusts a link only if it is checked at the checked head or covered at a
commit in the checked head's history. Any other row, such as a late insert from the
previous build or a covered row from a tip the branch was rewound past, reads as unknown
until the next pass covers it. The checkpoint and the links are read together under
`sequential_reads()`, so a lagging replica cannot show an old link against a newer
checkpoint.

A covered link at an older commit needs one `git merge-base --is-ancestor` to prove that
commit is on the checkpoint's history. A read runs those checks only for a memory that
could still serve positive guidance: a fresh or moved state, a checkpoint that is the
indexed head, and no link owed a path recheck. If any link of a memory fails that, none of
its links is checked. One request checks at most 8 distinct (repository, commit) pairs,
four at a time, under one 0.1 second deadline, inside the 0.2 second budget search gives
guidance. A pair over the cap is never started, and a running pair is cancelled at the
deadline. Both read as unknown, so a slow mirror never turns a link positive and never
costs the memories that were checked at the head. The indexed head is read again after the
ancestry checks, and a namespace whose head moved meanwhile reads as unknown.

## Invariants

- A code namespace is one branch; every `code_*` row is keyed by `(org, namespace)`.
Expand Down
10 changes: 10 additions & 0 deletions docs/architecture/rolling-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,16 @@ remaps a scratch restore target into the deployment client. Both paths fence all
historical connection keys and verify physical owner-history deletion. Complete the
separate mirror-content cleanup before serving; this account procedure does not replace it.

### Memory links written during a recheck

Migration `120_memory_code_link_covered.sql` adds `memory_code_links.covered` with a
default of 0, and no setting is added. A build that takes the repository's recheck lease
inserts its links covered. The previous build omits the column, so its links are not
covered, and it inserts without the lease, so a link can arrive after a pass read the
table. Guidance on a link that is neither checked at the checked head nor covered is
unknown until the next pass covers it, whether or not a previous-build replica is still
running.

## Independent proposal approval

Stop and drain every older API, worker and command-line writer **before** applying
Expand Down
29 changes: 29 additions & 0 deletions docs/features/memory/history-and-provenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,35 @@ person can attest that a row is true. How the version mirror works is in

## Operations

### Using retrieved guidance

On a maintained result, `use_guidance.next_step` tells the reader what it can do with
the served revision. `reasons` lists every applicable reason in precedence order.
Inspect `source_class`, `lifecycle`, `review`, `freshness.source`, `freshness.code`
and `dispute` for the underlying facts. The first applicable rule selects the step.

| Evidence | Next step |
| ---------------------------------------------------------------------------------------------------- | ---------------------- |
| Diagnostic-only lifecycle, including a quarantined procedure | `inspect_only` |
| Visible unresolved dispute | `clarify_dispute` |
| Changed or missing source, or changed, unresolved or missing code | `recheck_source` |
| Pending review or an attestation covering different content | `obtain_review` |
| Unavailable required evidence, or a candidate procedure | `validate_lead` |
| Eligible current content with a matching human attestation and applicable freshness checks satisfied | `follow_if_applicable` |
| Other served claims, including authored claims without review and process-verified claims | `validate_lead` |

A person or process attests to a content hash. A missing hash gives `unknown`;
a successful read showing no verifier gives `none`. Freshness measures the source
or code the claim describes. A fresh link alone leaves an unreviewed claim a lead.
A reported conflict calls for investigation. When dispute evidence is unavailable,
`dispute` is `unknown`. Optional unknown dispute coverage appears in the reasons.

Hosts can validate leads against other sources and follow applicable instructions
under their own policy. They choose the answer's audience before retrieval and enforce
the permitted actions. Guidance adds no model call and changes neither publication nor
procedure matching. Older servers and results without a maintained revision may omit
the field.

| Operation | Role | Answers |
| -------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| `memory.history` | viewer | Every version of a key, newest first, including tombstoned and redacted versions. |
Expand Down
2 changes: 2 additions & 0 deletions docs/features/memory/procedures-and-learnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,5 @@ admins, including their queue counts and lineage. Approving one publishes its co
value, including supporting SQL, to namespace readers. See [definition
drafts](../../architecture/definition-drafts.md) for source setup, review conflicts and
interrupted promotion.

See [Using retrieved guidance](history-and-provenance.md#using-retrieved-guidance) for the next step on a maintained result.
2 changes: 2 additions & 0 deletions docs/features/memory/search-and-ask.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,5 @@ Per namespace, `namespace.register` sets `retrieval_defaults` (`search_mode`, `t
- [Writing memory](./writing.md)
- [Runs](../runs.md): reporting which memories a task relied on.
- [Performance tuning](../../guides/performance-tuning.md)

See [Using retrieved guidance](history-and-provenance.md#using-retrieved-guidance) for the next step on a maintained result.
2 changes: 2 additions & 0 deletions docs/features/unified-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,5 @@ The SDK's `Session.offload` / `Session.fetch` wrap the pair for one session.
- [Retrieval and ranking](../concepts/retrieval-and-ranking.md): why a hit ranks where it does.
- [MCP reference](../reference/mcp.md): toolsets, identity defaults and the code-scope header.
- [Tracker](./tracker/overview.md): the duplicate check behind the tracker leg.

See [Using retrieved guidance](memory/history-and-provenance.md#using-retrieved-guidance) for the next step on a maintained result.
18 changes: 9 additions & 9 deletions docs/reference/operations/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ What does this symbol call — forward call edges (depth<=3), tier-marked like c

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | How many rows about those files the lessons' token cap or a cut left out, with the rows another row read for the answer supersedes. |
| `edges` | `list[CodeEdgeWire]` | The call-graph edges found, hop by hop; the far end (`from_*` for callers, `to_*` for callees) is the answer. |
| `seed_symbols` | `list[str]` | Qualified names of the definitions the walk started from; empty when refused as ambiguous. |
Expand Down Expand Up @@ -346,7 +346,7 @@ Find callers before editing shared code.

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | How many rows about those files the lessons' token cap or a cut left out, with the rows another row read for the answer supersedes. |
| `edges` | `list[CodeEdgeWire]` | The call-graph edges found, hop by hop; the far end (`from_*` for callers, `to_*` for callees) is the answer. |
| `seed_symbols` | `list[str]` | Qualified names of the definitions the walk started from; empty when refused as ambiguous. |
Expand Down Expand Up @@ -391,7 +391,7 @@ Briefing at the START of a task, instead of exploring file by file.

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | How many rows about those files the lessons' token cap or a cut left out, with the rows another row read for the answer supersedes. |
| `context` | `str` | The pack as Markdown text; for `unavailable`, a short note saying the PR has no pack yet. |
| `tokens_used` | `int` | Estimated tokens of `context`. |
Expand Down Expand Up @@ -643,7 +643,7 @@ Batched `path:line` -> enclosing function.

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | How many rows about those files the lessons' token cap or a cut left out, with the rows another row read for the answer supersedes. |
| `results` | `list[dict[str, Any]]` | one entry per input location, input order preserved: {path, line, symbol, symbol_id, qualified_name, signature, tier, kind, start_line, end_line} kind is "function" / "method" / "fixture" for a line inside a function body; "class"… |
| `resolved` | `int` | Locations that landed inside a function, type, or document section. |
Expand Down Expand Up @@ -791,7 +791,7 @@ Literal or regex search of indexed source with enclosing symbols and coverage.

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | File lessons omitted by symbol focus, a token budget, truncation or supersession. |
| `matches` | `list[dict[str, Any]]` | {path, line, text, scope, scope_start_line, scope_end_line} per matching LINE, path/line ordered except when prioritize_patterns gives different literals first-page slots. scope_* is the span of the enclosing unit named by `scope` (0/0… |
| `related` | `RelatedGrepEvidence \| None` | Related source for a qualified argument or member, separate from literal matches. |
Expand Down Expand Up @@ -885,7 +885,7 @@ Symbol-shaped (name/symbol_id) or diff-shaped (files/diff) blast radius.

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | How many rows about those files the lessons' token cap or a cut left out, with the rows another row read for the answer supersedes. |
| `impacted_symbols` | `list[dict[str, Any]]` | Each row {qualified_name, path, hop, tier}; a row whose function is a registration function (`REGISTER_FUNCTION(X)`, `registerStorageFoo`) carries `via: "registration"` — the seed is reached through a registry; the key is absent otherwise. |
| `impacted_tests` | `list[dict[str, Any]]` | The test files code.test_gate lists for the same change at its default depth (2, whatever `depth` the radius is walked at), at most 30, strongest evidence first: each row as a code.test_gate `tests` row ({test_path, why, evidence, run… |
Expand Down Expand Up @@ -1062,7 +1062,7 @@ Tell loom what you did with a code answer, by its trace_run_id: 'used_in_answer'

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | How many rows about those files the lessons' token cap or a cut left out, with the rows another row read for the answer supersedes. |
| `path` | `str` | The repo-relative path read, normalised from the request. |
| `entries` | `list[dict[str, Any]]` | source order: {kind, qualified_name, signature, start_line, end_line, tier} |
Expand Down Expand Up @@ -1162,7 +1162,7 @@ Read indexed lines.

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | How many rows about those files the lessons' token cap or a cut left out, with the rows another row read for the answer supersedes. |
| `results` | `list[CodeReadRange]` | |
| `as_of` | `dict[str, Any]` | |
Expand Down Expand Up @@ -1571,7 +1571,7 @@ Find implementations by question, behavior or identifier using `query`.

| Output field | Type | Meaning |
| --- | --- | --- |
| `lessons` | `list[dict[str, Any]]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons` | `list[CodeLesson]` | The memories about the answer's top files, best first, capped at `code_result_lessons_tokens`; each row {path, memory_key, namespace, excerpt, code_state}, with `rev`, `first_written`, `changed_since`, `code_moved` and `supersedes_key`… |
| `lessons_left_out` | `int` | File lessons omitted by symbol focus, a token budget, truncation or supersession. |
| `results` | `list[CodeUnit]` | The ranked units served on this page, cut to top_k and the token budget; empty on an abstain with no pool or a not-covered path. |
| `route` | `str` | symbol_exact \| hybrid \| symbol_miss_hybrid |
Expand Down
1 change: 1 addition & 0 deletions docs/reference/operations/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Retrieve task context by passing the task as `query`.
| `rendered` | `str` | The pack as one text: each non-empty section in a `<name>` tag, in block order, cut to `token_budget`. |
| `sections` | `dict[str, str]` | Each section's body by name, in block order; sections that rendered nothing are absent. |
| `blocks` | `list[ContextBlock]` | One entry per non-empty section: label, body, token estimate, citations, source count, and `priority` (its position in block order). |
| `use_guidance` | `list[ContextUseGuidance]` | Guidance for the cited items retained in the rendered pack. |
| `section_meta` | `dict[str, dict[str, Any]]` | Per-section details by name: source count, citations, whether it was cut, its size, its token budget and fill ratio (above 1.0 means it was cut). |
| `section_count` | `int` | How many sections rendered something. |
| `truncated` | `bool` | True when any section, or the whole pack, was cut to its budget. |
Expand Down
Loading
Loading