Repository navigation
scip-python 0.6.6: SymbolInformation missing for @dataclass class symbols and stdlib symbols, causing scip expt-convert to hard-fail #223
Description
Summary
scip-python 0.6.6 (latest) does not generate SymbolInformation for @dataclass class symbols themselves (only for their fields/methods), nor for many standard library symbols. When scip expt-convert (v0.8.1) encounters a definition occurrence with an enclosing range for one of these missing symbols, it hard-errors with "has definition occurrence, but no SymbolInformation" and aborts the entire conversion, making the index unusable.
Reproduction
Minimal two-file project:
pyproject.toml
[project]
name = "scip-final-repro"
version = "0.1.0"contracts.py
"""File A: defines a @dataclass with self-validation in __post_init__."""
from __future__ import annotations
from dataclasses import dataclass
from numbers import Real
import math
def _validate(value: object) -> None:
if not isinstance(value, Foo):
raise ValueError("must be Foo")
if not isinstance(value.x, Real) or not math.isfinite(value.x):
raise ValueError("x must be finite real")
@dataclass(frozen=True)
class Foo:
x: float
def __post_init__(self) -> None:
_validate(self)consumer.py
"""File B: imports and uses Foo from file A."""
from __future__ import annotations
from contracts import Foo
def make_foo(x: float) -> Foo:
return Foo(x=x)Steps
scip-python index . --output index.scip --quiet
scip expt-convert --output index.db index.scipObserved
In the generated index.scip:
-
Foo#(the class symbol itself) has 8 occurrences incontracts.py, butSymbolInformationis only generated for 3 sub-symbols (Foo#x,Foo#__post_init__,Foo#__post_init__().(self)). The class-levelFoo#symbol is missing fromdoc.symbols. -
Foo#inconsumer.pyhas 4 occurrences but zeroSymbolInformationentries — cross-file references are completely missing symbol metadata. -
Standard library symbols also missing
SymbolInformation:dataclasses/dataclass()math/isfinite()numbers/Real#math/__init__:
Converter behavior
For this minimal repro, scip expt-convert succeeds (exit 0) because the missing symbols don't have enclosing ranges. However, in a large project (477 Python files, 160K occurrences), some missing symbols do have enclosing ranges, triggering the hard error in convert.go:395:
return fmt.Errorf("symbol %q has definition occurrence, but no SymbolInformation", occ.Symbol)This aborts the entire conversion, producing only a 36KB partial database instead of the expected ~13MB.
Expected behavior
scip-python should generate SymbolInformation for:
@dataclassclass symbols themselves (not just their fields/methods)- Standard library symbols referenced in the indexed code
Environment
- scip-python: 0.6.6 (latest on npm)
- scip converter: v0.8.1
- Python: 3.12.13
- Node.js: v22.22.3
- macOS: Darwin x86_64
Related issues
- Indexer fails to create symbols for assignments with type annotations #161 — "Indexer fails to create symbols for assignments with type annotations" (closed, not planned)
- Cross-package references silently dropped in src-layout projects (autoSearchPaths is never enabled) #221 — "Cross-package references silently dropped in src-layout projects" (open)
- scip-code/scip PR Find
implementations(for parent classes) #36 — relaxed this check forlintbutexpt-convertstill hard-fails - scip-code/scip #464 —
expt-convertmissing fields population (open)
Workaround
We've written a patch script that parses the .scip protobuf, detects all symbols with occurrences but no SymbolInformation, and inserts minimal placeholder SymbolInformation entries before running expt-convert. This produces a complete ~13MB database and scip-cli analyze works correctly on the patched index.
Activity
linear commentedon Jul 29, 2026
OSS-24217
fix: patch missing SymbolInformation before expt-convert (scip-python…
phuongddx commentedon Sep 13, 2026
Additional trigger found — same failure family, but no
@dataclassand no stdlib involvement: a plain class referenced before its definition in the same file also produces a definition occurrence with noSymbolInformation.Minimal repro (single file, no dependencies)
Observed
The class's definition occurrence (inside
guarded, i.e. an early reference) is emitted, butDashboardError#is missing fromdoc.symbols. Moving the class definition above the function makes the conversion pass, which suggests the emitter dropsSymbolInformationwhen the symbol's occurrence list is seeded by a reference before the definition is registered.Versions
@sourcegraph/scip-python0.6.6 (also the current Homebrewscip-python; npm latest is also 0.6.6)scipCLI v0.9.0-dev (SHA 56791658a873bced14470a735d0f6821ee972cb0)Real-world impact
Hit on a real repo (jarvis, https://github.com/phuongddx/jarvis):
scip expt-converthard-fails and the indexing pipeline publishes degraded (search-only, no SCIP navigation). File in question:src/jarvis/dashboard.py, where_guarded_semantic()raisedDashboardError~35 lines before the class definition. The converter has no skip-validation flag, so there is no workaround other than reordering the source.