Documentation
¶
Overview ¶
Package resolve maps a brand, domain, repo slug, package, or product name to its canonical entity id by querying the fact store facts in memory.
Feature: cli/studio/answers (REQ: resolve-verb, REQ: resolve-ambiguous-and-unknown)
Resolution is case-insensitive and draws candidates from two sources:
- aliased-as facts: the object of an (entity, aliased-as, <name>) fact maps <name> back to the entity subject (the canonical id).
- entity ids present in the store as subjects or objects of any fact.
Results are Unique (one canonical id + the citing fact), Ambiguous (two or more distinct canonical ids + their citations), or NotFound. The function is pure — no store, no network access — so it is directly consumed by both the `studio resolve` verb and the `studio ask` router (Task 4).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
Candidate is one resolution candidate: a canonical entity id and the fact that cites it (either the aliased-as fact whose object matched, or the first fact in the store whose subject/object equals the entity id).
type Kind ¶
type Kind int
Kind classifies the outcome of a Resolve call.
const ( // Unique means exactly one canonical id was found; Result.ID and // Result.Citation are populated. Unique Kind = iota // Ambiguous means more than one distinct canonical id matched the name; // Result.Candidates is populated. Ambiguous // NotFound means no candidate canonical id matched the name. NotFound )
type Result ¶
type Result struct {
Kind Kind
// ID is the canonical entity id for Unique results.
ID string
// Citation is the citing fact for Unique results.
Citation fact.Fact
// Candidates is the set of matching candidates for Ambiguous results.
Candidates []Candidate
}
Result is the outcome of a Resolve call.