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: they carry no taxonomy
38
 * provenance, so they are never reused for classification (a hit would be stamped
39
 * with a taxonomy version it was not classified under) and can never satisfy a
40
 * credential query.
41
 * </p>
42
 *
43
 * <p>
44
 * Instances are obtained via {@link #load(Path)} or the no-op {@link #empty()}.
45
 * The hit/miss counters are {@link AtomicInteger}s, so lookups remain correct if
46
 * the scan loop is ever parallelised; the entry map is immutable after loading.
47
 * </p>
48
 *
49
 * @see AiCacheStore
50
 * @see MethodAtlasApp
51
 */
52
public final class AiResultCache {
53
54
    private final Map<String, AiCacheEntry> byHash;
55
    private final AtomicInteger hits = new AtomicInteger();
56
    private final AtomicInteger misses = new AtomicInteger();
57
58
    private AiResultCache(Map<String, AiCacheEntry> byHash) {
59
        this.byHash = byHash;
60
    }
61
62
    /** Returns an empty cache that always produces misses. */
63
    public static AiResultCache empty() {
64 1 1. empty : replaced return value with null for org/egothor/methodatlas/AiResultCache::empty → KILLED
        return new AiResultCache(Map.of());
65
    }
66
67
    /**
68
     * Loads a cache from a unified JSON-Lines cache file or a legacy scan CSV,
69
     * auto-detected from the file's first non-blank character.
70
     *
71
     * @param path path to a unified cache file or a legacy MethodAtlas CSV
72
     * @return loaded cache; never {@code null}
73
     * @throws IOException if the file cannot be read
74
     */
75
    public static AiResultCache load(Path path) throws IOException {
76
        Map<String, AiCacheEntry> byHash = new HashMap<>();
77
        // Read the file once and drive both the format sniff and the parse from the
78
        // same in-memory copy (avoids a second full read for the JSON-Lines case).
79
        List<String> lines = Files.readAllLines(path, StandardCharsets.UTF_8);
80 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)) {
81
            for (AiCacheEntry entry : AiCacheStore.read(lines)) {
82 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()
83 2 1. load : removed conditional - replaced equality check with true → SURVIVED
2. load : removed conditional - replaced equality check with false → KILLED
                        && entry.suggestion() != null) {
84
                    byHash.put(entry.contentHash(), entry);
85
                }
86
            }
87
        } else {
88
            loadLegacyCsv(path, byHash);
89
        }
90 1 1. load : replaced return value with null for org/egothor/methodatlas/AiResultCache::load → KILLED
        return new AiResultCache(byHash);
91
    }
92
93
    /**
94
     * Loads legacy entries from a per-method scan CSV. Only rows with a non-empty
95
     * {@code content_hash} and a non-{@code null} {@code ai_security_relevant}
96
     * column (AI was enabled) are included; the resulting entries carry no prompt
97
     * signature and no credential verdicts.
98
     *
99
     * @param csvPath legacy CSV path
100
     * @param byHash   map to populate, keyed by content hash
101
     * @throws IOException if the file cannot be read
102
     */
103
    @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
104
    private static void loadLegacyCsv(Path csvPath, Map<String, AiCacheEntry> byHash) throws IOException {
105
        List<ScanRecord> records = DeltaReport.loadRecords(csvPath);
106
107
        Map<String, List<ScanRecord>> grouped = new HashMap<>();
108
        for (ScanRecord r : records) {
109 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) {
110 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);
111
            }
112
        }
113
114
        for (Map.Entry<String, List<ScanRecord>> entry : grouped.entrySet()) {
115
            List<AiMethodSuggestion> methods = new ArrayList<>(entry.getValue().size());
116
            for (ScanRecord r : entry.getValue()) {
117
                methods.add(new AiMethodSuggestion(
118
                        r.method(),
119
                        Boolean.TRUE.equals(r.aiSecurityRelevant()),
120
                        r.aiDisplayName(),
121 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(),
122
                        r.aiReason(),
123 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,
124 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));
125
            }
126
            AiClassSuggestion suggestion = new AiClassSuggestion(null, null, null, null, methods);
127
            byHash.put(entry.getKey(), new AiCacheEntry(entry.getKey(), null, suggestion));
128
        }
129
    }
130
131
    /**
132
     * Returns the cached AI answer for a class by content hash, ignoring the prompt
133
     * signature.
134
     *
135
     * @param contentHash SHA-256 fingerprint of the class source, or {@code null}
136
     * @return cached suggestion, or empty on a miss or {@code null} hash
137
     */
