Documentation
¶
Index ¶
- func HasTestAnnotation(s *SymbolRecord) bool
- func IsTestPath(filePath string) bool
- func IsTestSymbol(s *SymbolRecord) bool
- type CallSite
- type CertificationFinding
- type CertificationPolicy
- type CertificationReport
- type ConflictResult
- type DiffInput
- type Edge
- type EdgeType
- type EvidenceRef
- type EvidenceSource
- type FindingSeverity
- type GraphDiff
- type IndexResult
- type IsolatedChangeRegion
- type LineRange
- type LockRecord
- type Status
- type SymbolChange
- type SymbolKind
- type SymbolRecord
- type Verdict
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasTestAnnotation ¶ added in v0.6.0
func HasTestAnnotation(s *SymbolRecord) bool
HasTestAnnotation reports whether the symbol's annotations mark it as a test independent of file naming.
func IsTestPath ¶ added in v0.6.0
IsTestPath reports whether a repo-relative file path follows a test-file convention. Shared by graph edge construction and certification so both agree on what counts as test evidence.
func IsTestSymbol ¶ added in v0.6.0
func IsTestSymbol(s *SymbolRecord) bool
IsTestSymbol reports whether a symbol is a test: either it lives in a test file, or it carries a test annotation (Rust #[test], JUnit @Test, xUnit [Fact]/[Theory], NUnit [Test]/[TestCase], MSTest [TestMethod], pytest markers). Annotation detection covers languages whose tests live alongside production code (notably Rust mod tests).
Types ¶
type CallSite ¶
type CallSite struct {
Callee string `json:"callee"` // bare name; receiver-qualified uses "Receiver.callee"
Line int `json:"line"`
Argc int `json:"argc,omitempty"` // argument count; advisory (0 = none or unknown)
Args []string `json:"args,omitempty"` // bare-identifier argument names ("" for complex exprs)
Generic bool `json:"generic,omitempty"` // call supplies explicit type args (Foo<T>()); splits generic vs non-generic overloads
}
CallSite records one call expression observed inside a symbol's body. AST-extracted call sites enable high-confidence calls edges that do not rely on regex/string-stripping heuristics.
type CertificationFinding ¶ added in v0.4.5
type CertificationFinding struct {
Severity FindingSeverity `json:"severity"`
Code string `json:"code"`
Message string `json:"message"`
Evidence []EvidenceRef `json:"evidence,omitempty"`
}
type CertificationPolicy ¶ added in v0.4.5
type CertificationPolicy struct {
RequireTestsForCode bool `json:"requireTestsForCode"`
}
type CertificationReport ¶ added in v0.4.5
type CertificationReport struct {
Version int `json:"version"`
BaseRef string `json:"baseRef,omitempty"`
HeadRef string `json:"headRef,omitempty"`
ChangedFiles []string `json:"changedFiles"`
ChangedSymbols []SymbolRecord `json:"changedSymbols"`
ImpactedSymbols []SymbolRecord `json:"impactedSymbols"`
Tests []SymbolRecord `json:"tests"`
Unknowns []CertificationFinding `json:"unknowns,omitempty"`
Findings []CertificationFinding `json:"findings,omitempty"`
Verdict Verdict `json:"verdict"`
}
type ConflictResult ¶
type DiffInput ¶ added in v0.4.5
type DiffInput struct {
UnifiedDiff string `json:"unifiedDiff"`
BaseRef string `json:"baseRef,omitempty"`
HeadRef string `json:"headRef,omitempty"`
Policy CertificationPolicy `json:"policy,omitempty"`
}
type Edge ¶
type Edge struct {
From string `json:"from"`
To string `json:"to"`
Type EdgeType `json:"type"`
Confidence float64 `json:"confidence"`
Source EvidenceSource `json:"source,omitempty"`
}
type EdgeType ¶
type EdgeType string
const ( EdgeDefines EdgeType = "defines" EdgeImports EdgeType = "imports" EdgeCalls EdgeType = "calls" EdgeExtends EdgeType = "extends" EdgeImplements EdgeType = "implements" EdgeUsesType EdgeType = "uses-type" EdgeTests EdgeType = "tests" EdgeContains EdgeType = "contains" // EdgeOverrides links a concrete method to the interface symbol that // declares it. Derived for Go by method-set inclusion, since Go // interface satisfaction is implicit. EdgeOverrides EdgeType = "overrides" )
type EvidenceRef ¶ added in v0.4.5
type EvidenceRef struct {
FilePath string `json:"filePath,omitempty"`
BlobSHA string `json:"blobSha,omitempty"`
Span LineRange `json:"span,omitempty"`
SymbolID string `json:"symbolId,omitempty"`
EdgeID string `json:"edgeId,omitempty"`
Source EvidenceSource `json:"source"`
Confidence float64 `json:"confidence"`
Reason string `json:"reason,omitempty"`
}
type EvidenceSource ¶ added in v0.4.5
type EvidenceSource string
const ( EvidenceSourceASTKit EvidenceSource = "astkit" EvidenceSourceTreeSitter EvidenceSource = "tree_sitter" EvidenceSourceNative EvidenceSource = "native" EvidenceSourceHeuristic EvidenceSource = "heuristic" EvidenceSourceRegex EvidenceSource = "regex" EvidenceSourceUnknown EvidenceSource = "unknown" )
type FindingSeverity ¶ added in v0.4.5
type FindingSeverity string
const ( FindingInfo FindingSeverity = "info" FindingWarning FindingSeverity = "warning" FindingError FindingSeverity = "error" )
type GraphDiff ¶ added in v0.6.0
type GraphDiff struct {
Added []SymbolRecord `json:"added"`
Removed []SymbolRecord `json:"removed"`
Changed []SymbolChange `json:"changed"`
// Renamed pairs a removed symbol with an added one whose body is
// identical modulo its own name — a rename or a move, not churn. Only
// unambiguous 1:1 body matches are paired; everything else stays in
// Added/Removed.
Renamed []SymbolChange `json:"renamed,omitempty"`
// BreakingChanges are exported symbols that were removed, renamed, or
// whose signature changed — the contract surface consumers depend on.
BreakingChanges []SymbolChange `json:"breakingChanges"`
}
GraphDiff is the structural delta between two symbol snapshots, keyed by stable identity (file path + qualified name + kind) rather than symbol ID, so a one-line edit — which changes every ID in the file via the content SHA — reports only the symbols whose signature or body actually changed.
type IndexResult ¶
type IndexResult struct {
Root string `json:"root"`
FilesSeen int `json:"filesSeen"`
FilesUpdated int `json:"filesUpdated"`
FilesSkipped int `json:"filesSkipped"`
FilesPruned int `json:"filesPruned"`
SymbolCount int `json:"symbolCount"`
EdgeCount int `json:"edgeCount"`
Errors []string `json:"errors,omitempty"`
Native []string `json:"native,omitempty"`
}
type IsolatedChangeRegion ¶
type IsolatedChangeRegion struct {
IntentID string `json:"intentId"`
Exclusive []string `json:"exclusive"`
Boundary []string `json:"boundary"`
ExclusiveFiles []string `json:"exclusiveFiles"`
ReadableFiles []string `json:"readableFiles"`
Confidence float64 `json:"confidence"`
LockKeys []string `json:"lockKeys"`
}
type LockRecord ¶
type SymbolChange ¶ added in v0.6.0
type SymbolChange struct {
Before *SymbolRecord `json:"before,omitempty"`
After *SymbolRecord `json:"after,omitempty"`
SignatureChanged bool `json:"signatureChanged"`
BodyChanged bool `json:"bodyChanged"`
}
SymbolChange pairs the before/after versions of one logical symbol in a graph diff. After is nil for removals; Before is nil for additions when a change surfaces in BreakingChanges context.
type SymbolKind ¶
type SymbolKind string
const ( KindFunction SymbolKind = "function" KindMethod SymbolKind = "method" KindConstructor SymbolKind = "constructor" KindClass SymbolKind = "class" KindInterface SymbolKind = "interface" KindType SymbolKind = "type" KindConst SymbolKind = "const" KindEnum SymbolKind = "enum" KindModule SymbolKind = "module" KindNamespace SymbolKind = "namespace" KindVariable SymbolKind = "variable" KindField SymbolKind = "field" KindStruct SymbolKind = "struct" KindTrait SymbolKind = "trait" KindDecorator SymbolKind = "decorator" KindAnnotation SymbolKind = "annotation" KindFile SymbolKind = "file" KindDocument SymbolKind = "document" )
type SymbolRecord ¶
type SymbolRecord struct {
ID string `json:"id"`
FilePath string `json:"filePath"`
BlobSHA string `json:"blobSha"`
Language string `json:"language"`
Kind SymbolKind `json:"kind"`
Name string `json:"name"`
QualifiedName string `json:"qualifiedName"`
Signature string `json:"signature"`
Docstring string `json:"docstring,omitempty"`
Span LineRange `json:"span"`
Imports []string `json:"imports,omitempty"`
Exports bool `json:"exports"`
RawText string `json:"rawText,omitempty"`
ParentSymbol string `json:"parentSymbol,omitempty"`
TokenEstimate int `json:"tokenEstimate"`
Modifiers []string `json:"modifiers,omitempty"` // public/private/static/async/abstract/pub/...
TypeParameters []string `json:"typeParameters,omitempty"` // generics
Annotations []string `json:"annotations,omitempty"` // @Override, #[derive(...)], decorators
CallSites []CallSite `json:"callSites,omitempty"` // AST-extracted call invocations
AttrSites []CallSite `json:"attrSites,omitempty"` // attribute accesses outside call position (property reads)
}