Skip to content

Enclosing code ranks file lessons by resolved symbol names - #1140

Merged
zlareb1 merged 1 commit into
mainfrom
fix/enclosing-lesson-context
Nov 22, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
fix/enclosing-lesson-context

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 22, 2026

Copy link
Copy Markdown
Member

Related: #1139

Changelog category (leave one):

  • Improvement

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):

Enclosing-code reads use resolved symbol names to rank attached memories. Relevant notes can precede newer unrelated notes about the same file within the shared response budget.

Why

The enclosing-code handler resolves method names, but file-lesson enrichment receives an empty query. It therefore spends its bounded response on listing order even when the resolved names match an older note. Passing those names into the existing ranker retains evidence the code read already produced.

Scope and risk

The shared result wrapper derives one deduplicated query from resolved enclosing symbols, with qualified names when short names are absent. Unresolved locations contribute no terms. Search and grep retain their request queries. The same readable candidates, authorization, timeout, token budget, constraint and pin priority, and supersession filtering apply. No database or model call is added. No extractor or index stage changes.

Compatibility, rollout and rollback

  • Wire: no fields or operations change; enclosing lesson order can change.
  • Operator steps: none; no re-index or backfill.
  • Rollback: revert the enrichment change; no stored rows or migrations are added.

Tests

  • Ruff lint and format checks, the type and function-length gates, secret scan, documentation formatting and prose checks pass.
  • Unit coverage checks resolved names, duplicate locations, qualified-name fallback, unresolved locations, opt-out and narrowed scopes. Integration coverage puts a matching older note before a newer unrelated note while retaining namespace authorization checks. These tests are authored but not run locally at the requester's instruction.
  • Recorded-context and memory-certificate enumeration checks candidate ordering offline. It makes no provider or service calls and supplies no native latency, cost or solver-quality claim. The active E2E recording predates this change. CI is not awaited.

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

  • AI-generated: Codex implemented the change and regression coverage. Fresh independent agent review checks the pushed head.

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

Checklist

  • Local format, lint and type checks pass. Local unit and integration tests are not run at the requester's instruction.
  • No wire schema, generated references, storage, plugin or frontend changes.
  • Documentation describes the ranking behavior and operator steps.
  • Commits are signed off.

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

vercel Bot commented Nov 22, 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 22, 2026 6:55am UTC

Request Review

@zlareb1
zlareb1 merged commit 985c92c into main Nov 22, 2026
57 of 58 checks passed
@zlareb1
zlareb1 deleted the fix/enclosing-lesson-context branch November 22, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant