Severity: low — test coverage gap. The codec path likely works, but a regression here would be invisible.
Symptom
DepIndexCacheSpec.sample only builds type ids via IndexTestFixtures.tid:
private def sample(name: String): IndexedSymbol = IndexedSymbol(
id = IndexTestFixtures.tid(s"com.example.$name"), // member = None always
...
parents = List(IndexTestFixtures.tid("java.lang.Object")),
...
)
The codec rewrite in Phase 1 dropped the custom JsonValueCodec[SymbolId] and now derives the structural codec via JsonCodecMaker.make[List[IndexedSymbol]]. Type ids (Option[Member] = None) round-trip in tid-only tests, but the term-id branch (Some(Member(disambig = None))) — used by every method/field a real BytecodeIndexer emits — is exercised only at runtime against real fixtures, not in the cache spec.
A future codec regression that mishandles Some(Member(None)) (e.g. flattening to null on read) would silently corrupt cached term ids on the next cold start. DepIndexCache.Version = 3 only invalidates pre-Phase-1 caches; this regression would survive bumps.
Fix
Add a term-id round-trip test to DepIndexCacheSpec:
test("store/lookup roundtrips a term-id symbol") {
val termSym = sample("Foo").copy(id = IndexTestFixtures.mid("com.example.Foo.bar"))
for {
(cache, _) <- freshCache
_ <- cache.store("abc", List(termSym))
result <- cache.lookup("abc")
} yield expect(result.contains(List(termSym)))
}
Acceptance criteria
- New
DepIndexCacheSpec test exercising term-id round-trip
- Same test verifies parents containing term ids round-trip too (composite case)
Severity: low — test coverage gap. The codec path likely works, but a regression here would be invisible.
Symptom
DepIndexCacheSpec.sampleonly builds type ids viaIndexTestFixtures.tid:The codec rewrite in Phase 1 dropped the custom
JsonValueCodec[SymbolId]and now derives the structural codec viaJsonCodecMaker.make[List[IndexedSymbol]]. Type ids (Option[Member] = None) round-trip intid-only tests, but the term-id branch (Some(Member(disambig = None))) — used by every method/field a realBytecodeIndexeremits — is exercised only at runtime against real fixtures, not in the cache spec.A future codec regression that mishandles
Some(Member(None))(e.g. flattening to null on read) would silently corrupt cached term ids on the next cold start.DepIndexCache.Version = 3only invalidates pre-Phase-1 caches; this regression would survive bumps.Fix
Add a term-id round-trip test to
DepIndexCacheSpec:Acceptance criteria
DepIndexCacheSpectest exercising term-id round-trip