resolve

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package resolve provides node-resolution queries and their tool adapter.

Index

Constants

View Source
const (
	DirectionOut  = contextual.DirectionOut
	DirectionIn   = contextual.DirectionIn
	DirectionBoth = contextual.DirectionBoth
)

Variables

View Source
var (
	// ErrResponseBudgetExceeded reports a response envelope exceeding its byte budget.
	ErrResponseBudgetExceeded = errors.New("query response exceeds byte budget")
	// ErrResponseEncoding reports an envelope that cannot be JSON encoded.
	ErrResponseEncoding = errors.New("query response cannot be JSON encoded")
)
View Source
var (
	// ErrMissingBranch reports a resolution selector without a branch.
	ErrMissingBranch = errors.New("branch is required")
	// ErrUnsupportedCommit reports an explicit commit that policy does not permit.
	ErrUnsupportedCommit = errors.New("commit selectors are not supported")
	// ErrBranchNotFound reports an absent repository branch.
	ErrBranchNotFound = repository.ErrBranchNotFound
	// ErrNodeNotFound reports an absent node in the selected snapshot.
	ErrNodeNotFound = repository.ErrNodeNotFound
)

Functions

func EffectiveQueryContext

func EffectiveQueryContext(ctx context.Context, budget QueryBudget) (context.Context, context.CancelFunc)

EffectiveQueryContext derives a context bounded by both the caller's deadline and the effective query budget deadline. Call cancel when the query completes.

func EffectiveQueryDeadline

func EffectiveQueryDeadline(ctx context.Context, budget QueryBudget, now time.Time) time.Time

EffectiveQueryDeadline returns the earlier of the budget deadline calculated from now and the caller's existing deadline. Zero and negative budget timeouts deliberately produce an already-expired deadline.

func FinalizeQueryResponse

func FinalizeQueryResponse(envelope any, completion *QueryCompletionMetadata, maxResponseBytes int) ([]byte, error)

FinalizeQueryResponse JSON-encodes envelope, records its exact byte count in completion when supplied, and verifies that the completed envelope fits maxResponseBytes. It returns the verified bytes to avoid a later re-encoding changing the accounting.

Types

type BranchesContainingRequest

type BranchesContainingRequest struct {
	// Selector identifies the entity or snapshot to find.
	Selector ContainmentSelector `json:"selector"`
	// ContinuationToken resumes a compatible containment request.
	ContinuationToken string `json:"continuationToken,omitempty"`
	// Budget optionally narrows configured query limits.
	Budget QueryBudgetRequest `json:"budget"`
}

BranchesContainingRequest describes a bounded branch-containment page.

type BranchesContainingResult

type BranchesContainingResult struct {
	// Budget is the effective query budget used by the tool adapter.
	Budget QueryBudget `json:"budget"`
	// Completion reports query completion and full-envelope byte accounting.
	Completion QueryCompletionMetadata `json:"completion"`
	// BranchContainmentResult retains the containment page and continuation token.
	repository.BranchContainmentResult
}

BranchesContainingResult contains a bounded containment page and query metadata.

type ContainmentSelector

type ContainmentSelector = repository.ContainmentSelector

ContainmentSelector is the repository containment selector accepted by ResolveTool.

type ContextNode

type ContextNode = contextual.ContextNode

ContextNode is a graph node with its supporting path from a seed.

type ContextRequest

type ContextRequest = SearchExpandRequest

ContextRequest assembles evidence and related graph context with the same selection and bounding semantics as SearchExpandRequest.

type ContextResult

type ContextResult = SearchExpandResult

ContextResult is the public context-assembly result.

type DiffRequest

type DiffRequest struct {
	// Base identifies the required branch and optional reachable base commit.
	Base SnapshotSelector `json:"base"`
	// Target identifies the required branch and optional reachable target commit.
	Target SnapshotSelector `json:"target"`
	// Filter optionally restricts returned changes.
	Filter repository.DiffFilter `json:"filter,omitempty"`
	// IncludeOneHop requests related unchanged context.
	IncludeOneHop bool `json:"includeOneHop,omitempty"`
	// ContinuationToken resumes a compatible diff request.
	ContinuationToken string `json:"continuationToken,omitempty"`
	// Budget optionally narrows configured query limits.
	Budget QueryBudgetRequest `json:"budget"`
}

