Repository navigation
Enclosing code reads carry linked file lessons - #1139
Merged
Merged
Conversation
Agents can read definitions by location without a symbol lookup. Reuse bounded result enrichment so those reads carry authorized file history too, excluding unresolved locations. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks done
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
code.enclosingreturns readable memories about the files of resolved definitions, with their code freshness state and the same bounded lesson enrichment as other code reads.Why
An agent can read a definition through
code.enclosingwithout ever callingcode.symbol. That path returns the code but omits its linked history, so a memory-enabled session can receive no notes despite reading the relevant file. Enclosing answers use the shared file-lesson enrichment after the code answer is assembled.Scope and risk
Only files containing resolved locations supply lesson candidates. Unresolved locations remain in the answer and contribute none; repeated locations share a file read. Existing namespace authorization, narrowed-token exclusion, path limits, timeout, token cap and supersession filtering apply. The added read can increase latency; callers can disable it. No model call is added.
Compatibility, rollout and rollback
code.enclosingacceptsinclude_lessons(default true) andlesson_namespaces(default empty); output adds optionallessonsandlessons_left_out. Empty lesson fields are omitted. No fields are removed.Tests
Ruff lint and format, the function-length gate, the server mypy gate, SDK type checking, generated API/SDK refresh and diff checks pass. Unit coverage is added for resolved versus unresolved locations, opt-out, narrowed scope, namespace filtering, duplicate paths, registry wiring and wire serialization. An integration case covers authorized lessons, inaccessible memory namespaces and opt-out through the registered HTTP endpoint.
Local unit tests are not run at the requester's direction. Integration tests are authored but not run locally alongside the active timing evaluation. A fresh agent review is required before merging; CI is not awaited. The active evaluation remains on its frozen source and does not measure this change.
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Codex; checked the shared authorization and enrichment path, generated surfaces and source discovery evidence.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist