AiResultCache.java

1
package org.egothor.methodatlas;
2
3
import java.io.IOException;
4
import java.nio.charset.StandardCharsets;
5
import java.nio.file.Files;
6
import java.nio.file.Path;
7
import java.util.ArrayList;
8
import java.util.HashMap;
9
import java.util.List;
10
import java.util.Map;
11
import java.util.Optional;
12
import java.util.concurrent.atomic.AtomicInteger;
13
14
import org.egothor.methodatlas.ai.AiClassSuggestion;
15
import org.egothor.methodatlas.ai.AiMethodSuggestion;
16
import org.egothor.methodatlas.ai.CredentialTriageVerdict;
17
import org.egothor.methodatlas.api.ScanRecord;
18
import org.egothor.methodatlas.emit.DeltaReport;
19
20
/**
21
 * In-memory cache of AI results loaded from a previous MethodAtlas run, keyed by
22
 * the per-class {@code content_hash} fingerprint.
23
 *
24
 * <p>
25
 * Each entry ({@link AiCacheEntry}) holds the complete AI answer for one class —
26
 * method classifications <em>and</em> any credential-triage verdicts — plus the
27
 * prompt-catalogue signature that produced it. This lets one cached answer serve a
28
 * later classification-only run, a later credential run, or a combined run without
29
 * re-querying the model, provided the prompt signature still matches. An answer
30
 * obtained under a different prompt catalogue is never reused.
31
 * </p>
32
 *
33
 * <p>
34
 * Two source formats are accepted by {@link #load(Path)}: the unified JSON-Lines
35
 * cache (the format MethodAtlas now writes) and the legacy per-method scan CSV
36
 * (produced by older {@code -content-hash} runs). Legacy entries carry no prompt
37
 * signature and no credential verdicts: their classifications may still be reused
38
 * by content hash, but they can never satisfy a credential query.
39
 * </p>
40
 *
41
 * <p>
42
 * Instances are obtained via {@link #load(Path)} or the no-op {@link #empty()}.
43
 * The hit/miss counters are {@link AtomicInteger}s, so lookups remain correct if
44
 * the scan loop is ever parallelised; the entry map is immutable after loading.
45
 * </p>
46
 *
47
 * @see AiCacheStore
48
 * @see MethodAtlasApp
49
 */
50
public final class AiResultCache {
51
52
    private final Map<String, AiCacheEntry> byHash;
53
    private final AtomicInteger hits = new AtomicInteger();
54
    private final AtomicInteger misses = new AtomicInteger();
55
56
    private AiResultCache(Map<String, AiCacheEntry> byHash) {
57
        this.byHash = byHash;
58
    }
59
60
    /** Returns an empty cache that always produces misses. */
61
    public static AiResultCache empty() {
62 1 1. empty : replaced return value with null for org/egothor/methodatlas/AiResultCache::empty → KILLED
        return new AiResultCache(Map.of());
63
    }
64
65
    /**
66
     * Loads a cache from a unified JSON-Lines cache file or a legacy scan CSV,
67
     * auto-detected from the file's first non-blank character.
68
     *
69
     * @param path path to a unified cache file or a legacy MethodAtlas CSV
70
     * @return loaded cache; never {@code null}
71
     * @throws IOException if the file cannot be read
72
     */
73
    public static AiResultCache load(Path path) throws IOException {
74
        Map<String, AiCacheEntry> byHash = new HashMap<>();
75
        // Read the file once and drive both the format sniff and the parse from the
76
        // same in-memory copy (avoids a second full read for the JSON-Lines case).
77
        List<String> lines = Files.readAllLines(path, StandardCharsets.UTF_8);
78 2 1. load : removed conditional - replaced equality check with false → KILLED
2. load : removed conditional - replaced equality check with true → KILLED
        if (AiCacheStore.looksLikeJsonLines(lines)) {
79
            for (AiCacheEntry entry : AiCacheStore.read(lines)) {
80 4 1. load : removed conditional - replaced equality check with true → SURVIVED
2. load : removed conditional - replaced equality check with true → SURVIVED
3. load : removed conditional - replaced equality check with false → KILLED
4. load : removed conditional - replaced equality check with false → KILLED
                if (entry.contentHash() != null && !entry.contentHash().isEmpty()
81 2 1. load : removed conditional - replaced equality check with true → SURVIVED
2. load : removed conditional - replaced equality check with false → KILLED
                        && entry.suggestion() != null) {
82
                    byHash.put(entry.contentHash(), entry);
83
                }
84
            }
85
        } else {
86 1 1. load : removed call to org/egothor/methodatlas/AiResultCache::loadLegacyCsv → KILLED
            loadLegacyCsv(path, byHash);
87
        }
88 1 1. load : replaced return value with null for org/egothor/methodatlas/AiResultCache::load → KILLED
        return new AiResultCache(byHash);
89
    }
90
91
    /**
92
     * Loads legacy entries from a per-method scan CSV. Only rows with a non-empty
93
     * {@code content_hash} and a non-{@code null} {@code ai_security_relevant}
94
     * column (AI was enabled) are included; the resulting entries carry no prompt
95
     * signature and no credential verdicts.
96
     *
97
     * @param csvPath legacy CSV path
98
     * @param byHash   map to populate, keyed by content hash
99
     * @throws IOException if the file cannot be read
100
     */
101
    @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
102
    private static void loadLegacyCsv(Path csvPath, Map<String, AiCacheEntry> byHash) throws IOException {
103
        List<ScanRecord> records = DeltaReport.loadRecords(csvPath);
104
105
        Map<String, List<ScanRecord>> grouped = new HashMap<>();
106
        for (ScanRecord r : records) {
107 6 1. loadLegacyCsv : removed conditional - replaced equality check with true → SURVIVED
2. loadLegacyCsv : removed conditional - replaced equality check with true → KILLED
3. loadLegacyCsv : removed conditional - replaced equality check with false → KILLED
4. loadLegacyCsv : removed conditional - replaced equality check with false → KILLED
5. loadLegacyCsv : removed conditional - replaced equality check with true → KILLED
6. loadLegacyCsv : removed conditional - replaced equality check with false → KILLED
            if (r.contentHash() != null && !r.contentHash().isEmpty() && r.aiSecurityRelevant() != null) {
108 1 1. lambda$loadLegacyCsv$0 : replaced return value with Collections.emptyList for org/egothor/methodatlas/AiResultCache::lambda$loadLegacyCsv$0 → KILLED
                grouped.computeIfAbsent(r.contentHash(), k -> new ArrayList<>()).add(r);
109
            }
110
        }
111
112
        for (Map.Entry<String, List<ScanRecord>> entry : grouped.entrySet()) {
113
            List<AiMethodSuggestion> methods = new ArrayList<>(entry.getValue().size());
114
            for (ScanRecord r : entry.getValue()) {
115
                methods.add(new AiMethodSuggestion(
116
                        r.method(),
117
                        Boolean.TRUE.equals(r.aiSecurityRelevant()),
118
                        r.aiDisplayName(),
119 2 1. loadLegacyCsv : removed conditional - replaced equality check with true → SURVIVED
2. loadLegacyCsv : removed conditional - replaced equality check with false → KILLED
                        r.aiTags() != null ? r.aiTags() : List.of(),
120
                        r.aiReason(),
121 2 1. loadLegacyCsv : removed conditional - replaced equality check with false → SURVIVED
2. loadLegacyCsv : removed conditional - replaced equality check with true → KILLED
                        r.aiConfidence() != null ? r.aiConfidence() : 0.0,
122 2 1. loadLegacyCsv : removed conditional - replaced equality check with true → SURVIVED
2. loadLegacyCsv : removed conditional - replaced equality check with false → KILLED
                        r.aiInteractionScore() != null ? r.aiInteractionScore() : 0.0));
123
            }
124
            AiClassSuggestion suggestion = new AiClassSuggestion(null, null, null, null, methods);
125
            byHash.put(entry.getKey(), new AiCacheEntry(entry.getKey(), null, suggestion));
126
        }
127
    }
128
129
    /**
130
     * Returns the cached AI answer for a class by content hash, ignoring the prompt
131
     * signature.
132
     *
133
     * @param contentHash SHA-256 fingerprint of the class source, or {@code null}
134
     * @return cached suggestion, or empty on a miss or {@code null} hash
135
     */
136
    public Optional<AiClassSuggestion> lookup(String contentHash) {
137 2 1. lookup : removed conditional - replaced equality check with false → SURVIVED
2. lookup : removed conditional - replaced equality check with true → KILLED
        if (contentHash == null) {
138
            misses.incrementAndGet();
139
            return Optional.empty();
140
        }
141
        AiCacheEntry entry = byHash.get(contentHash);
142 2 1. lookup : removed conditional - replaced equality check with false → KILLED
2. lookup : removed conditional - replaced equality check with true → KILLED
        if (entry != null) {
143
            hits.incrementAndGet();
144 1 1. lookup : replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::lookup → KILLED
            return Optional.of(entry.suggestion());
145
        }
146
        misses.incrementAndGet();
147
        return Optional.empty();
148
    }
149
150
    /**
151
     * Returns the cached classification for a class when the content hash matches and
152
     * the cached answer is compatible with the current prompt catalogue.
153
     *
154
     * <p>
155
     * A unified entry must carry a matching {@code promptSignature}; a legacy entry
156
     * (no signature) is served by content hash alone, preserving prior behaviour.
157
     * Updates the hit/miss counters.
158
     * </p>
159
     *
160
     * @param contentHash     SHA-256 fingerprint of the class source, or {@code null}
161
     * @param promptSignature signature of the current run's prompt catalogue
162
     * @return cached classification, or empty on a miss
163
     */
164
    public Optional<AiClassSuggestion> classification(String contentHash, String promptSignature) {
165 2 1. classification : removed conditional - replaced equality check with true → KILLED
2. classification : removed conditional - replaced equality check with false → KILLED
        AiCacheEntry entry = contentHash == null ? null : byHash.get(contentHash);
166 4 1. classification : removed conditional - replaced equality check with false → KILLED
2. classification : removed conditional - replaced equality check with true → KILLED
3. classification : removed conditional - replaced equality check with false → KILLED
4. classification : removed conditional - replaced equality check with true → KILLED
        if (entry != null && (entry.promptSignature() == null
167 2 1. classification : removed conditional - replaced equality check with false → KILLED
2. classification : removed conditional - replaced equality check with true → KILLED
                || entry.promptSignature().equals(promptSignature))) {
168
            hits.incrementAndGet();
169 1 1. classification : replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::classification → KILLED
            return Optional.of(entry.suggestion());
170
        }
171
        misses.incrementAndGet();
172
        return Optional.empty();
173
    }
174
175
    /**
176
     * Returns cached credential-triage verdicts for a class when the content hash and
177
     * the prompt signature both match and verdicts were actually recorded.
178
     *
179
     * <p>
180
     * Unlike {@link #classification(String, String)} this requires a non-{@code null}
181
     * matching signature (a legacy entry can never satisfy a credential query) and
182
     * does not touch the hit/miss counters.
183
     * </p>
184
     *
185
     * @param contentHash     SHA-256 fingerprint of the class source, or {@code null}
186
     * @param promptSignature signature of the current run's prompt catalogue
187
     * @return cached verdicts, or empty when none are cached for this signature
188
     */
189
    public Optional<List<CredentialTriageVerdict>> verdicts(String contentHash, String promptSignature) {
190 2 1. verdicts : removed conditional - replaced equality check with false → SURVIVED
2. verdicts : removed conditional - replaced equality check with true → KILLED
        AiCacheEntry entry = contentHash == null ? null : byHash.get(contentHash);
191 4 1. verdicts : removed conditional - replaced equality check with true → SURVIVED
2. verdicts : removed conditional - replaced equality check with false → KILLED
3. verdicts : removed conditional - replaced equality check with false → KILLED
4. verdicts : removed conditional - replaced equality check with true → KILLED
        if (entry != null && entry.promptSignature() != null
192 2 1. verdicts : removed conditional - replaced equality check with true → KILLED
2. verdicts : removed conditional - replaced equality check with false → KILLED
                && entry.promptSignature().equals(promptSignature)
193 2 1. verdicts : removed conditional - replaced equality check with false → KILLED
2. verdicts : removed conditional - replaced equality check with true → KILLED
                && entry.suggestion().secrets() != null) {
194 1 1. verdicts : replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::verdicts → KILLED
            return Optional.of(entry.suggestion().secrets());
195
        }
196
        return Optional.empty();
197
    }
198
199
    /**
200
     * Returns {@code true} when this cache contains at least one entry.
201
     *
202
     * <p>When {@code false}, content hashes do not need to be computed for lookups
203
     * because all results would be misses regardless.</p>
204
     *
205
     * @return {@code true} when the cache is non-empty
206
     */
207
    public boolean isActive() {
208 3 1. isActive : replaced boolean return with true for org/egothor/methodatlas/AiResultCache::isActive → KILLED
2. isActive : removed conditional - replaced equality check with false → KILLED
3. isActive : removed conditional - replaced equality check with true → KILLED
        return !byHash.isEmpty();
209
    }
210
211
    /** Returns the number of successful cache lookups so far. */
212
    public int hits() {
213 1 1. hits : replaced int return with 0 for org/egothor/methodatlas/AiResultCache::hits → KILLED
        return hits.get();
214
    }
215
216
    /** Returns the number of unsuccessful cache lookups so far. */
217
    public int misses() {
218 1 1. misses : replaced int return with 0 for org/egothor/methodatlas/AiResultCache::misses → KILLED
        return misses.get();
219
    }
220
}

Mutations

62

1.1
Location : empty
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:empty_isNotActiveAndAlwaysMisses()]
replaced return value with null for org/egothor/methodatlas/AiResultCache::empty → KILLED

78

1.1
Location : load
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : load
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

80

1.1
Location : load
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : load
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

3.3
Location : load
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

4.4
Location : load
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

81

1.1
Location : load
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : load
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

86

1.1
Location : load
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed call to org/egothor/methodatlas/AiResultCache::loadLegacyCsv → KILLED

88

1.1
Location : load
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_csvWithoutAiColumns_producesInactiveCache(java.nio.file.Path)]
replaced return value with null for org/egothor/methodatlas/AiResultCache::load → KILLED

107

1.1
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_csvWithoutContentHashColumn_producesInactiveCache(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

2.2
Location : loadLegacyCsv
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

3.3
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

4.4
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

5.5
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_csvWithoutAiColumns_producesInactiveCache(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

6.6
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

108

1.1
Location : lambda$loadLegacyCsv$0
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
replaced return value with Collections.emptyList for org/egothor/methodatlas/AiResultCache::lambda$loadLegacyCsv$0 → KILLED

119

1.1
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_methodSuggestionFieldsRestoredCorrectly(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : loadLegacyCsv
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

121

1.1
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

2.2
Location : loadLegacyCsv
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

122

1.1
Location : loadLegacyCsv
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

2.2
Location : loadLegacyCsv
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_methodSuggestionFieldsRestoredCorrectly(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

137

1.1
Location : lookup
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

2.2
Location : lookup
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

142

1.1
Location : lookup
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : lookup
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:empty_isNotActiveAndAlwaysMisses()]
removed conditional - replaced equality check with true → KILLED

144

1.1
Location : lookup
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::lookup → KILLED

165

1.1
Location : classification
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

2.2
Location : classification
Killed by : org.egothor.methodatlas.MethodAtlasAppApplyTagsTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.MethodAtlasAppApplyTagsTest]/[method:applyTags_nonSecurityMethod_notAnnotated(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

166

1.1
Location : classification
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_signatureMismatchMissesBoth(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : classification
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:legacyCsvEntry_servesClassificationNotVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

3.3
Location : classification
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

4.4
Location : classification
Killed by : org.egothor.methodatlas.command.ScanOrchestratorCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.command.ScanOrchestratorCacheTest]/[method:cacheMiss_runsCombinedClassificationAndRecordsVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

167

1.1
Location : classification
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : classification
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_signatureMismatchMissesBoth(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

169

1.1
Location : classification
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::classification → KILLED

190

1.1
Location : verdicts
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

2.2
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

191

1.1
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

3.3
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:legacyCsvEntry_servesClassificationNotVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

4.4
Location : verdicts
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

192

1.1
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_signatureMismatchMissesBoth(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

2.2
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

193

1.1
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

2.2
Location : verdicts
Killed by : org.egothor.methodatlas.command.ScanOrchestratorCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.command.ScanOrchestratorCacheTest]/[method:cacheHit_withoutVerdicts_issuesExactlyOneDedicatedTriageCall(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

194

1.1
Location : verdicts
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:unifiedCache_roundTripsClassificationAndVerdicts(java.nio.file.Path)]
replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::verdicts → KILLED

208

1.1
Location : isActive
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:empty_isNotActiveAndAlwaysMisses()]
replaced boolean return with true for org/egothor/methodatlas/AiResultCache::isActive → KILLED

2.2
Location : isActive
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with false → KILLED

3.3
Location : isActive
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:empty_isNotActiveAndAlwaysMisses()]
removed conditional - replaced equality check with true → KILLED

213

1.1
Location : hits
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:load_csvWithContentHashAndAiColumns_hitOnMatchingHash(java.nio.file.Path)]
replaced int return with 0 for org/egothor/methodatlas/AiResultCache::hits → KILLED

218

1.1
Location : misses
Killed by : org.egothor.methodatlas.AiResultCacheTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.AiResultCacheTest]/[method:empty_isNotActiveAndAlwaysMisses()]
replaced int return with 0 for org/egothor/methodatlas/AiResultCache::misses → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1