DiffRequest combines a repository diff request with optional tool query limits.

type DiffResult

type DiffResult struct {
	// Base identifies the pinned base snapshot.
	Base SnapshotMetadata `json:"base"`
	// Target identifies the pinned target snapshot.
	Target SnapshotMetadata `json:"target"`
	// Projection describes the target snapshot's projection provenance.
	Projection ProjectionMetadata `json:"projection"`
	// Budget is the effective query budget used by the tool adapter.
	Budget QueryBudget `json:"budget"`
	// Completion reports query completion and full-envelope byte accounting.
	Completion QueryCompletionMetadata `json:"completion"`
	// DiffResult retains the bounded diff payload and pagination fields.
	repository.DiffResult
}

DiffResult contains a bounded diff page and provenance for both pinned snapshots.

type Direction

type Direction = contextual.Direction

Direction controls graph edge traversal during contextual retrieval.

type Evidence

type Evidence = contextual.Evidence

Evidence is a lexical or typed-filter seed match.

type FilterRequest

type FilterRequest struct {
	Selector          SnapshotSelector    `json:"selector"`
	Labels            []string            `json:"labels,omitempty"`
	Predicates        []MetadataPredicate `json:"predicates,omitempty"`
	ContinuationToken string              `json:"continuationToken,omitempty"`
	Budget            QueryBudgetRequest  `json:"budget"`
}

FilterRequest selects nodes by labels and typed indexed-property predicates.

type FilterResult

type FilterResult struct {
	Snapshot          SnapshotMetadata        `json:"snapshot"`
	Projection        ProjectionMetadata      `json:"projection"`
	Budget            QueryBudget             `json:"budget"`
	Completion        QueryCompletionMetadata `json:"completion"`
	Nodes             []repository.Node       `json:"nodes"`
	ContinuationToken string                  `json:"continuationToken,omitempty"`
}

FilterResult contains filtered nodes and public snapshot provenance.

type FsckTool

type FsckTool struct {
	// contains filtered or unexported fields
}

FsckTool exposes repository-integrity checks through the context-aware tool surface.

func NewFsckTool

func NewFsckTool(repo *repository.Repository) *FsckTool

NewFsckTool returns a tool that checks an already-open repository.

func NewPersistentFsckTool

func NewPersistentFsckTool(stateDir string) *FsckTool

NewPersistentFsckTool returns a tool that can inspect durable state even when corruption prevents opening the repository normally.

func (*FsckTool) EDGFsck

func (t *FsckTool) EDGFsck(ctx context.Context) (repository.FsckResult, error)

EDGFsck honors cancellation and returns a deterministic integrity report.

type HistoryRequest

type HistoryRequest struct {
	// Selector identifies the required branch and optional reachable starting commit.
	Selector SnapshotSelector `json:"selector"`
	// EntityID identifies the node or edge whose changes are returned.
	EntityID string `json:"entityId"`
	// AllParents includes all parent links rather than only each commit's first parent.
	AllParents bool `json:"allParents,omitempty"`
	// ContinuationToken resumes a compatible history request.
	ContinuationToken string `json:"continuationToken,omitempty"`
	// Budget optionally narrows configured query limits.
	Budget QueryBudgetRequest `json:"budget"`
}

HistoryRequest identifies the branch-constrained history traversal to perform.

type HistoryResult

type HistoryResult struct {
	// Snapshot identifies the pinned snapshot from which history was traversed.
	Snapshot SnapshotMetadata `json:"snapshot"`
	// Projection describes the snapshot's projection provenance.
	Projection ProjectionMetadata `json:"projection"`
	// Budget is the effective query budget used by the tool adapter.
	Budget QueryBudget `json:"budget"`
	// Completion reports query completion and full-envelope byte accounting.
	Completion QueryCompletionMetadata `json:"completion"`
	// HistoryResult retains the entity history payload.
	repository.HistoryResult
}

