Skip to content

Retain blank source lines between class members - #1156

Merged
zlareb1 merged 2 commits into
mainfrom
fix/container-source-blank-lines
Nov 22, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
fix/container-source-blank-lines

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 22, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

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.symbol can reconstruct class bodies whose methods are separated by blank lines after the index re-chunks their source.

Why

The chunker retained class declarations and method bodies but discarded blank separators between them. Body reconstruction requires every physical source line, so an uncapped class lookup returned a navigation card even when all nonblank source was indexed. Retain the separators at extraction rather than invent missing text during reads.

Scope and risk

The shared chunker retains uncovered whitespace inside class source spans. Whitespace outside containers keeps its existing handling. Skeleton generation and completeness checks are unchanged. Retaining source can add chunk rows and embedding work.

The diff includes regression coverage for two parser languages, LF and CRLF, and enabled or disabled leftover merging.

Compatibility, rollout and rollback

  • Wire: no operations, fields, settings or defaults change.
  • Operator steps: the shared extractor stamp changes for the chunk stage across language families. The ingest worker re-derives that stage in paced batches; existing indexes need that pass before their missing separators become available. Other stages retain their stamps.
  • Rollback: reverting restores the chunker behavior and moves its stamp again. Retained rows remain readable; normal re-chunking reconciles them. No schema changes.

Tests

  • Format, lint, type and format checks pass.
  • An offline replay of the recorded public source reproduces both missing class bodies before the change and reconstructs both byte for byte afterward. A working method body remains identical. This replay makes no provider calls and does not measure agent performance.
  • Regression tests are authored in tests/unit/test_code_symbol_source_lines.py. Unit and integration tests were not run locally, as requested. The focused command for CI or another checkout is python -m pytest tests/unit/test_code_symbol_source_lines.py -q.
  • CI completion is not a merge prerequisite for this change, as requested.

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

  • AI-generated: Codex wrote the diff and checked the recorded source replay and static gates. A fresh agent reviews the pushed head before merge.

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

Checklist

  • Local focused tests pass; local unit and integration execution was waived as described above.
  • Local format, lint and type checks pass.
  • No generated files, migrations, plugin files or frontend files change.
  • Documentation describes source retention and re-chunking.
  • Repository prose contains no deployment details.
  • Commits are signed off.

Class body reconstruction needs separator lines as well as declarations and methods. Keep those lines in retained source instead of returning an incomplete body.

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 11:59am UTC

Request Review

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit 34ed1fb into main Nov 22, 2026
57 of 58 checks passed
@zlareb1
zlareb1 deleted the fix/container-source-blank-lines branch November 22, 2026 12:03
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