138
    public Optional<AiClassSuggestion> lookup(String contentHash) {
139 2 1. lookup : removed conditional - replaced equality check with false → SURVIVED
2. lookup : removed conditional - replaced equality check with true → KILLED
        if (contentHash == null) {
140
            misses.incrementAndGet();
141
            return Optional.empty();
142
        }
143
        AiCacheEntry entry = byHash.get(contentHash);
144 2 1. lookup : removed conditional - replaced equality check with false → KILLED
2. lookup : removed conditional - replaced equality check with true → KILLED
        if (entry != null) {
145
            hits.incrementAndGet();
146 1 1. lookup : replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::lookup → KILLED
            return Optional.of(entry.suggestion());
147
        }
148
        misses.incrementAndGet();
149
        return Optional.empty();
150
    }
151
152
    /**
153
     * Returns the cached classification for a class when the content hash matches and
154
     * the cached answer is compatible with the current prompt catalogue.
155
     *
156
     * <p>
157
     * An entry must carry a matching {@code promptSignature}. The signature folds in the
158
     * taxonomy version, so a hit is guaranteed to have been classified under the
159
     * current taxonomy and the {@code ai_taxonomy_version} stamp is truthful. A legacy
160
     * entry (no signature, hence no known taxonomy) is therefore never served: it is
161
     * a miss and is re-queried. Updates the hit/miss counters.
162
     * </p>
163
     *
164
     * @param contentHash     SHA-256 fingerprint of the class source, or {@code null}
165
     * @param promptSignature signature of the current run's prompt catalogue
166
     * @return cached classification, or empty on a miss
167
     */
168
    public Optional<AiClassSuggestion> classification(String contentHash, String promptSignature) {
169 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);
170 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
171 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)) {
172
            hits.incrementAndGet();
173 1 1. classification : replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::classification → KILLED
            return Optional.of(entry.suggestion());
174
        }
175
        misses.incrementAndGet();
176
        return Optional.empty();
177
    }
178
179
    /**
180
     * Returns cached credential-triage verdicts for a class when the content hash and
181
     * the prompt signature both match and verdicts were actually recorded.
182
     *
183
     * <p>
184
     * Unlike {@link #classification(String, String)} this requires a non-{@code null}
185
     * matching signature (a legacy entry can never satisfy a credential query) and
186
     * does not touch the hit/miss counters.
187
     * </p>
188
     *
189
     * @param contentHash     SHA-256 fingerprint of the class source, or {@code null}
190
     * @param promptSignature signature of the current run's prompt catalogue
191
     * @return cached verdicts, or empty when none are cached for this signature
192
     */
193
    public Optional<List<CredentialTriageVerdict>> verdicts(String contentHash, String promptSignature) {
194 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);
195 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
196 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)
197 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) {
198 1 1. verdicts : replaced return value with Optional.empty for org/egothor/methodatlas/AiResultCache::verdicts → KILLED
            return Optional.of(entry.suggestion().secrets());
199
        }
200
        return Optional.empty();
201
    }
202
203
    /**
204
     * Returns {@code true} when this cache contains at least one entry.
205
     *
206
     * <p>When {@code false}, content hashes do not need to be computed for lookups
207
     * because all results would be misses regardless.</p>
208
     *
209
     * @return {@code true} when the cache is non-empty
210
     */
211
    public boolean isActive() {
212 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();
213
    }
214
215
    /** Returns the number of successful cache lookups so far. */
216
    public int hits() {
217 1 1. hits : replaced int return with 0 for org/egothor/methodatlas/AiResultCache::hits → KILLED
        return hits.get();
218
    }
219
220
    /** Returns the number of unsuccessful cache lookups so far. */
221
    public int misses() {
222 1 1. misses : replaced int return with 0 for org/egothor/methodatlas/AiResultCache::misses → KILLED
        return misses.get();
223
    }
224
}

Mutations

64

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

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:load_nonSecurityMethod_cachedAndRestoredAsNonSecurity(java.nio.file.Path)]
removed conditional - replaced equality check with true → KILLED

82

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

83

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

90

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)]
replaced return value with null for org/egothor/methodatlas/AiResultCache::load → KILLED

109

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

110

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

121

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

123

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

124

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

139

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

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)]
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

146

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

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)]
removed conditional - replaced equality check with true → KILLED

2.2
Location : classification
Killed by : org.egothor.methodatlas.command.ScanOrchestratorRedactionTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.command.ScanOrchestratorRedactionTest]/[method:gatherAiSuggestions_sendsRedactedSource()]
removed conditional - replaced equality check with false → KILLED

170

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:legacyCsvEntry_isAMissAndNeverServesVerdicts(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.ScanOrchestratorRedactionTest.[engine:junit-jupiter]/[class:org.egothor.methodatlas.command.ScanOrchestratorRedactionTest]/[method:gatherAiSuggestions_sendsRedactedSource()]
removed conditional - replaced equality check with true → KILLED

171

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

173

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

194

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

195

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_isAMissAndNeverServesVerdicts(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

196

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

197

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

198

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

212

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

217

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

222

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.30.1 support