Documentation
¶
Index ¶
- Constants
- Variables
- func FromSCIPV2(repository, commit string, upload scipgraph.Upload, limits Limits) (*graphv2.Artifact, error)
- func Identity(node Node) (string, error)
- func IdentityV2(p *graphv2.Producer, repository, sourceID, occurrence string) (string, error)
- func MarshalV2(a *graphv2.Artifact, limits Limits) ([]byte, error)
- func ParseV2(data []byte, limits Limits) (*graphv2.Artifact, error)
- func SCIPCapabilities() []string
- func SemanticHashV2(a *graphv2.Artifact, limits Limits) ([]byte, error)
- func SourceOffset(source string, p *graphv2.Position) (int, error)
- func Validate(artifact Artifact, limits Limits) error
- func ValidateV2(a *graphv2.Artifact, limits Limits) error
- type Analyzer
- type Artifact
- type Edge
- type EdgeKind
- type Limits
- type Manifest
- type Node
- type NodeKind
- type Range
- type Relationship
- type SCIPRepository
Constants ¶
const ( DefaultMaxNodes = 500_000 DefaultMaxEdges = 2_000_000 DefaultMaxFiles = 100_000 DefaultMaxUnresolved = DefaultMaxEdges HardMaxNodes = 2_000_000 HardMaxEdges = 10_000_000 DefaultMaxPathBytes = 4_096 DefaultMaxIdentifierBytes = 16_384 )
const SCIPProducer = "scip"
SCIPProducer names the v2 generations GraphNest derives from SCIP uploads. A generation from any other producer is never replaced by a SCIP upload.
Variables ¶
var ErrGraphTooLarge = errors.New("scip graph exceeds generation limits")
ErrGraphTooLarge reports a SCIP index whose derived graph exceeds the v2 generation limits (entity and edge counts or the artifact byte budget); the SCIP navigation data itself stays usable.
var ErrInvalidArtifact = errors.New("invalid graph artifact")
var ErrUnsupportedVersion = errors.New("unsupported graph artifact version")
Functions ¶
func FromSCIPV2 ¶ added in v0.10.0
func FromSCIPV2(repository, commit string, upload scipgraph.Upload, limits Limits) (*graphv2.Artifact, error)
FromSCIPV2 derives a v2 generation from a parsed SCIP index for the public repository identity and its indexed commit. Each non-local symbol becomes an entity at its definition; each reference occurrence becomes a references edge from the innermost definition whose enclosing range holds it, or from the file when the producer gave no enclosing range. SCIP carries no file contents or hashes, so the artifact has no File facts. limits bounds the derived generation; zero values use the defaults.
func IdentityV2 ¶
IdentityV2 scopes original identity and occurrence by public repository and producer. A repeated qualified name or source ID never collapses declarations.
func ParseV2 ¶
ParseV2 is deliberately separate from the v1 storage/publication reader. No protobuf objects or extension JSON trees are allocated before wire bounds.
func SCIPCapabilities ¶ added in v0.10.0
func SCIPCapabilities() []string
SCIPCapabilities lists the relationship kinds a SCIP-derived generation can contain. SCIP records references, not call expressions, so calls are absent.
func SourceOffset ¶
SourceOffset resolves a zero-based UTF-16 position against exact UTF-8 source. It rejects columns inside a surrogate pair, beyond a line, and line-only data. CR is retained before LF, matching both CodeGraph producer implementations.
Types ¶
type Artifact ¶
type Artifact struct {
SchemaVersion uint32
Analyzer Analyzer
RepositoryID int64
Commit string
ContentHash []byte
Nodes []Node
Edges []Edge
}
func FromSCIP ¶
func FromSCIP(repository SCIPRepository, occurrences []scipgraph.Occurrence, relationships []scipgraph.Relationship) (Artifact, error)
type Relationship ¶
Relationship is the common wire, API-name and display contract. Every relation is directed source -> target; Incoming labels describe the reverse view.
func ParseRelationship ¶
func ParseRelationship(name string) (Relationship, bool)
ParseRelationship validates an API or producer name without aliases.
func RelationshipFromWire ¶
func RelationshipFromWire(kind graphv2.EdgeKind) (Relationship, bool)
RelationshipFromWire checks the full enum width before narrowing.
func Relationships ¶
func Relationships() []Relationship
Relationships returns a copy so callers cannot mutate the validation registry.
func (Relationship) WireKind ¶
func (r Relationship) WireKind() graphv2.EdgeKind