HistoryResult contains entity history and provenance for its pinned start snapshot.

type ImpactRequest

type ImpactRequest struct {
	// Selector identifies the required branch and optional reachable commit to analyze.
	Selector SnapshotSelector `json:"selector"`
	// Request contains the hypothetical repository impact operation.
	Request repository.ImpactRequest `json:"request"`
	// Budget optionally narrows configured query limits.
	Budget QueryBudgetRequest `json:"budget"`
}

ImpactRequest combines a repository impact request with optional tool query limits.

type ImpactResult

type ImpactResult struct {
	// Snapshot identifies the pinned snapshot analyzed.
	Snapshot SnapshotMetadata `json:"snapshot"`
	// Projection describes the snapshot's projection provenance.
	Projection ProjectionMetadata `json:"projection"`
	// Budget is the effective query budget used by the tool adapter.
	Budget QueryBudget `json:"budget"`
	// Completion reports query completion and full-envelope byte accounting.
	Completion QueryCompletionMetadata `json:"completion"`
	// ImpactResult retains the bounded impact payload.
	repository.ImpactResult
}

ImpactResult contains impact analysis and provenance for its pinned snapshot.

type MergeApplyRequest

type MergeApplyRequest struct {
	SourceBranch  string              `json:"sourceBranch"`
	TargetBranch  string              `json:"targetBranch"`
	TransactionID string              `json:"transactionId"`
	PreviewID     repository.ObjectID `json:"previewId"`
	Author        string              `json:"author,omitempty"`
	Message       string              `json:"message,omitempty"`
}

MergeApplyRequest identifies a reviewed clean preview and its merge commit metadata.

type MergeConflictsRequest

type MergeConflictsRequest struct {
	TargetBranch  string `json:"targetBranch"`
	TransactionID string `json:"transactionId"`
}

MergeConflictsRequest identifies an owning conflicted merge transaction.

type MergeResolveRequest

type MergeResolveRequest = repository.ResolveConflictedMergeRequest

MergeResolveRequest supplies conflict selections and optional corrective mutations.

type MergeTransactionRequest

type MergeTransactionRequest = MergeConflictsRequest

MergeTransactionRequest identifies an owning conflicted merge transaction.

type MetadataPredicate

type MetadataPredicate = repository.MetadataPredicate

MetadataPredicate is a typed equality or range predicate over a schema-indexed node property. It deliberately does not expose projection query syntax.

type Node

type Node = repository.Node

Node is the immutable graph node representation returned by repository resolution.

type Options

type Options struct {
	// AllowDetachedCommit permits explicit commits not reachable from the selected branch.
	AllowDetachedCommit bool
	// QueryBudget provides configured upper bounds for tool queries.
	QueryBudget *QueryBudget
}

Options configures static resolver policy.

type ProjectionMetadata

type ProjectionMetadata struct {
	// NodeRoot identifies the projection watermark when it matches Snapshot.
	NodeRoot string `json:"nodeRoot"`
	// State describes availability for Snapshot. A nonmatching or absent
	// branch-head projection is unavailable.
	State string `json:"state"`
	// SchemaVersion identifies the projection schema version.
	SchemaVersion string `json:"schemaVersion"`
}

ProjectionMetadata describes the node projection returned by resolution.

type QueryBudget

type QueryBudget struct {
	// MaxRows limits diff changes and context entries.
	MaxRows int `json:"maxRows"`
	// MaxResponseBytes limits JSON-encoded diff responses.
	MaxResponseBytes int `json:"maxResponseBytes"`
	// MaxDepth limits impact traversal edge distance.
	MaxDepth int `json:"maxDepth"`
	// MaxVisited limits impact traversal nodes.
	MaxVisited int `json:"maxVisited"`
	// Timeout is the maximum caller-supplied operation duration.
	Timeout time.Duration `json:"timeout"`
}

QueryBudget bounds result size and traversal resources for resolution tools.

