Documentation
¶
Overview ¶
Package externalidentity resolves one canonical, source-scoped external identity without persisting it. Prepared-release publication owns the commit.
Index ¶
Constants ¶
const ContractVersion = "external-identity-v3"
ContractVersion changes whenever identity resolution semantics become incompatible with a previously resolved identity.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandidateEvidence ¶
type CandidateEvidence struct {
Identity api.ExternalIdentity
Metadata api.SourceScopedMetadata
Candidates []api.ExternalIdentityCandidate
}
CandidateEvidence is temporary provider-resolution evidence supplied by a private adapter. Candidate lists remain diagnostics and never become canonical identity facts by themselves.
type CandidateSource ¶
type CandidateSource interface {
ResolveIdentityCandidate(context.Context, Request) (CandidateEvidence, error)
}
CandidateSource supplies provider evidence without persistence. It exists at the resolver boundary so provider clients remain private implementation details rather than request fields.
type EvidenceFingerprint ¶
EvidenceFingerprint identifies one non-secret evidence snapshot considered during resolution. Digest is a lowercase hexadecimal SHA-256 hash.
type Request ¶
type Request struct {
SourcePath string
SourceFingerprint string
Generation api.PreparedGeneration
Intent ResolutionIntent
}
Request contains normalized source scope and identity-resolution intent. It carries no gathered MediaInfo, scene, Arr, tracker, or provider evidence.
type ResolutionIntent ¶
type ResolutionIntent struct {
Title string
Year int
Season int
Episode int
TrackerContext []string
ProviderOverrides api.ExternalIDOverrides
// IdentityResetFields excludes prior explicit pins returned to Auto.
IdentityResetFields []api.CorrectionField
CategoryOverride *api.CanonicalCategory
ReResolve bool
RefreshProviderMetadata bool
}
ResolutionIntent contains caller instructions that affect canonical identity resolution and its lineage fingerprint. Provider override pointers use nil to preserve evidence, non-positive values to clear an ID, and positive values to set one. CategoryOverride similarly preserves on nil, clears on empty or unknown, and accepts movie or TV as explicit values.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver owns identity evidence precedence, tri-state overrides, source serialization, diagnostics, and immutable result projection.
func New ¶
func New(repo api.ReleaseStateRepository) (*Resolver, error)
New constructs a resolver using the repository only as a private legacy evidence adapter. Resolve never writes through it.
func NewWithCandidateSource ¶
func NewWithCandidateSource(repo api.ReleaseStateRepository, candidate CandidateSource) (*Resolver, error)
NewWithCandidateSource constructs a resolver with an optional, read-only provider evidence source. Neither source can publish canonical state.
func (*Resolver) Resolve ¶
Resolve serializes work per normalized source, applies stored evidence then provider candidates then explicit overrides, and returns a detached, unpersisted result. Provider metadata whose ID no longer matches the final identity is removed; absent IDs and category are reported through Result.MissingRequirements rather than as an error.
type Result ¶
type Result struct {
Identity api.ExternalIdentity
ProviderMetadata api.SourceScopedMetadata
Diagnostics []api.PreparationDiagnostic
MissingRequirements []api.MissingRequirementError
EvidenceFingerprints []EvidenceFingerprint
}
Result contains the canonical identity candidate, source-scoped provider metadata, diagnostics, typed missing requirements, and evidence lineage. The prepared-release module decides whether and how to commit it.