resolver

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candidate

type Candidate struct {
	Binding    domain.Binding
	Confidence float64
	Reason     string
}

Candidate is a place an anchor might belong, offered for a human (or an agent) to accept or reject.

type Request

type Request struct {
	Anchor  domain.Anchor
	Content string
	Symbols []domain.Symbol
	// Lines maps the anchor's recorded line numbers onto the current content
	// using git history. Nil when no diff base is available, in which case
	// resolution falls back to matching on text alone.
	Lines *gitmap.LineMap
}

Request is everything resolution needs about one anchor at one moment.

type Resolution

type Resolution struct {
	Binding    domain.Binding
	Status     domain.AnchorStatus
	Reason     string
	Confidence float64
}

func Stale

func Stale(binding domain.Binding, reason string) Resolution

Stale marks a binding as unresolvable while preserving its recorded position, so the anchor keeps pointing at its last known location for a human to fix.

type Service

type Service struct{}

func New

func New() *Service

func (*Service) Candidates

func (s *Service) Candidates(request Request, limit int) []Candidate

Candidates proposes relocations for an anchor that automatic resolution could not place, ranked most plausible first.

Where Resolve stops at the first strategy confident enough to act on its own, this gathers every strategy's opinion, including the near-misses Resolve rejects. A stale anchor is precisely the case where no single strategy was certain, so the useful output is a shortlist, not a verdict.

func (*Service) Resolve

func (s *Service) Resolve(request Request) (Resolution, error)

Resolve locates an anchor in the current content, trying strategies from most to least certain and stopping at the first that holds up.

Jump to

Keyboard shortcuts

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