Documentation
¶
Overview ¶
Package resolve provides node-resolution queries and their tool adapter.
Index ¶
- Constants
- Variables
- func EffectiveQueryContext(ctx context.Context, budget QueryBudget) (context.Context, context.CancelFunc)
- func EffectiveQueryDeadline(ctx context.Context, budget QueryBudget, now time.Time) time.Time
- func FinalizeQueryResponse(envelope any, completion *QueryCompletionMetadata, maxResponseBytes int) ([]byte, error)
- type BranchesContainingRequest
- type BranchesContainingResult
- type ContainmentSelector
- type ContextNode
- type ContextRequest
- type ContextResult
- type DiffRequest
- type DiffResult
- type Direction
- type Evidence
- type FilterRequest
- type FilterResult
- type FsckTool
- type GraphResult
- type HistoryRequest
- type HistoryResult
- type ImpactRequest
- type ImpactResult
- type MergeApplyRequest
- type MergeConflictsRequest
- type MergeResolveRequest
- type MergeTransactionRequest
- type MetadataPredicate
- type Node
- type Options
- type ProjectionMetadata
- type QueryBudget
- type QueryBudgetRequest
- type QueryCompletionMetadata
- type QueryExecutionMetadata
- type ResolveRequest
- type ResolveResult
- type ResolveTool
- func (t *ResolveTool) FsckTool() *FsckTool
- func (t *ResolveTool) SPLAbortMerge(ctx context.Context, request MergeTransactionRequest) error
- func (t *ResolveTool) SPLApplyMergePreview(ctx context.Context, request MergeApplyRequest) (repository.ObjectID, error)
- func (t *ResolveTool) SPLBranchStagingStatus(ctx context.Context, branch string) (repository.BranchStagingStatus, error)
- func (t *ResolveTool) SPLBranchesContaining(ctx context.Context, selector ContainmentSelector) (BranchesContainingResult, error)
- func (t *ResolveTool) SPLBranchesContainingPage(ctx context.Context, request BranchesContainingRequest) (BranchesContainingResult, error)
- func (t *ResolveTool) SPLCommitStagedMutationBatch(ctx context.Context, request repository.CommitStagedMutationRequest) (repository.CommitStagedMutationResult, error)
- func (t *ResolveTool) SPLCommitStagedMutations(ctx context.Context, branch string) (repository.CommitStagedMutationResult, error)
- func (t *ResolveTool) SPLContext(ctx context.Context, request ContextRequest) (ContextResult, error)
- func (t *ResolveTool) SPLCreateBranch(ctx context.Context, request branch.CreateRequest) (branch.CreateResult, error)
- func (t *ResolveTool) SPLDeleteBranch(ctx context.Context, request branch.DeleteRequest) (branch.DeleteResult, error)
- func (t *ResolveTool) SPLDiff(ctx context.Context, request DiffRequest) (DiffResult, error)
- func (t *ResolveTool) SPLFilter(ctx context.Context, request FilterRequest) (FilterResult, error)
- func (t *ResolveTool) SPLFinalizeMerge(ctx context.Context, request MergeTransactionRequest) (repository.ObjectID, error)
- func (t *ResolveTool) SPLGC(ctx context.Context, options repository.GCOptions) (repository.GCResult, error)
- func (t *ResolveTool) SPLGraph(ctx context.Context, selector SnapshotSelector) (GraphResult, error)
- func (t *ResolveTool) SPLHistory(ctx context.Context, request HistoryRequest) (HistoryResult, error)
- func (t *ResolveTool) SPLImpact(ctx context.Context, request ImpactRequest) (ImpactResult, error)
- func (t *ResolveTool) SPLListBranches(ctx context.Context) (branch.ListResult, error)
- func (t *ResolveTool) SPLMergeConflicts(ctx context.Context, request MergeConflictsRequest) (repository.MergeTransactionStatus, error)
- func (t *ResolveTool) SPLMergePreview(ctx context.Context, sourceBranch, targetBranch string) (repository.MergePreview, error)
- func (t *ResolveTool) SPLPrune(ctx context.Context, request repository.PruneRequest) (repository.PruneResult, error)
- func (t *ResolveTool) SPLResolve(ctx context.Context, request ResolveRequest) (ResolveResult, error)
- func (t *ResolveTool) SPLResolveMerge(ctx context.Context, request MergeResolveRequest) error
- func (t *ResolveTool) SPLSearch(ctx context.Context, request SearchRequest) (SearchResult, error)
- func (t *ResolveTool) SPLSearchExpand(ctx context.Context, request SearchExpandRequest) (SearchExpandResult, error)
- func (t *ResolveTool) SPLStageMutationBatch(ctx context.Context, request repository.StageMutationRequest) (repository.StageMutationResult, error)
- func (t *ResolveTool) SPLStageSchemaMigration(ctx context.Context, request repository.SchemaMigrationRequest) (repository.StageMutationResult, error)
- func (t *ResolveTool) SPLSwitchBranch(ctx context.Context, request branch.SwitchRequest) (branch.SwitchResult, error)
- func (t *ResolveTool) SPLValidateSchema(ctx context.Context, request SchemaValidationRequest) (SchemaValidationResult, error)
- type Resolver
- type SchemaMetadata
- type SchemaValidationRequest
- type SchemaValidationResult
- type SearchExpandRequest
- type SearchExpandResult
- type SearchRequest
- type SearchResult
- type SeedSelector
- type SnapshotMetadata
- type SnapshotSelector
- type SupportingPath
Constants ¶
const ( DirectionOut = contextual.DirectionOut DirectionIn = contextual.DirectionIn DirectionBoth = contextual.DirectionBoth )
Variables ¶
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") )
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 ¶
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 ¶
NewPersistentFsckTool returns a tool that can inspect durable state even when corruption prevents opening the repository normally.
func (*FsckTool) SPLFsck ¶ added in v0.0.2
func (t *FsckTool) SPLFsck(ctx context.Context) (repository.FsckResult, error)
SPLFsck honors cancellation and returns a deterministic integrity report.
type GraphResult ¶ added in v0.0.2
type GraphResult struct {
Snapshot SnapshotMetadata `json:"snapshot"`
Nodes []repository.Node `json:"nodes"`
Edges []repository.Edge `json:"edges"`
}
GraphResult contains every node and edge in one immutable branch snapshot.
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 ¶
func BeginQuery(ctx context.Context, budget QueryBudget) (context.Context, QueryExecutionMetadata, context.CancelFunc)
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) FsckTool ¶
func (t *ResolveTool) FsckTool() *FsckTool
FsckTool returns an integrity-check tool for the repository backing t.
func (*ResolveTool) SPLAbortMerge ¶ added in v0.0.2
func (t *ResolveTool) SPLAbortMerge(ctx context.Context, request MergeTransactionRequest) error
SPLAbortMerge durably abandons a conflicted merge and releases its target lease.
func (*ResolveTool) SPLApplyMergePreview ¶ added in v0.0.2
func (t *ResolveTool) SPLApplyMergePreview(ctx context.Context, request MergeApplyRequest) (repository.ObjectID, error)
SPLApplyMergePreview applies an exact clean preview.
func (*ResolveTool) SPLBranchStagingStatus ¶ added in v0.0.2
func (t *ResolveTool) SPLBranchStagingStatus(ctx context.Context, branch string) (repository.BranchStagingStatus, error)
SPLBranchStagingStatus honors cancellation and returns a branch's shared staging summary.
func (*ResolveTool) SPLBranchesContaining ¶ added in v0.0.2
func (t *ResolveTool) SPLBranchesContaining(ctx context.Context, selector ContainmentSelector) (BranchesContainingResult, error)
SPLBranchesContaining returns the first bounded containment page for selector. SPLBranchesContainingPage accepts continuation and narrowed-budget controls.
func (*ResolveTool) SPLBranchesContainingPage ¶ added in v0.0.2
func (t *ResolveTool) SPLBranchesContainingPage(ctx context.Context, request BranchesContainingRequest) (BranchesContainingResult, error)
SPLBranchesContainingPage returns a deadline-bounded containment page.
func (*ResolveTool) SPLCommitStagedMutationBatch ¶ added in v0.0.2
func (t *ResolveTool) SPLCommitStagedMutationBatch(ctx context.Context, request repository.CommitStagedMutationRequest) (repository.CommitStagedMutationResult, error)
SPLCommitStagedMutationBatch honors cancellation and commits staged mutations with metadata.
func (*ResolveTool) SPLCommitStagedMutations ¶ added in v0.0.2
func (t *ResolveTool) SPLCommitStagedMutations(ctx context.Context, branch string) (repository.CommitStagedMutationResult, error)
SPLCommitStagedMutations honors cancellation and commits a branch's staged mutations.
func (*ResolveTool) SPLContext ¶ added in v0.0.2
func (t *ResolveTool) SPLContext(ctx context.Context, request ContextRequest) (ContextResult, error)
SPLContext returns evidence-focused bounded graph context.
func (*ResolveTool) SPLCreateBranch ¶ added in v0.0.2
func (t *ResolveTool) SPLCreateBranch(ctx context.Context, request branch.CreateRequest) (branch.CreateResult, error)
SPLCreateBranch delegates a context-aware branch creation request.
func (*ResolveTool) SPLDeleteBranch ¶ added in v0.0.2
func (t *ResolveTool) SPLDeleteBranch(ctx context.Context, request branch.DeleteRequest) (branch.DeleteResult, error)
SPLDeleteBranch delegates a context-aware branch deletion request.
func (*ResolveTool) SPLDiff ¶ added in v0.0.2
func (t *ResolveTool) SPLDiff(ctx context.Context, request DiffRequest) (DiffResult, error)
SPLDiff returns a deadline-bounded repository diff page.
func (*ResolveTool) SPLFilter ¶ added in v0.0.2
func (t *ResolveTool) SPLFilter(ctx context.Context, request FilterRequest) (FilterResult, error)
SPLFilter returns a bounded page of nodes selected only through the branch-head projection's typed filter API.
func (*ResolveTool) SPLFinalizeMerge ¶ added in v0.0.2
func (t *ResolveTool) SPLFinalizeMerge(ctx context.Context, request MergeTransactionRequest) (repository.ObjectID, error)
SPLFinalizeMerge commits a fully resolved conflicted merge.
func (*ResolveTool) SPLGC ¶ added in v0.0.2
func (t *ResolveTool) SPLGC(ctx context.Context, options repository.GCOptions) (repository.GCResult, error)
SPLGC 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) SPLGraph ¶ added in v0.0.2
func (t *ResolveTool) SPLGraph(ctx context.Context, selector SnapshotSelector) (GraphResult, error)
SPLGraph returns the complete graph for a branch snapshot.
func (*ResolveTool) SPLHistory ¶ added in v0.0.2
func (t *ResolveTool) SPLHistory(ctx context.Context, request HistoryRequest) (HistoryResult, error)
SPLHistory returns a deadline-bounded repository entity-history page.
func (*ResolveTool) SPLImpact ¶ added in v0.0.2
func (t *ResolveTool) SPLImpact(ctx context.Context, request ImpactRequest) (ImpactResult, error)
SPLImpact returns a deadline-bounded non-persistent impact page.
func (*ResolveTool) SPLListBranches ¶ added in v0.0.2
func (t *ResolveTool) SPLListBranches(ctx context.Context) (branch.ListResult, error)
SPLListBranches delegates a context-aware branch listing request.
func (*ResolveTool) SPLMergeConflicts ¶ added in v0.0.2
func (t *ResolveTool) SPLMergeConflicts(ctx context.Context, request MergeConflictsRequest) (repository.MergeTransactionStatus, error)
SPLMergeConflicts returns the durable preview and resolution state for its owner.
func (*ResolveTool) SPLMergePreview ¶ added in v0.0.2
func (t *ResolveTool) SPLMergePreview(ctx context.Context, sourceBranch, targetBranch string) (repository.MergePreview, error)
SPLMergePreview computes a deterministic, non-mutating three-way merge preview.
func (*ResolveTool) SPLPrune ¶ added in v0.0.6
func (t *ResolveTool) SPLPrune(ctx context.Context, request repository.PruneRequest) (repository.PruneResult, error)
SPLPrune honors cancellation and executes a branch pruning operation.
func (*ResolveTool) SPLResolve ¶ added in v0.0.2
func (t *ResolveTool) SPLResolve(ctx context.Context, request ResolveRequest) (ResolveResult, error)
SPLResolve resolves one node within the effective query deadline.
func (*ResolveTool) SPLResolveMerge ¶ added in v0.0.2
func (t *ResolveTool) SPLResolveMerge(ctx context.Context, request MergeResolveRequest) error
SPLResolveMerge persists a complete, schema-valid conflict resolution.
func (*ResolveTool) SPLSearch ¶ added in v0.0.2
func (t *ResolveTool) SPLSearch(ctx context.Context, request SearchRequest) (SearchResult, error)
SPLSearch returns a bounded page of lexical matches from the branch-head projection. Historical commits fail with ErrHistoricalProjectionUnsupported.
func (*ResolveTool) SPLSearchExpand ¶ added in v0.0.2
func (t *ResolveTool) SPLSearchExpand(ctx context.Context, request SearchExpandRequest) (SearchExpandResult, error)
SPLSearchExpand returns lexical or filter evidence plus bounded graph context.
func (*ResolveTool) SPLStageMutationBatch ¶ added in v0.0.2
func (t *ResolveTool) SPLStageMutationBatch(ctx context.Context, request repository.StageMutationRequest) (repository.StageMutationResult, error)
SPLStageMutationBatch honors cancellation and replaces a branch's shared staged mutations.
func (*ResolveTool) SPLStageSchemaMigration ¶ added in v0.0.2
func (t *ResolveTool) SPLStageSchemaMigration(ctx context.Context, request repository.SchemaMigrationRequest) (repository.StageMutationResult, error)
SPLStageSchemaMigration honors cancellation and atomically stages a target schema with the graph mutations required to conform to it.
func (*ResolveTool) SPLSwitchBranch ¶ added in v0.0.2
func (t *ResolveTool) SPLSwitchBranch(ctx context.Context, request branch.SwitchRequest) (branch.SwitchResult, error)
SPLSwitchBranch delegates a context-aware branch switch request.
func (*ResolveTool) SPLValidateSchema ¶ added in v0.0.2
func (t *ResolveTool) SPLValidateSchema(ctx context.Context, request SchemaValidationRequest) (SchemaValidationResult, error)
SPLValidateSchema honors cancellation and validates one immutable snapshot.
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.