func DefaultQueryBudget

func DefaultQueryBudget() QueryBudget

DefaultQueryBudget returns the built-in upper bounds for query execution.

func NormalizeQueryBudget

func NormalizeQueryBudget(request QueryBudgetRequest, configured *QueryBudget) QueryBudget

NormalizeQueryBudget applies configured limits then only request values that narrow them.

type QueryBudgetRequest

type QueryBudgetRequest struct {
	// MaxRows narrows the maximum diff rows.
	MaxRows *int `json:"maxRows,omitempty"`
	// MaxResponseBytes narrows the maximum diff response size.
	MaxResponseBytes *int `json:"maxResponseBytes,omitempty"`
	// MaxDepth narrows the maximum impact depth.
	MaxDepth *int `json:"maxDepth,omitempty"`
	// MaxVisited narrows the maximum impact traversal size.
	MaxVisited *int `json:"maxVisited,omitempty"`
	// Timeout narrows the maximum operation duration.
	Timeout *time.Duration `json:"timeout,omitempty"`
}

QueryBudgetRequest optionally narrows configured query limits.

type QueryCompletionMetadata

type QueryCompletionMetadata struct {
	// Complete reports whether every matching result was returned.
	Complete bool `json:"complete"`
	// Truncated reports whether a query budget omitted matching results.
	Truncated bool `json:"truncated"`
	// TimedOut reports whether the effective query deadline ended a paged query.
	TimedOut bool `json:"timedOut"`
	// Visited reports the number of entries returned in this response page.
	Visited int `json:"visited"`
	// ElapsedMs is the non-negative elapsed execution duration in milliseconds.
	ElapsedMs int64 `json:"elapsedMs"`
	// CompletedAt is when query execution completed.
	CompletedAt time.Time `json:"-"`
	// Duration is the non-negative elapsed execution duration.
	Duration time.Duration `json:"-"`
	// ResponseBytes is the exact size of the JSON response envelope.
	ResponseBytes int `json:"responseBytes"`
}

QueryCompletionMetadata describes a completed query response. ResponseBytes is finalized against the complete JSON envelope, including this metadata.

func CompleteQuery

func CompleteQuery(execution QueryExecutionMetadata, completedAt time.Time) QueryCompletionMetadata

CompleteQuery returns completion metadata for an execution at completedAt.

type QueryExecutionMetadata

type QueryExecutionMetadata struct {
	// Budget is the normalized limit set enforced for the query.
	Budget QueryBudget `json:"budget"`
	// StartedAt is when execution began.
	StartedAt time.Time `json:"startedAt"`
	// Deadline is the earlier of the caller and budget deadlines.
	Deadline time.Time `json:"deadline"`
}

QueryExecutionMetadata describes the limits and timing established for a query. It is intended for embedding in future query response envelopes.

func BeginQuery

BeginQuery establishes an effective query context and returns metadata for the execution. Call the returned cancel function when the query completes.

type ResolveRequest

type ResolveRequest struct {
	// Selector identifies the snapshot to resolve.
	Selector SnapshotSelector `json:"selector"`
	// NodeID identifies the requested node.
	NodeID string `json:"nodeId"`
	// Budget optionally narrows configured query limits.
	Budget QueryBudgetRequest `json:"budget"`
}

ResolveRequest combines a node selector with optional tool query limits.

type ResolveResult

type ResolveResult struct {
	// Node is the resolved immutable node.
	Node Node `json:"node"`
	// Snapshot identifies the commit and graph snapshot read.
	Snapshot SnapshotMetadata `json:"snapshot"`
	// Projection describes the returned node projection.
	Projection ProjectionMetadata `json:"projection"`
	// Budget is the effective query budget used by the tool adapter.
	Budget QueryBudget `json:"budget"`
	// Completion reports query completion and full-envelope byte accounting.
	Completion QueryCompletionMetadata `json:"completion"`
}

ResolveResult contains a node and metadata for its immutable resolved snapshot.

type ResolveTool

type ResolveTool struct {
	// contains filtered or unexported fields
}

