Skip to content

fix(verify): real-boundary fixes — CRLF patch, tree-sitter Tree/bytes, stderr - #11

Merged
ManSio merged 1 commit into
mainfrom
feat/lsp-thin-client
Aug 25, 2026
Merged

fix(verify): real-boundary fixes — CRLF patch, tree-sitter Tree/bytes, stderr#11
ManSio merged 1 commit into
mainfrom
feat/lsp-thin-client

Conversation

@ManSio

@ManSio ManSio commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Три реальных бага, вскрытых ЖИВОЙ верификацией (fake/unit-тесты были зелёными):

  1. CRLF: Path.write_text на Windows транслирует LF->CRLF в патч-файле -> git apply --check падает (ручной bash-repro с LF-патчем проходил). Файкс: newline="
    ".
  2. Дерево: реальный tree-sitter отдаёт TREE (дети в .root_node) — fake-тесты не моделировали -> реальный парс молча возвращал []. Файкс: унификация через root_node + регрессия.
  3. Байты: node.text у tree-sitter — bytes (b'ast'); + шум имён из import_list. Файкс: decode + skip import_list/aliased_import.

Плюс: _run теперь показывает stderr при провале (было DEVNULL — пустая диагностика).

Guard: 16 тестов (12 language_imports + 4 change_preview); live-точность против ground-truth: ast/re/pathlib/typing верны, future miss + символы-шум — задокументированные best-effort границы.

…, stderr

- change_preview._run: surface stderr on failure (was DEVNULL -> empty diagnostics; 'patch --check failed:' had no message).
- change_preview: write patch with newline='\n' — Path.write_text CRLF-translated the patch on Windows, git apply --check failed (bash-repro with LF patch passed).
- language_imports._iter_nodes: real tree-sitter returns a TREE (.root_node holds children) — fake-tree tests missed it, real parse silently returned [].
- language_imports: decode bytes node.text (tree-sitter gives bytes -> 'b\'ast\''); skip import_list/aliased_import subtrees (names of imports are not modules).
- Guard: test_real_treesitter_tree_shape (Tree-shape regression). Live accuracy vs ground truth: ast/re/pathlib/typing correct; __future__ miss + import-symbol noise documented as best-effort limits.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b9fd63a-4ae5-4762-aa58-29702660fb43


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ManSio
ManSio merged commit 1cfa992 into main Aug 25, 2026
13 checks passed
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