Feat/lsp thin client - #13
Merged
Merged
Conversation
added 14 commits
August 25, 2026 21:22
…st-fail + to_thread Commit b03073c fixed only the search query path; status/context tools still froze the loop: IndexProjectRunner.begin_write() holds the shared RLock for the entire reindex (~7.5 min embedding), and IndexStatusReporter.get_status() (sync, on the event-loop thread via intel_get_runtime_status, require_ready_project, ProjectContext) waited on the same lock → every MCP call incl. debug_runtime_passport timed out client-side. - IndexStatusReporter.get_status(): reindex fast-fail — instant cached status + status='reindexing' when db_manager.is_reindexing() is True (strict is True: MagicMock-truthy trap 2026-08-13). - intel_get_runtime_status / MCPTool.require_ready_project / ProjectContext._capture_registry: get_status via asyncio.to_thread so the loop stays free even outside reindex (transient write windows). - _get_stale_warning: skip sync LanceDB read during reindex. - Guard: two-arm regression test (fast-fail vs lock-wait control).
После фикса заморозки реиндекса (1964f1e) осталась ложь в сигналах: - intel_get_runtime_status показывал '0 chunks | 0 files' во время reindex → агент мог решить 'индекс пуст' и запустить ненужный 2-й reindex; - require_ready_project советовал 'Index is empty → run index_project_dir()' когда переиндексация уже идёт; - format_runtime_status рендерил '⚪ 0 chunks'. Вариант А (точечная правда, не баннер во все 64 тула): - layer.intel_get_runtime_status: index_telemetry += status='reindexing', reindex_in_progress, reindex_progress_pct, reindex_eta_sec (из get_active_reindex_job_id + _enrich_job_response, strict is True + isinstance guard от MagicMock-truthy 2026-08-13); - base.require_ready_project: при reindex → ToolError warning '⏳ Index is being reindexed (N%, ETA ~Xm) — retry in a few seconds', а не IndexNotReadyError (агент не запустит 2-й reindex); - ui_formatter.format_runtime_status: '🔄 Reindex in progress (N%)' вместо '0 chunks', LED 🟢 (процесс идёт — здоровое состояние). Guard: 6 новых тестов (runtime_status reindex/normal, require_ready reindex/empty-control, formatter reindex/без-progress/normal-unchanged). Live: полный reindex 9003 chunks за 519s — все MCP-вызовы отвечали мгновенно (постоянный опрос job + search fast-fail).
…ex status' wrapper) Live-прогон Варианта А показал двойную обёртку: search_code выдавал '🔴 Error: Failed to check index status: ⏳ Index is being reindexed...' — наша reindex-ошибка ловилась общим except Exception в require_ready_project и теряла status='warning' + recoverable=True (ретry-семантику). Fix: except ToolError: raise BEFORE except Exception — целевые ошибки проходят насквозь; неожиданные по-прежнему заворачиваются. Guard: Arm 3 regression — reindex ToolError пробрасывается как есть; неожиданный ValueError всё ещё заворачивается в 'Failed to check index status'.
Косметический баг 2026-08-26: get_indexer() ставит ProjectState.INDEXING при пустом индексе, но никто не переводил состояние в READY после завершения индексации — паспорт вечно показывал 'Project State: INDEXING' и wait_until_ready ждал до таймаута. - server_factory._delayed_auto_index: после успешной авто-индексации → registry.set_state(READY); - layer._run_reindex_job: после job.status='completed' → set_state(READY). Guard: 3 теста (auto-index → READY; skip при непустом индексе → без set_state; reindex job → READY). Полный pytest 1521 passed, ruff clean.
SymbolIndexAdapter (graph-backed) has no _definitions/_references/_file_to_symbols maps, so incremental index wrote an EMPTY JSON over the populated symbol_index.json (incident 2026-08-26: file empty while 10748 symbols live in memory). Guard: graph-backed instances skip JSON persistence (graph.db is the source of truth) and an empty plain instance must not overwrite a non-empty file. 4 regression tests.
Two-session lab track on the mechanical tool boundary: M1 (telemetry: 5/62 tools ever used), M2 (sub-agent 0/5 MCP calls), M3 (latency matrix), E2-E4 (category router NEGATIVE: search-only ceiling 0.23), E4.1 (graph-arm POSITIVE: 0.433, verify_change 0), E4.2 (concept resolver): deterministic klass-gated concept->symbol registry before lexical extract_symbol + graph-rows facts (graph_fact_text). Real-graph probe: verify_change T9/T29 HIT, facts 4/4 and 3/4. EXPERIMENTS_LOG entries M1-E4.2; README tool/test badges; telemetry pruned per M1 findings.
ARCLUX_AUDIT_2026-08-26.md is a third-party audit artifact (ARCLUX CLI 0.2.0 from another project dir); its tool version is not this project's version, so stale_detector falsely flagged 0.2.0 vs 3.4.0. Exclude the dated artifact (precedent: venv exclude KNOWN_ISSUES 2026-08-12). Config edit invalidated the stale_detector negative-control fixture digest; re-proved via --pin (manifest.json + pin_log.json, TC-10 review record).
SymbolIndex JSON corruption guard live (graph-backed adapter no longer writes empty JSON over populated file; sync to EXT verified md5-identical, 4 regression tests) + E4.2 deterministic klass-gated concept resolver (verify_change T9/T29 HIT on real graph.db, facts 4/4 and 3/4).
Idempotent upsert-by-id tool that mirrors experiments M1-M3/E2-E4.2 (+E4 negativeResult) into MSPortfolio src/data/lab/experiments.json + .ru.json preserving CRLF/indent/ensure_ascii conventions. Verified by portfolio guard: pnpm test tests/lab.test.ts tests/evidence-eval.test.ts 26 passed.
…_change 1.00) Full 30-task live run: cascade 0.267 -> cascade+graph 0.50 (med 196.8ms, p95 4514ms, target >=0.40/<600ms reached). verify_change 0->1.0 (T9 arm=graph:notify_change, T29 arm=graph:_extract_symbol_name); 9/9 classes >= cascade, no regression. results_E4_1_graph.json regenerated; EXPERIMENTS_LOG/AGENT_DIARY updated; portfolio exp-31 -> confirmed (guard 26 passed).
…d line off-by-one - Persist SymbolIndex to LanceDB with row-group compaction (E4.1 / Step 1) - Add graph-stage SymbolIndexAdapter + project-root binding for graph/search/intel tools (Step 2) - Fix MCP freeze during full reindex: QueueHandler/QueueListener instead of in-loop StreamHandler (root cause: logging._lock contention on stderr pipe) - Fix off-by-one: tree-sitter 0-based capture points now emit 1-based start_line (340 -> 341); removed compensating +1 in search_tools - Fix SCM/walk format-parity test encoding old 0-based line; update docs (AGENT_DIARY post-mortems + KNOWN_ISSUES; add pre-existing finalization-hang note) Verified: live full reindex embedded without server freeze; LanceDB chunks 341/332; full pytest 1553 passed.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
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.
No description provided.