ResolveTool adapts resolver, branch, and repository operations to context-aware tool methods.

func NewResolveTool

func NewResolveTool(repo *repository.Repository) *ResolveTool

NewResolveTool returns a tool adapter with default policy and budgets.

func NewResolveToolWithOptions

func NewResolveToolWithOptions(repo *repository.Repository, options Options) *ResolveTool

NewResolveToolWithOptions returns a tool adapter configured with options.

func (*ResolveTool) EDGAbortMerge

func (t *ResolveTool) EDGAbortMerge(ctx context.Context, request MergeTransactionRequest) error

EDGAbortMerge durably abandons a conflicted merge and releases its target lease.

func (*ResolveTool) EDGApplyMergePreview

func (t *ResolveTool) EDGApplyMergePreview(ctx context.Context, request MergeApplyRequest) (repository.ObjectID, error)

EDGApplyMergePreview applies an exact clean preview.

func (*ResolveTool) EDGBranchStagingStatus

func (t *ResolveTool) EDGBranchStagingStatus(ctx context.Context, branch string) (repository.BranchStagingStatus, error)

EDGBranchStagingStatus honors cancellation and returns a branch's shared staging summary.

func (*ResolveTool) EDGBranchesContaining

func (t *ResolveTool) EDGBranchesContaining(ctx context.Context, selector ContainmentSelector) (BranchesContainingResult, error)

EDGBranchesContaining returns the first bounded containment page for selector. EDGBranchesContainingPage accepts continuation and narrowed-budget controls.

func (*ResolveTool) EDGBranchesContainingPage

func (t *ResolveTool) EDGBranchesContainingPage(ctx context.Context, request BranchesContainingRequest) (BranchesContainingResult, error)

EDGBranchesContainingPage returns a deadline-bounded containment page.

func (*ResolveTool) EDGCommitStagedMutationBatch

EDGCommitStagedMutationBatch honors cancellation and commits staged mutations with metadata.

func (*ResolveTool) EDGCommitStagedMutations

func (t *ResolveTool) EDGCommitStagedMutations(ctx context.Context, branch string) (repository.CommitStagedMutationResult, error)

EDGCommitStagedMutations honors cancellation and commits a branch's staged mutations.

func (*ResolveTool) EDGContext

func (t *ResolveTool) EDGContext(ctx context.Context, request ContextRequest) (ContextResult, error)

EDGContext returns evidence-focused bounded graph context.

func (*ResolveTool) EDGCreateBranch

func (t *ResolveTool) EDGCreateBranch(ctx context.Context, request branch.CreateRequest) (branch.CreateResult, error)

EDGCreateBranch delegates a context-aware branch creation request.

func (*ResolveTool) EDGDeleteBranch

func (t *ResolveTool) EDGDeleteBranch(ctx context.Context, request branch.DeleteRequest) (branch.DeleteResult, error)

EDGDeleteBranch delegates a context-aware branch deletion request.

func (*ResolveTool) EDGDiff

func (t *ResolveTool) EDGDiff(ctx context.Context, request DiffRequest) (DiffResult, error)

EDGDiff returns a deadline-bounded repository diff page.

func (*ResolveTool) EDGFilter

func (t *ResolveTool) EDGFilter(ctx context.Context, request FilterRequest) (FilterResult, error)

EDGFilter returns a bounded page of nodes selected only through the branch-head projection's typed filter API.

func (*ResolveTool) EDGFinalizeMerge

func (t *ResolveTool) EDGFinalizeMerge(ctx context.Context, request MergeTransactionRequest) (repository.ObjectID, error)

EDGFinalizeMerge commits a fully resolved conflicted merge.

func (*ResolveTool) EDGGC

EDGGC honors cancellation before beginning the atomic maintenance operation. Once GC starts, it must run to a durable result so cancellation cannot leave a caller uncertain whether publication or cleanup occurred.

func (*ResolveTool) EDGHistory

func (t *ResolveTool) EDGHistory(ctx context.Context, request HistoryRequest) (HistoryResult, error)

