feat(lip): wire up stream_context, query_expansion, explain_match#212
feat(lip): wire up stream_context, query_expansion, explain_match#212
Conversation
Closes the correctness and utilisation gaps found in the CKB 9.1.0 review. Correctness: - lipFileURI now handles absolute paths and already-prefixed file:// URIs instead of naively joining them with repoRoot. - Handshake runs once on engine startup; its supported_messages list drives Engine.lipSupports(), the gate for v2.0+ RPCs against older daemons. Daemon version + supported_messages length are logged. Utilisation (three high-ROI LIP RPCs we were not using): - stream_context (v2.1) → explainFile now attaches a ranked list of semantically-related symbols (top 10 within a 2048-token budget) to the response's facts.related field. New streaming transport in internal/lip/stream_context.go reads N symbol_info frames + the end_stream terminator — the previous LIP client was unary-only. - query_expansion (v1.6) → SearchSymbols expands ≤ 2-token queries with up to 5 related terms before FTS5. Recovers recall on vocabulary-mismatch misses without touching precision on compound queries. - explain_match (v2.0) → SemanticSearchWithLIPExplained attaches up to two ranked chunks per semantic hit (top 5 hits, line ranges + text + score), letting the caller cite specific lines instead of a bare file URL. All three are gated on the handshake's supported_messages so clients talking to older daemons fall through to the legacy paths cleanly. Tests: unit coverage for StreamContext happy path, daemon-down, and error-frame abort. Existing lip_health, lip_ranker, and query tests still pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🟢 Change Impact Analysis
Blast Radius: 0 modules, 0 files, 0 unique callers 📝 Changed Symbols (10)
Recommendations
Generated by CKB |
CKB Analysis
Risk factors: Medium-sized PR with 11 files • Moderate churn: 656 lines changed • Touches 7 hotspot(s) 👥 Suggested: @lisa.welsch1985@gmail.com (91%), @talantyyr@gmail.com (9%), @lisa@tastehub.io (55%)
🎯 Change Impact Analysis · 🟢 LOW · 10 changed → 0 affected
Symbols changed in this PR:
Recommendations:
💣 Blast radius · 0 symbols · 1 tests · 0 consumersTests that may break:
🔥 Hotspots · 7 volatile files
📦 Modules · 1 at risk
📊 Complexity · 4 violations
💡 Quick wins · 10 suggestions
📚 Stale docs · 197 broken references
Generated by CKB · Run details |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #212 +/- ##
========================================
Coverage 43.3% 43.3%
========================================
Files 527 530 +3
Lines 81325 81501 +176
========================================
+ Hits 35241 35327 +86
- Misses 43614 43697 +83
- Partials 2470 2477 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
CKB Review: 🟡 WARN — 76/10011 files (+656 changes) · 3 modules ·
Top Risks
Findings (5 actionable, 17 informational)
Code Health — 2 degradedDegraded:
^1 File could not be parsed by tree-sitter New files: 4 (avg health: 76) 2 degraded · 0 improved · avg -0.6 Estimated review: ~205min (complex) Reviewers: lisa.welsch1985 (91%) · talantyyr (9%) · lisa (55%) |
Summary
Addresses the correctness gaps and under-utilisation findings from the CKB 9.1.0 / LIP integration review. All four items landed in one PR because the utilisation wins share plumbing (handshake + `lipSupports` gate) that's cheaper to ship together.
Correctness (both flagged by the review):
Utilisation (the top-3 high-ROI wins from the review):
All three gate on `lipSupports()` so older daemons fall through cleanly instead of eating round-trips.
Test plan
🤖 Generated with Claude Code