Skip to content

Commit f0efaa1

Browse files
authored
Merge pull request #7 from drompincen/feature/claude-companion-features
Raise code coverage from 67.9% to 75.7%
2 parents 2afb2e5 + 03498ea commit f0efaa1

14 files changed

Lines changed: 3821 additions & 3 deletions

drom-plans/coverage-75.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Code Coverage to 75%
3+
status: completed
4+
created: 2026-03-28
5+
updated: 2026-03-28
6+
current_chapter: 1
7+
loop: true
8+
loop_target: 75.0
9+
loop_metric: instruction_coverage_percent
10+
loop_max_iterations: 3
11+
---
12+
13+
# Plan: Code Coverage to 75%
14+
15+
Raise JaCoCo instruction coverage from **67.9%** to **≥75%** using a closed-loop approach.
16+
17+
**Baseline (2026-03-28):** 15,122 / 22,277 instructions covered (67.9%), 386 tests passing.
18+
**Need:** ~1,580 more instructions covered (16,708 / 22,277).
19+
20+
## Priority targets (testable classes, by uncovered instructions)
21+
22+
| Class | Coverage | Uncovered | Plan |
23+
|-------|----------|-----------|------|
24+
| ReladomoService | 56.5% | 346 | Expand: store/query edge cases |
25+
| IngestionWorker | 74.1% | 323 | Expand: error paths, HNSW build |
26+
| TextExtractor | 76.2% | 294 | Expand: RTF, more ODF/EPUB edges |
27+
| SearchService | 76.4% | 222 | Expand: HNSW path, edge cases |
28+
| CoChangeService | 59.2% | 216 | Expand: DB-backed buildIndex |
29+
| GitBlameService | 57.3% | 195 | Expand: DB-backed blame, edges |
30+
| ReladomoConfigParser | 20.1% | 195 | New: parse config XML tests |
31+
| SessionIngestionService | 83.0% | 177 | Expand: search, edge cases |
32+
33+
## Chapter 1: Service Coverage Push (target: ≥75%)
34+
**Status:** completed
35+
**Depends on:** none
36+
37+
Parallel agents targeting the 8 classes above. Each agent writes tests to cover the uncovered branches.
38+
39+
- [ ] ReladomoService: test storeReladomoObject edge cases, update/delete paths — target 56% → 75%
40+
- [ ] CoChangeService + GitBlameService: DB-backed tests for buildCoChangeIndex with real git, blame edge cases — target 59%/57% → 75%
41+
- [ ] SearchService: test HNSW search path, extractEmbedding variants, empty results — target 76% → 85%
42+
- [ ] ReladomoConfigParser: test XML config parsing for connection managers, object configs — target 20% → 60%
43+
- [ ] IngestionWorker + TextExtractor + SessionIngestionService: expand edge case coverage — target 74%/76%/83% → 85%
44+
- [ ] Write all tests, run `mvn verify`, measure coverage
45+
- [ ] If ≥75%, mark plan completed
46+
47+
## Closed-Loop Protocol
48+
49+
1. Run `mvn verify -B`, parse `jacoco.csv` → instruction coverage %
50+
2. If ≥75%: **STOP**, mark plan completed
51+
3. If <75%: identify remaining gaps, write targeted tests, re-measure (max 2 extra iterations)
52+
53+
## Exclusions (CLI/UI — 0% coverage, low ROI)
54+
IndexCommand, StatsPanel, InteractiveCli, CommandDispatcher, CatCommand, ApiClient,
55+
JavaDuckerClient (and nested Cmd classes), ResultsFormatter, ProgressBar, SearchCommand, StatusCommand
56+
57+
---

reports/.gitkeep

Whitespace-only changes.

src/main/java/com/javaducker/server/service/CoChangeService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ public CoChangeService(DuckDBDataSource dataSource) {
3737
*/
3838
public void buildCoChangeIndex() throws Exception {
3939
String gitOutput = runGitLog();
40+
buildCoChangeIndexFromOutput(gitOutput);
41+
}
42+
43+
/**
44+
* Build co-change index from pre-parsed git log output. Package-private for testing.
45+
*/
46+
void buildCoChangeIndexFromOutput(String gitOutput) throws Exception {
4047
Map<String, List<String>> commits = parseGitLog(gitOutput);
4148
Map<String, List<String>> filtered = filterNoisyCommits(commits);
4249
Set<String> frequentFiles = findFrequentFiles(filtered);
@@ -146,8 +153,9 @@ Map<String, List<String>> parseGitLog(String output) {
146153

147154
/**
148155
* Filter out commits with more than MAX_FILES_PER_COMMIT files.
156+
* Package-private for testing.
149157
*/
150-
private Map<String, List<String>> filterNoisyCommits(Map<String, List<String>> commits) {
158+
Map<String, List<String>> filterNoisyCommits(Map<String, List<String>> commits) {
151159
Map<String, List<String>> filtered = new LinkedHashMap<>();
152160
for (Map.Entry<String, List<String>> entry : commits.entrySet()) {
153161
if (entry.getValue().size() <= MAX_FILES_PER_COMMIT) {

0 commit comments

Comments
 (0)