EDGHistory returns a deadline-bounded repository entity-history page.

func (*ResolveTool) EDGImpact

func (t *ResolveTool) EDGImpact(ctx context.Context, request ImpactRequest) (ImpactResult, error)

EDGImpact returns a deadline-bounded non-persistent impact page.

func (*ResolveTool) EDGListBranches

func (t *ResolveTool) EDGListBranches(ctx context.Context) (branch.ListResult, error)

EDGListBranches delegates a context-aware branch listing request.

func (*ResolveTool) EDGMergeConflicts

EDGMergeConflicts returns the durable preview and resolution state for its owner.

func (*ResolveTool) EDGMergePreview

func (t *ResolveTool) EDGMergePreview(ctx context.Context, sourceBranch, targetBranch string) (repository.MergePreview, error)

EDGMergePreview computes a deterministic, non-mutating three-way merge preview.

func (*ResolveTool) EDGResolve

func (t *ResolveTool) EDGResolve(ctx context.Context, request ResolveRequest) (ResolveResult, error)

EDGResolve resolves one node within the effective query deadline.

func (*ResolveTool) EDGResolveMerge

func (t *ResolveTool) EDGResolveMerge(ctx context.Context, request MergeResolveRequest) error

EDGResolveMerge persists a complete, schema-valid conflict resolution.

func (*ResolveTool) EDGSearch

func (t *ResolveTool) EDGSearch(ctx context.Context, request SearchRequest) (SearchResult, error)

EDGSearch returns a bounded page of lexical matches from the branch-head projection. Historical commits fail with ErrHistoricalProjectionUnsupported.

func (*ResolveTool) EDGSearchExpand

func (t *ResolveTool) EDGSearchExpand(ctx context.Context, request SearchExpandRequest) (SearchExpandResult, error)

EDGSearchExpand returns lexical or filter evidence plus bounded graph context.

func (*ResolveTool) EDGStageMutationBatch

EDGStageMutationBatch honors cancellation and replaces a branch's shared staged mutations.

func (*ResolveTool) EDGStageSchemaMigration

EDGStageSchemaMigration honors cancellation and atomically stages a target schema with the graph mutations required to conform to it.

func (*ResolveTool) EDGSwitchBranch

func (t *ResolveTool) EDGSwitchBranch(ctx context.Context, request branch.SwitchRequest) (branch.SwitchResult, error)

EDGSwitchBranch delegates a context-aware branch switch request.

func (*ResolveTool) EDGValidateSchema

func (t *ResolveTool) EDGValidateSchema(ctx context.Context, request SchemaValidationRequest) (SchemaValidationResult, error)

EDGValidateSchema honors cancellation and validates one immutable snapshot.

func (*ResolveTool) FsckTool

func (t *ResolveTool) FsckTool() *FsckTool

FsckTool returns an integrity-check tool for the repository backing t.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver resolves nodes against pinned repository commits.

func NewResolver

func NewResolver(repo *repository.Repository) *Resolver

NewResolver returns a resolver with default policy.

func NewResolverWithOptions

func NewResolverWithOptions(repo *repository.Repository, options Options) *Resolver

NewResolverWithOptions returns a resolver using options for commit-selection policy.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, selector SnapshotSelector, nodeID string) (ResolveResult, error)

Resolve pins selector's branch, honors cancellation, and reads nodeID from that immutable commit.

func (*Resolver) ValidateSchema

func (r *Resolver) ValidateSchema(ctx context.Context, selector SnapshotSelector) (SchemaValidationResult, error)

ValidateSchema pins selector's branch and validates that immutable snapshot.

type SchemaMetadata

type SchemaMetadata struct {
	// Root identifies the durable schema object.
	Root string `json:"root"`
	// Version identifies the schema version.
	Version uint16 `json:"version"`
	// Permissive reports whether the schema only enforces graph integrity and
	// global invariants.
	Permissive bool `json:"permissive"`
}

SchemaMetadata identifies the schema used to validate a snapshot.

type SchemaValidationRequest

