Documentation
¶
Index ¶
- type CorpusCandidate
- type Diagnostic
- type Engine
- func (e *Engine) AmbiguousCorpora() []CorpusCandidate
- func (e *Engine) Bindings(label string) string
- func (e *Engine) DiagnosticResult(kind, code, message string) Result
- func (e *Engine) Explain(label string) string
- func (e *Engine) ExplainResult(label string) Result
- func (e *Engine) ExploreResult(request string, limit int) Result
- func (e *Engine) FindNode(term string) (types.Node, bool)
- func (e *Engine) Freshness() Freshness
- func (e *Engine) Graph() *types.Graph
- func (e *Engine) ImpactResult(subject string, limit int) Result
- func (e *Engine) Lookup(term string, limit int) []LookupCandidate
- func (e *Engine) LookupResult(term string, limit int) Result
- func (e *Engine) Neighbors(label string) ([]Neighbor, error)
- func (e *Engine) NodeByID(id string) (types.Node, bool)
- func (e *Engine) Path(fromLabel, toLabel string) string
- func (e *Engine) PathResult(from, to string) Result
- func (e *Engine) Query(input string) string
- func (e *Engine) RenderExplore(request string, limit int) string
- func (e *Engine) RenderLookup(term string, limit int) string
- func (e *Engine) Route(input string) string
- func (e *Engine) RunRequest(req types.QueryRequest) (string, error)
- func (e *Engine) Search(term string, limit int) []types.Node
- func (e *Engine) SetAmbiguousCorpora(candidates []CorpusCandidate)
- func (e *Engine) Stats() GraphStats
- func (e *Engine) StatusResult() Result
- func (e *Engine) UnavailableDiagnostic() *UnavailableDiagnostic
- type Fact
- type Freshness
- type FreshnessStatus
- type GraphStats
- type LookupCandidate
- type Neighbor
- type Result
- type ResultStatus
- type Subject
- type UnavailableDiagnostic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorpusCandidate ¶ added in v1.10.2
CorpusCandidate identifies a graph corpus that needs caller disambiguation.
type Diagnostic ¶ added in v1.7.3
Diagnostic carries structured warnings or errors without hiding available facts.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine wraps a loaded graph and answers queries against it.
func LoadFromFile ¶
LoadFromFile opens a runtime query graph. Repo-local .vela/graph.json paths locate the sibling v0.4 SQLite runtime store; graph.json remains export/debug context and is not used as query truth.
func NewUnavailableEngine ¶ added in v1.10.2
func NewUnavailableEngine(diagnostic UnavailableDiagnostic) *Engine
NewUnavailableEngine returns an empty engine that reports a selected graph diagnostic instead of answering from fallback corpora.
func (*Engine) AmbiguousCorpora ¶ added in v1.10.2
func (e *Engine) AmbiguousCorpora() []CorpusCandidate
AmbiguousCorpora returns graph candidates that should be disambiguated before answering.
func (*Engine) Bindings ¶ added in v1.4.0
Bindings returns queryable memory reference binder state for the given node.
func (*Engine) DiagnosticResult ¶ added in v1.7.3
DiagnosticResult returns structured adapter diagnostics when a tool cannot run.
func (*Engine) ExplainResult ¶ added in v1.7.3
ExplainResult returns a shared core result for explain answers with proof metadata.
func (*Engine) ExploreResult ¶ added in v1.7.3
ExploreResult returns structured broad-request resolution data for MCP agents.
func (*Engine) FindNode ¶ added in v1.5.0
FindNode resolves a node by ID, exact label, or fuzzy label match.
func (*Engine) Freshness ¶ added in v1.7.3
Freshness reports the runtime graph freshness state attached at load time.
func (*Engine) ImpactResult ¶ added in v1.7.3
ImpactResult returns structured reverse-dependency facts for an MCP impact query.
func (*Engine) Lookup ¶ added in v1.7.1
func (e *Engine) Lookup(term string, limit int) []LookupCandidate
Lookup returns ranked node candidates for a broad term without pretending to answer a structural graph question directly.
func (*Engine) LookupResult ¶ added in v1.7.3
LookupResult returns structured candidate resolution data for MCP agents.
func (*Engine) Neighbors ¶ added in v1.5.0
Neighbors returns all incoming and outgoing edges for the given node.
func (*Engine) Path ¶
Path finds the shortest directed path from nodeA to nodeB. Returns a human-readable string.
func (*Engine) PathResult ¶ added in v1.7.3
PathResult returns structured endpoint and path facts for an MCP path query.
func (*Engine) RenderExplore ¶ added in v1.7.3
RenderExplore resolves broad natural language to candidate graph subjects and cites only graph relationships as proof for the returned context.
func (*Engine) RenderLookup ¶ added in v1.7.1
RenderLookup formats ranked candidates with enough metadata to pick an exact subject for follow-up structural graph queries.
func (*Engine) RunRequest ¶ added in v1.7.1
func (e *Engine) RunRequest(req types.QueryRequest) (string, error)
RunRequest executes the reduced graph-truth query contract used by the new CLI, TUI, server, and MCP surfaces.
func (*Engine) SetAmbiguousCorpora ¶ added in v1.10.2
func (e *Engine) SetAmbiguousCorpora(candidates []CorpusCandidate)
SetAmbiguousCorpora records same-name graph candidates selected without an explicit workspace/root.
func (*Engine) Stats ¶ added in v1.5.0
func (e *Engine) Stats() GraphStats
Stats returns a structured graph summary.
func (*Engine) StatusResult ¶ added in v1.7.3
StatusResult returns structured runtime graph status for adapter responses.
func (*Engine) UnavailableDiagnostic ¶ added in v1.10.2
func (e *Engine) UnavailableDiagnostic() *UnavailableDiagnostic
UnavailableDiagnostic returns the active graph diagnostic that should preempt graph answers.
type Fact ¶ added in v1.7.3
type Fact struct {
Subject string `json:"subject"`
Predicate string `json:"predicate"`
Object string `json:"object"`
Evidence []types.Evidence `json:"evidence,omitempty"`
Confidence types.Confidence `json:"confidence,omitempty"`
Source string `json:"source,omitempty"`
Layer types.Layer `json:"layer,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Fact is a graph-backed claim used by a query answer.
type Freshness ¶ added in v1.7.3
type Freshness struct {
Status FreshnessStatus `json:"status"`
Source string `json:"source,omitempty"`
SelectedGraphPath string `json:"selected_graph_path,omitempty"`
Project string `json:"project,omitempty"`
WorkspaceRoot string `json:"workspace_root,omitempty"`
GraphUpdatedAt string `json:"graph_updated_at,omitempty"`
Reason string `json:"reason,omitempty"`
StaleFiles []string `json:"stale_files,omitempty"`
RecommendedActions []string `json:"recommended_actions,omitempty"`
}
Freshness describes whether graph data used by a Result is fresh enough to trust.
type FreshnessStatus ¶ added in v1.7.3
type FreshnessStatus string
FreshnessStatus qualifies the runtime graph state used by a result.
const ( FreshnessUnknown FreshnessStatus = "unknown" FreshnessFresh FreshnessStatus = "fresh" FreshnessWarming FreshnessStatus = "warming" FreshnessStale FreshnessStatus = "stale" )
type GraphStats ¶ added in v1.5.0
type GraphStats struct {
NodeCount int
EdgeCount int
CommunityCount int
NodeTypes map[string]int
ConfidenceTypes map[string]int
}
GraphStats summarizes the graph contents for diagnostics and MCP output.
type LookupCandidate ¶ added in v1.7.1
LookupCandidate is a ranked node suggestion for broad discovery queries.
type Neighbor ¶ added in v1.5.0
Neighbor describes a directly connected node and the edge relating it.
type Result ¶ added in v1.7.3
type Result struct {
SchemaVersion string `json:"schema_version"`
QueryKind string `json:"query_kind"`
Status ResultStatus `json:"status"`
ResolvedSubjects []Subject `json:"resolved_subjects,omitempty"`
Facts []Fact `json:"facts,omitempty"`
Evidence []types.Evidence `json:"evidence,omitempty"`
Confidence types.Confidence `json:"confidence,omitempty"`
Freshness Freshness `json:"freshness"`
Diagnostics []Diagnostic `json:"diagnostics"`
Answer string `json:"answer,omitempty"`
RelevantSource []string `json:"relevant_source,omitempty"`
PathsAndRelationships []Fact `json:"paths_and_relationships,omitempty"`
ImpactRadius string `json:"impact_radius,omitempty"`
LayeredEvidence []Fact `json:"layered_evidence,omitempty"`
ConfidenceAndLimits string `json:"confidence_and_limits,omitempty"`
SuggestedNextQueries []string `json:"suggested_next_queries,omitempty"`
InterpretedIntent string `json:"interpreted_intent,omitempty"`
}
Result is the minimal adapter-independent envelope for graph-backed answers.
type ResultStatus ¶ added in v1.7.3
type ResultStatus string
ResultStatus classifies the shared core query result before adapter rendering.
const ( ResultStatusOK ResultStatus = "ok" ResultStatusPartial ResultStatus = "partial" ResultStatusAmbiguous ResultStatus = "ambiguous" ResultStatusUnresolved ResultStatus = "unresolved" ResultStatusError ResultStatus = "error" )
type Subject ¶ added in v1.7.3
type Subject struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
Kind string `json:"kind,omitempty"`
}
Subject is a resolved graph subject included in a shared Result.
type UnavailableDiagnostic ¶ added in v1.10.2
type UnavailableDiagnostic struct {
}
UnavailableDiagnostic explains why the selected active graph cannot answer queries.