type SchemaValidationRequest struct {
	// Selector identifies the branch and optional reachable commit.
	Selector SnapshotSelector `json:"selector"`
}

SchemaValidationRequest identifies the snapshot to validate.

type SchemaValidationResult

type SchemaValidationResult struct {
	// Snapshot identifies the commit and graph snapshot validated.
	Snapshot SnapshotMetadata `json:"snapshot"`
	// Projection describes the projection provenance for Snapshot.
	Projection ProjectionMetadata `json:"projection"`
	// Schema identifies the schema applied to Snapshot.
	Schema SchemaMetadata `json:"schema"`
	// Valid reports whether the snapshot conforms to Schema.
	Valid bool `json:"valid"`
	// Violations contains every failed schema constraint when Valid is false.
	Violations []repository.SchemaViolation `json:"violations"`
}

SchemaValidationResult reports conformance of one immutable snapshot.

type SearchExpandRequest

type SearchExpandRequest struct {
	Selector SnapshotSelector `json:"selector"`
	Seeds    SeedSelector     `json:"seeds"`
	// SeedLimit limits evidence before expansion. Zero uses the effective row budget.
	SeedLimit int                `json:"seedLimit,omitempty"`
	Direction Direction          `json:"direction"`
	EdgeTypes []string           `json:"edgeTypes,omitempty"`
	Budget    QueryBudgetRequest `json:"budget"`
}

SearchExpandRequest selects lexical or typed-filter evidence, then expands bounded graph context from those seeds.

type SearchExpandResult

type SearchExpandResult struct {
	Snapshot          SnapshotMetadata        `json:"snapshot"`
	Projection        ProjectionMetadata      `json:"projection"`
	Budget            QueryBudget             `json:"budget"`
	Completion        QueryCompletionMetadata `json:"completion"`
	Evidence          []Evidence              `json:"evidence"`
	Nodes             []ContextNode           `json:"nodes"`
	Edges             []repository.Edge       `json:"edges"`
	Paths             []SupportingPath        `json:"paths"`
	CapacityExhausted bool                    `json:"capacityExhausted,omitempty"`
}

SearchExpandResult contains contextual evidence and graph traversal output with public snapshot and projection provenance.

type SearchRequest

type SearchRequest struct {
	Selector          SnapshotSelector   `json:"selector"`
	Query             string             `json:"query"`
	ContinuationToken string             `json:"continuationToken,omitempty"`
	Budget            QueryBudgetRequest `json:"budget"`
}

SearchRequest selects lexical projection matches from a branch snapshot.

type SearchResult

type SearchResult struct {
	Snapshot          SnapshotMetadata             `json:"snapshot"`
	Projection        ProjectionMetadata           `json:"projection"`
	Budget            QueryBudget                  `json:"budget"`
	Completion        QueryCompletionMetadata      `json:"completion"`
	Matches           []repository.SearchNodeMatch `json:"matches"`
	ContinuationToken string                       `json:"continuationToken,omitempty"`
}

SearchResult contains lexical matches and public snapshot provenance.

type SeedSelector

type SeedSelector = contextual.SeedSelector

SeedSelector selects either lexical evidence or typed metadata-filter evidence.

type SnapshotMetadata

type SnapshotMetadata struct {
	// Repository identifies the repository that resolved the snapshot.
	Repository string `json:"repository"`
	// Branch identifies the requested branch.
	Branch string `json:"branch"`
	// Commit identifies the selected commit.
	Commit string `json:"commit"`
	// Root identifies the selected graph snapshot.
	Root string `json:"root"`
}

SnapshotMetadata identifies the bound repository snapshot used to resolve a node.

type SnapshotSelector

type SnapshotSelector struct {
	// Branch identifies the required branch.
	Branch string `json:"branch"`
	// Commit optionally identifies a commit constrained by resolver policy.
	Commit *string `json:"commit,omitempty"`
}

SnapshotSelector selects a branch and optionally an explicit commit from that branch.

type SupportingPath

type SupportingPath = contextual.SupportingPath

SupportingPath is the canonical path supporting a contextual node.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL