api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: GPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AudioAnalysisStatsMaxBytes bounds the retained amplitude report.
	AudioAnalysisStatsMaxBytes = 64 << 10

	// AudioAnalysisDefaultDecoderThreads is used when a request leaves DecoderThreads at zero.
	AudioAnalysisDefaultDecoderThreads = 2
	// AudioAnalysisMaxDecoderThreads is the largest accepted decoder thread request.
	AudioAnalysisMaxDecoderThreads = 16
)
View Source
const (
	HDRAnalysisProfileVersion  = "hdr-analysis-v1"
	HDRExtractionSchemaVersion = "hdr-extraction-v1"
	HDRAnalysisMaxTargets      = 16
	HDRAnalysisWidth           = 3000
	HDRAnalysisHeight          = 1200
)
View Source
const (
	HDRAnalysisProfileV2  = "hdr-analysis-v2"
	HDRExtractionSchemaV2 = "hdr-extraction-v2"
)
View Source
const (
	// ReleaseNameElementPolicyVersionV1 identifies the first shared release-name element contract.
	ReleaseNameElementPolicyVersionV1 = "release-name-elements/v1"
	// ReleaseNamePresentationVersionV1 identifies the finalized release-name presentation contract.
	ReleaseNamePresentationVersionV1 = "release-name-presentation/v1"
)
View Source
const (
	// SourceContentIdentitySampleBytes is the largest initial file sample included in a source identity.
	SourceContentIdentitySampleBytes int64 = 1 << 20
	// SourceContentIdentityVersion identifies the bounded source-sample digest format.
	SourceContentIdentityVersion = "source-content-sample-v2"
	// SubmissionContentIdentityVersion identifies the submitted-inventory digest derived from source samples.
	SubmissionContentIdentityVersion = "submission-content-sample-v2"
)
View Source
const AudioAnalysisProfileVersion = "audio-analysis-v3"

AudioAnalysisProfileVersion identifies the numerical, report, and raster profile required for new analysis attempts. Historical v2 results remain readable, but new instructions must use this version.

View Source
const HDRAnalysisProfileV3 = "hdr-analysis-v3"

HDRAnalysisProfileV3 identifies track-aware audio and bounded picture outcomes with explicit execution coverage and independent measurement/render identities.

View Source
const ImportedScreenshotEvidencePolicyVersion = "imported-screenshot-reference-v1"

ImportedScreenshotEvidencePolicyVersion invalidates receipts when their acceptance boundary changes. Legacy image metadata is not a receipt.

View Source
const MaxLiveTestImageUploads = 500

MaxLiveTestImageUploads is the process-enforced ceiling for one run's journaled remote image attempts.

View Source
const (
	// ReleaseNameDocumentVersionV1 identifies the first structured generated-name representation.
	ReleaseNameDocumentVersionV1 = "release-name-document/v1"
)
View Source
const (
	// ReleaseWorkflowAPIVersion is the public composite-workflow contract version.
	ReleaseWorkflowAPIVersion = "1.0.0"
)
View Source
const (
	// RequiredActionReconcileNotCompleted confirms the external effect did not complete and may be retried.
	RequiredActionReconcileNotCompleted = "not_completed"
)

Variables

View Source
var (
	ErrInputRecordNotFound  = errors.New("input record: not found")
	ErrActiveInputBusy      = errors.New("active input: busy")
	ErrActiveInputChanged   = errors.New("active input: changed")
	ErrActiveInputLeaseLost = errors.New("active input: coordinator lease lost")
)
View Source
var (
	// ErrCorrectionConflict identifies invalid or incompatible correction changes.
	ErrCorrectionConflict = errors.New("release correction conflict")
	// ErrUnsupportedCorrectionVersion identifies a persisted correction payload
	// that this binary must leave untouched.
	ErrUnsupportedCorrectionVersion = errors.New("unsupported release correction version")
)
View Source
var (
	// ErrMissingReleaseStateRepository indicates incomplete repository composition.
	ErrMissingReleaseStateRepository = errors.New("api: release state repository is required")
	// ErrMissingPreparedReleaseRepository indicates incomplete prepared-generation persistence.
	ErrMissingPreparedReleaseRepository = errors.New("api: prepared release repository is required")
	// ErrMissingMetadataEvidenceRepository indicates incomplete lookup-evidence persistence.
	ErrMissingMetadataEvidenceRepository = errors.New("api: metadata evidence repository is required")
	// ErrMissingReleaseSelectionRepository indicates incomplete repository composition.
	ErrMissingReleaseSelectionRepository = errors.New("api: release selection repository is required")
	// ErrMissingHistoryRepository indicates incomplete repository composition.
	ErrMissingHistoryRepository = errors.New("api: history repository is required")
	// ErrMissingUploadLedgerRepository indicates incomplete repository composition.
	ErrMissingUploadLedgerRepository = errors.New("api: upload ledger repository is required")
	// ErrMissingTrackerStateRepository indicates incomplete repository composition.
	ErrMissingTrackerStateRepository = errors.New("api: tracker state repository is required")
	// ErrMissingMediaAssetRepository indicates incomplete repository composition.
	ErrMissingMediaAssetRepository = errors.New("api: media asset repository is required")
	// ErrMissingReleaseWorkflowStateRepository indicates incomplete workflow persistence.
	ErrMissingReleaseWorkflowStateRepository = errors.New("api: release workflow state repository is required")
	// ErrReleaseWorkflowStateNotFound hides absent and foreign-owner workflow rows.
	ErrReleaseWorkflowStateNotFound = errors.New("api: release workflow state not found")
	// ErrReleaseWorkflowRevisionConflict reports an optimistic workflow update conflict.
	ErrReleaseWorkflowRevisionConflict = errors.New("api: release workflow revision conflict")
	// ErrReleaseWorkflowIdempotencyConflict reports reuse of a creation key with different input.
	ErrReleaseWorkflowIdempotencyConflict = errors.New("api: release workflow idempotency conflict")
	// ErrReleaseWorkflowOperationNotFound hides absent and foreign-owner operation rows.
	ErrReleaseWorkflowOperationNotFound = errors.New("api: release workflow operation not found")
	// ErrReleaseWorkflowOperationConflict reports active-operation or operation idempotency conflicts.
	ErrReleaseWorkflowOperationConflict = errors.New("api: release workflow operation conflict")
	// ErrReleaseWorkflowOperationSequenceConflict reports a concurrent progress update.
	ErrReleaseWorkflowOperationSequenceConflict = errors.New("api: release workflow operation sequence conflict")
	// ErrReleaseWorkflowEffectOutcomeUnknown reports a prior started effect with no terminal receipt.
	ErrReleaseWorkflowEffectOutcomeUnknown = errors.New("api: release workflow external effect outcome is unknown")
	// ErrReleaseWorkflowEffectAlreadySucceeded reports a completed semantic effect that must not be replayed.
	ErrReleaseWorkflowEffectAlreadySucceeded = errors.New("api: release workflow external effect already succeeded")
	// ErrReleaseWorkflowEffectConflict reports invalid effect identity or lifecycle reuse.
	ErrReleaseWorkflowEffectConflict = errors.New("api: release workflow external effect conflict")
	// ErrSubmissionFenceNotFound reports no durable submission fence for one exact content/site key.
	ErrSubmissionFenceNotFound = errors.New("api: submission fence not found")
)
View Source
var ErrConfigActivationChanged = errors.New("config activation: generation changed")

ErrConfigActivationChanged reports that an admitted runtime bundle no longer matches the durable effective configuration.

View Source
var ErrConfigActivationPending = errors.New("config activation: pending")

ErrConfigActivationPending reports that a different validated effective configuration is already waiting for durable workflow cleanup.

View Source
var ErrLiveTestMutationDisabled = errors.New("live testing prohibits tracker submission and torrent-client writes")

ErrLiveTestMutationDisabled identifies a write forbidden by the process policy.

View Source
var ErrPreparationSourceRequired = errors.New("preparation source path is required")

ErrPreparationSourceRequired reports a request without a preparation source.

Functions

func AggregateDVDVOBMediaInfo added in v0.3.2

func AggregateDVDVOBMediaInfo(discs []DiscEvidenceResource, fallback string) string

AggregateDVDVOBMediaInfo returns deterministic plain-text DVD evidence in disc order. One prepared DVD remains unchanged after trimming; collections receive safe disc headings.

func BeginPreparationProgress added in v0.3.0

func BeginPreparationProgress(
	ctx context.Context,
	phase PreparationProgressPhase,
	message string,
) func(error)

BeginPreparationProgress emits a running event and returns a completion callback. The callback never replaces or modifies the operation error.

func CleanReleaseNameFilename added in v0.3.5

func CleanReleaseNameFilename(name string) string

CleanReleaseNameFilename applies canonical filename character substitutions to a release name or an individual component, without interpreting naming roles.

func CompleteWorkflowExternalEffect added in v0.3.0

func CompleteWorkflowExternalEffect(
	ctx context.Context,
	receipt WorkflowExternalEffectReceipt,
	succeeded bool,
) error

CompleteWorkflowExternalEffect persists a known success or failure receipt. Empty receipts, already-succeeded attempts, and absent reporters are no-ops; an uncertain remote outcome must not be reported as a known failure.

func CountBlockingRuleFailures added in v0.2.5

func CountBlockingRuleFailures(failures []TrackerRuleFailure) int

CountBlockingRuleFailures returns the number of unresolved rule results that block tracker work. Authorized waivable results do not block.

func CountDistinctScreenshotReferences added in v0.4.1

func CountDistinctScreenshotReferences(all, included []ScreenshotReference) int

CountDistinctScreenshotReferences counts included images after merging aliases in all references. A shared selected identity or full URL identifies one image.

func DetectedFileSeason added in v0.4.1

func DetectedFileSeason(fileName string) (int, bool)

DetectedFileSeason returns the first season token in a source file's basename. It shares tracker package validation semantics, including season zero; release titles and metadata overrides do not participate in this evidence.

func EditionDisplayText added in v0.4.1

func EditionDisplayText(parts []EditionDisplayPart) string

EditionDisplayText joins prepared display fragments in their original order without deriving wording or edition evidence from their feature classifications.

func EditionNamingText added in v0.4.1

func EditionNamingText(parts []EditionDisplayPart) string

EditionNamingText omits subtype fragments rendered by the independent 3D role. Other display consumers can still use the complete EditionDisplayText.

func EmitDupeProgress

func EmitDupeProgress(ctx context.Context, update DupeProgressUpdate)

func EmitImageUploadProgress added in v0.3.0

func EmitImageUploadProgress(ctx context.Context, update ImageUploadProgressUpdate)

EmitImageUploadProgress reports one absolute snapshot when a reporter is installed.

func EmitPreparationProgress added in v0.3.0

func EmitPreparationProgress(ctx context.Context, update PreparationProgressUpdate)

EmitPreparationProgress reports one update when a reporter is installed.

func EmitUploadProgress

func EmitUploadProgress(ctx context.Context, update UploadProgressUpdate)

EmitUploadProgress synchronously invokes the reporter attached to ctx, when present.

func EmitWorkflowProgress added in v0.3.0

func EmitWorkflowProgress(ctx context.Context, update WorkflowProgressUpdate)

EmitWorkflowProgress reports one generic workflow progress snapshot.

func HDRTargetID added in v0.4.1

func HDRTargetID(resourceIdentity, playlist string) string

HDRTargetID creates an opaque stable resource/playlist identity without exposing its input.

func HasBlockingRuleFailures added in v0.2.5

func HasBlockingRuleFailures(failures []RuleFailure) bool

HasBlockingRuleFailures reports whether any rule result blocks tracker work.

func HistoryStatusLabel added in v0.2.5

func HistoryStatusLabel(rawStatus string, ruleFailureCount int) string

HistoryStatusLabel returns the display label for a persisted upload status, falling back to rule-issue or stored state when no status is available.

func IsBlockingRuleFailure added in v0.2.5

func IsBlockingRuleFailure(failure RuleFailure) bool

IsBlockingRuleFailure reports whether a rule result blocks tracker work.

func IsDiscMenuSelectionSource added in v0.2.4

func IsDiscMenuSelectionSource(source string) bool

IsDiscMenuSelectionSource reports whether a final-selection source belongs to either manually imported or automatically captured disc menus.

func IsNativeHDRProfile added in v0.4.1

func IsNativeHDRProfile(profile string) bool

IsNativeHDRProfile identifies profiles with independent native format outcomes.

func IsStrictRuleFailure added in v0.3.0

func IsStrictRuleFailure(failure RuleFailure) bool

IsStrictRuleFailure reports whether a rule result can never be authorized.

func IsSupportedReleaseVersion added in v0.4.0

func IsSupportedReleaseVersion(value string) bool

IsSupportedReleaseVersion reports whether value names a supported release version or explicitly clears it. Matching ignores case and surrounding whitespace without changing value.

func IsThreeDSubtype added in v0.4.1

func IsThreeDSubtype(feature ReleaseFeature) bool

IsThreeDSubtype identifies existing stereoscopic subtype facts, not a mixed 2D/3D edition set.

func IsWaivableRuleFailure added in v0.3.0

func IsWaivableRuleFailure(failure RuleFailure) bool

IsWaivableRuleFailure reports whether exact authorization may unblock a result.

func NewAudioAnalysisError added in v0.3.5

func NewAudioAnalysisError(failure AudioAnalysisFailure, cause error) error

NewAudioAnalysisError returns a typed audio-analysis error when failure is valid. Invalid failure values are converted to a generic resource failure.

func NewHDRAnalysisError added in v0.4.1

func NewHDRAnalysisError(failure HDRAnalysisFailure, cause error) error

NewHDRAnalysisError wraps cause and substitutes resource_unavailable for an invalid failure.

func NormalizeHDRPlaylist added in v0.4.1

func NormalizeHDRPlaylist(value string) (string, error)

NormalizeHDRPlaylist accepts only a numeric MPLS basename, never a path.

func NormalizeReleaseFactInstructionsCategory added in v0.3.2

func NormalizeReleaseFactInstructionsCategory(instructions *ReleaseFactInstructions) error

NormalizeReleaseFactInstructionsCategory normalizes both legacy category representations.

func NormalizeReleasePresentation added in v0.4.1

func NormalizeReleasePresentation(value string) (string, bool)

NormalizeReleasePresentation accepts only supported complete presentation labels. The empty label explicitly clears detection.

func ParseLogLevel

func ParseLogLevel(value string) (string, error)

func ReleaseFeatureLabel added in v0.4.1

func ReleaseFeatureLabel(feature ReleaseFeature) string

ReleaseFeatureLabel supplies the shared correction and manual naming vocabulary. Unknown values return empty so callers cannot silently accept unsupported facts.

func ReportDVDMenuProgress added in v0.2.4

func ReportDVDMenuProgress(ctx context.Context, update DVDMenuProgressUpdate)

ReportDVDMenuProgress synchronously sends update to the reporter stored in ctx, if any. A nil context is ignored.

func SetApplicationBuild

func SetApplicationBuild(version string, buildIdentifier string)

SetApplicationBuild stores trimmed build metadata returned by CurrentApplicationInfo.

func SkipPreparationProgress added in v0.3.0

func SkipPreparationProgress(ctx context.Context, phase PreparationProgressPhase, message string)

SkipPreparationProgress records an intentional cache or policy bypass.

func SourceNameWithoutThreeD added in v0.4.1

func SourceNameWithoutThreeD(source string) string

SourceNameWithoutThreeD separates the recognized Blu-ray 3D source label for display only. Callers retain the original source fact and decide when its marker is rendered separately or explicitly suppressed.

func ThreeDName added in v0.4.1

func ThreeDName(detected string, features []ReleaseFeature) string

ThreeDName returns a single generic marker for measured 3D or a recognized subtype. Naming preserves subtype facts and does not establish measured 3D evidence.

func ValidHDRTargetID added in v0.4.1

func ValidHDRTargetID(id string) bool

func WithActiveInputAuthority added in v0.3.5

func WithActiveInputAuthority(ctx context.Context, authority ActiveInputAuthority) context.Context

WithActiveInputAuthority attaches backend-issued coordinator authority for repository admission checks. Attaching a value does not validate its fence or renew the coordinator lease.

func WithConfigActivationAuthority added in v0.3.5

func WithConfigActivationAuthority(ctx context.Context, authority ConfigActivationAuthority) context.Context

WithConfigActivationAuthority installs host-owned runtime generation authority. It is never decoded from a client request.

func WithDVDMenuProgressReporter added in v0.2.4

func WithDVDMenuProgressReporter(ctx context.Context, reporter DVDMenuProgressReporter) context.Context

WithDVDMenuProgressReporter returns a child context that reports capture progress to reporter. A nil context or reporter is returned unchanged.

func WithDupeProgressReporter

func WithDupeProgressReporter(ctx context.Context, reporter DupeProgressReporter) context.Context

func WithImageUploadProgressReporter added in v0.3.0

func WithImageUploadProgressReporter(ctx context.Context, reporter ImageUploadProgressReporter) context.Context

WithImageUploadProgressReporter attaches an optional reporter to ctx.

func WithImageUploadProgressTarget added in v0.3.0

func WithImageUploadProgressTarget(ctx context.Context, target ImageUploadProgressTarget) context.Context

WithImageUploadProgressTarget attaches immutable metadata for one host attempt.

func WithPreparationProgressReporter added in v0.3.0

func WithPreparationProgressReporter(ctx context.Context, reporter PreparationProgressReporter) context.Context

WithPreparationProgressReporter attaches an optional reporter to ctx.

func WithUploadProgressReporter

func WithUploadProgressReporter(ctx context.Context, reporter UploadProgressReporter) context.Context

WithUploadProgressReporter returns a context carrying reporter; nil reporters leave the context unchanged.

func WithWorkflowExternalEffectReporter added in v0.3.0

func WithWorkflowExternalEffectReporter(
	ctx context.Context,
	reporter WorkflowExternalEffectReporter,
) context.Context

WithWorkflowExternalEffectReporter installs one operation-scoped effect fence.

func WithWorkflowProgressReporter added in v0.3.0

func WithWorkflowProgressReporter(ctx context.Context, reporter WorkflowProgressReporter) context.Context

WithWorkflowProgressReporter attaches a generic workflow progress reporter.

Types

type ActiveInputAuthority added in v0.3.5

type ActiveInputAuthority struct {
	CoordinatorID string
	Fence         uint64
}

ActiveInputAuthority binds a mutation to the coordinator that admitted it. It is installed by the backend, never decoded from a client request.

func ActiveInputAuthorityFromContext added in v0.3.5

func ActiveInputAuthorityFromContext(ctx context.Context) (ActiveInputAuthority, bool)

ActiveInputAuthorityFromContext returns the attached authority and whether it was present. Repository mutation checks remain responsible for validating it against the current slot.

type ActiveInputRecord added in v0.3.5

type ActiveInputRecord struct {
	State              ActiveInputState
	Revision           uint64
	Fence              uint64
	OwnerID            string
	CoordinatorID      string
	LeaseExpiresAt     time.Time
	InputID            string
	SourceVersion      string
	WorkflowID         WorkflowID
	ReservationID      string
	RequestedPath      string
	IdempotencyKey     string
	RequestFingerprint WorkflowFingerprint
}

ActiveInputRecord keeps the previously committed input while a replacement is inspected. Fence advances on coordinator acquisition; Revision advances on every state transition. Renewal changes only LeaseExpiresAt so observers need not resynchronize on heartbeats.

type ActiveInputRepository added in v0.3.5

type ActiveInputRepository interface {
	LoadActiveInput(context.Context) (ActiveInputRecord, error)
	CompareAndSwapActiveInput(context.Context, ActiveInputRecord, ActiveInputRecord, time.Time) error
	CloseIdleActiveInput(context.Context, ActiveInputRecord, time.Time) error
	// FinalizeActiveInput atomically publishes the verified input, workflow and slot.
	// Non-nil retention requires the exact generation and correction revision for the canonical input path.
	FinalizeActiveInput(context.Context, ActiveInputRecord, ActiveInputRecord, InputRecord, *ReleaseWorkflowStateRecord, time.Time, *ActiveInputRetention) error
	RenewActiveInput(context.Context, string, uint64, time.Time, time.Time) error
	RelinquishActiveInput(context.Context, string, uint64, time.Time) error
	LoadInputRecord(context.Context, string) (InputRecord, error)
	LoadInputWorkflowAssociation(context.Context, string, string, string) (InputWorkflowAssociation, error)
	LoadInputRecordByID(context.Context, string) (InputRecord, error)
	SaveInputRecord(context.Context, InputRecord) (InputRecord, error)
}

ActiveInputRepository serializes the configured database's sole input slot. Reads do not acquire or renew a lease. Callers enforce owner isolation before projection.

type ActiveInputRetention added in v0.4.1

type ActiveInputRetention struct {
	Release            ReleaseRef
	CorrectionRevision uint64
}

ActiveInputRetention binds retained workflow authority to the exact canonical generation and accepted corrections that must still be current at finalization.

type ActiveInputSnapshot added in v0.3.5

type ActiveInputSnapshot struct {
	State    ActiveInputState `json:"state"`
	Revision uint64           `json:"revision"`
	InputID  string           `json:"inputId,omitempty"`
	// SourcePath is the verified canonical path, exposed only to the current input's owner.
	// It remains available before preparation produces a release.
	SourcePath    string                  `json:"sourcePath,omitempty"`
	SourceVersion string                  `json:"sourceVersion,omitempty"`
	Current       *ReleaseWorkflowCurrent `json:"current,omitempty"`
	// RecoveryWorkflowIDs lists this owner's unresolved migrated workflows only
	// while no input is active. Selecting one starts reconciliation; it never
	// resumes preparation or submission.
	RecoveryWorkflowIDs []WorkflowID `json:"recoveryWorkflowIds,omitempty"`
}

ActiveInputSnapshot is one owner-safe read of the database's current input. Content digests, coordinator tokens and reservation data are excluded.

type ActiveInputState added in v0.3.5

type ActiveInputState string

ActiveInputState describes the durable singleton input transition.

const (
	ActiveInputEmpty         ActiveInputState = "empty"
	ActiveInputOpening       ActiveInputState = "opening"
	ActiveInputActive        ActiveInputState = "active"
	ActiveInputSwitchPending ActiveInputState = "switch_pending"
	ActiveInputRecovering    ActiveInputState = "recovering"
)

type AnalyzeReleaseWorkflowAudioRequest added in v0.3.5

type AnalyzeReleaseWorkflowAudioRequest struct {
	ReleaseWorkflowCommandContext
	Instructions AudioAnalysisInstructions `json:"instructions"`
}

AnalyzeReleaseWorkflowAudioRequest starts local waveform, spectrogram, or statistics generation for an ordered exact-generation audio-track selection.

func (AnalyzeReleaseWorkflowAudioRequest) Validate added in v0.3.5

Validate verifies revision authority and deterministic analysis instructions.

type AnalyzeReleaseWorkflowHDRRequest added in v0.4.1

type AnalyzeReleaseWorkflowHDRRequest struct {
	ReleaseWorkflowCommandContext
	Instructions HDRAnalysisInstructions `json:"instructions"`
}

func (AnalyzeReleaseWorkflowHDRRequest) Validate added in v0.4.1

type AniListAiringEpisode added in v0.2.4

type AniListAiringEpisode struct {
	// AiringAt is a Unix timestamp in seconds.
	AiringAt int
	// TimeUntilAiring is seconds from AniList's response time until AiringAt.
	TimeUntilAiring int
	Episode         int
}

AniListAiringEpisode describes the next scheduled episode for an airing anime.

type AniListExternalLink struct {
	Site     string
	URL      string
	Type     string
	Language string
}

AniListExternalLink is a public provider or official link attached to AniList media.

type AniListMetadata added in v0.2.4

type AniListMetadata struct {
	// AniListID is the AniList media ID used in AniList URLs.
	AniListID int
	// MALID is the MyAnimeList media ID used as upbrr's canonical anime ID.
	MALID int
	// SiteURL is the canonical AniList media page URL.
	SiteURL string
	// Title* fields preserve AniList's localized title variants.
	TitleRomaji        string
	TitleEnglish       string
	TitleNative        string
	TitleUserPreferred string
	// Description is AniList's plain-text media description.
	Description string
	// Format, Status, Season, and Source are AniList enum values.
	Format string
	Status string
	// StartDate is formatted as YYYY, YYYY-MM, or YYYY-MM-DD depending on AniList precision.
	StartDate string
	// EndDate is formatted as YYYY, YYYY-MM, or YYYY-MM-DD depending on AniList precision.
	EndDate    string
	Season     string
	SeasonYear int
	Episodes   int
	// Duration is AniList's average episode duration in minutes.
	Duration        int
	CountryOfOrigin string
	Source          string
	// Cover* and BannerImage are AniList image URLs or color metadata used by previews.
	CoverExtraLarge string
	CoverLarge      string
	CoverMedium     string
	CoverColor      string
	BannerImage     string
	Genres          []string
	Synonyms        []string
	// AverageScore and MeanScore are AniList percentage scores from 0 to 100.
	AverageScore      int
	MeanScore         int
	Popularity        int
	Favourites        int
	IsAdult           bool
	Tags              []AniListTag
	Studios           []AniListStudio
	Trailer           AniListTrailer
	NextAiringEpisode AniListAiringEpisode
	ExternalLinks     []AniListExternalLink
}

AniListMetadata is the AniList media snapshot used for MAL/AniList preview.

Date fields keep AniList fuzzy-date precision, score fields are percentages from 0 to 100, and AiringAt fields are Unix timestamps in seconds. Tags keep adult/spoiler flags so consumers can filter them before display.

type AniListStudio added in v0.2.4

type AniListStudio struct {
	ID   int
	Name string
	// SiteURL is the AniList studio page URL.
	SiteURL string
}

AniListStudio is a studio attached to an AniList media entry.

type AniListTag added in v0.2.4

type AniListTag struct {
	Name string
	// Rank is AniList's tag relevance percentage from 0 to 100.
	Rank     int
	Category string
	// IsAdult and Is*Spoiler let UI consumers omit sensitive tag labels.
	IsAdult          bool
	IsGeneralSpoiler bool
	IsMediaSpoiler   bool
}

AniListTag is a media tag returned by AniList for the selected anime.

type AniListTrailer added in v0.2.4

type AniListTrailer struct {
	ID   string
	Site string
	// Thumbnail is the provider thumbnail URL when AniList supplies one.
	Thumbnail string
}

AniListTrailer identifies a media trailer from AniList.

type ApplicationDependency added in v0.3.5

type ApplicationDependency struct {
	Path string `json:"path"`
	// Version is a release tag or commit and UTC date, including replacement metadata.
	// Local replacements are labeled "local build" without exposing their paths.
	Version string `json:"version"`
}

ApplicationDependency identifies a linked autobrr module and its display version.

type ApplicationInfo

type ApplicationInfo struct {
	// TestRuntime is present only when the process enforces live-testing restrictions.
	TestRuntime     *TestRuntimeInfo `json:"testRuntime,omitempty"`
	Version         string           `json:"version"`
	BuildIdentifier string           `json:"buildIdentifier"`
	// BuildTime is the embedded VCS commit time in RFC3339 UTC, or empty when unavailable.
	BuildTime string `json:"buildTime"`
	// Dependencies lists linked autobrr modules; CurrentApplicationInfo returns an empty slice when unavailable.
	Dependencies  []ApplicationDependency `json:"dependencies"`
	GoVersion     string                  `json:"goVersion"`
	GOOS          string                  `json:"goos"`
	GOARCH        string                  `json:"goarch"`
	Uptime        string                  `json:"uptime"`
	UptimeSeconds int64                   `json:"uptimeSeconds"`
	// DVDMenuEngine contains path-free engine and FFmpeg probe metadata.
	DVDMenuEngine DVDMenuEngineInfo `json:"dvdMenuEngine"`
	// DVDMenuCapabilityStatus is available, incompatible, or unavailable.
	DVDMenuCapabilityStatus string `json:"dvdMenuCapabilityStatus"`
	// DVDMenuCapabilityMessage is the user-facing reason for the capability status.
	DVDMenuCapabilityMessage string `json:"dvdMenuCapabilityMessage"`
}

ApplicationInfo describes the running build and optional runtime capability probes shared by CLI and WebUI entrypoints.

func CurrentApplicationInfo

func CurrentApplicationInfo() ApplicationInfo

CurrentApplicationInfo returns process build, linked dependency, platform, and uptime metadata. Optional capability fields remain zero until an entrypoint probes them.

type AssetEvidence added in v0.3.0

type AssetEvidence struct {
	// LosslessCount and InspectedFormatCount describe decoded image bytes.
	LosslessCount        int
	InspectedFormatCount int
	Status               MetadataEvidenceStatus
	Ready                bool
	Count                int
}

AssetEvidence records exact readiness for one prepared asset channel.

type AssetFacts added in v0.3.0

type AssetFacts struct {
	// ScreenshotFingerprint binds selected images and tracker-usable hosted variants.
	ScreenshotFingerprint WorkflowFingerprint
	ScreenshotReferences  []ScreenshotReference
	HDRArtifacts          []HDRArtifactEvidence
	EvidenceFingerprint   WorkflowFingerprint
	Status                MetadataEvidenceStatus
	MediaInfoJSON         AssetEvidence
	MediaInfoText         AssetEvidence
	DVDVOBMediaInfo       AssetEvidence
	BDInfo                AssetEvidence
	NFO                   AssetEvidence
	Screenshots           AssetEvidence
	HostedScreenshots     AssetEvidence
	DVDMenus              AssetEvidence
	HostedDVDMenus        AssetEvidence
}

AssetFacts contains prepared-resource readiness without exposing local paths.

type AttachReleaseWorkflowMediaRequest added in v0.3.0

type AttachReleaseWorkflowMediaRequest struct {
	ReleaseWorkflowCommandContext
	Media       *MediaArtifactSetRef `json:"media,omitempty"`
	Attachments []MediaAttachment    `json:"attachments"`
}

AttachReleaseWorkflowMediaRequest attaches staged resources to exact media lineage.

func (AttachReleaseWorkflowMediaRequest) Validate added in v0.3.0

Validate verifies exact workflow authority and opaque staged-resource refs.

type AudioAnalysisArtifact added in v0.3.5

type AudioAnalysisArtifact struct {
	ID      PublicResourceID      `json:"id"`
	Variant AudioAnalysisVariant  `json:"variant"`
	Status  StageStatus           `json:"status"`
	Width   int                   `json:"width,omitempty"`
	Height  int                   `json:"height,omitempty"`
	Text    string                `json:"text,omitempty"`
	Failure *AudioAnalysisFailure `json:"failure,omitempty"`
}

AudioAnalysisArtifact is one opaque, locally retained image or amplitude report. Text is populated only for completed statistics; image dimensions are populated only for completed PNG variants.

type AudioAnalysisError added in v0.3.5

type AudioAnalysisError struct {
	Failure AudioAnalysisFailure
	// contains filtered or unexported fields
}

AudioAnalysisError carries one stable, frontend-safe audio-analysis failure while retaining its private cause for in-process classification.

func (*AudioAnalysisError) Error added in v0.3.5

func (e *AudioAnalysisError) Error() string

func (*AudioAnalysisError) Unwrap added in v0.3.5

func (e *AudioAnalysisError) Unwrap() error

Unwrap preserves the private cause for errors.Is and errors.As checks.

type AudioAnalysisFailure added in v0.3.5

type AudioAnalysisFailure struct {
	Code    AudioAnalysisFailureCode `json:"code"`
	Message string                   `json:"message"`
}

AudioAnalysisFailure is safe for persisted workflow state and browser transport.

func AsAudioAnalysisFailure added in v0.3.5

func AsAudioAnalysisFailure(err error) (AudioAnalysisFailure, bool)

AsAudioAnalysisFailure extracts a stable audio-analysis failure from err.

type AudioAnalysisFailureCode added in v0.3.5

type AudioAnalysisFailureCode string

AudioAnalysisFailureCode is a stable track- or variant-level failure classification.

const (
	AudioAnalysisFailureInvalidSelection    AudioAnalysisFailureCode = "invalid_selection"
	AudioAnalysisFailureAmbiguousBinding    AudioAnalysisFailureCode = "ambiguous_binding"
	AudioAnalysisFailureStaleSource         AudioAnalysisFailureCode = "stale_source"
	AudioAnalysisFailureNoAudio             AudioAnalysisFailureCode = "no_audio"
	AudioAnalysisFailureUnsupportedSource   AudioAnalysisFailureCode = "unsupported_source"
	AudioAnalysisFailureUnsupportedLayout   AudioAnalysisFailureCode = "unsupported_layout"
	AudioAnalysisFailureUnsupportedCodec    AudioAnalysisFailureCode = "unsupported_codec"
	AudioAnalysisFailureFFmpegUnavailable   AudioAnalysisFailureCode = "ffmpeg_unavailable"
	AudioAnalysisFailureDecode              AudioAnalysisFailureCode = "decode_failed"
	AudioAnalysisFailureMalformedPCM        AudioAnalysisFailureCode = "malformed_pcm"
	AudioAnalysisFailureOutput              AudioAnalysisFailureCode = "output_failed"
	AudioAnalysisFailureResourceUnavailable AudioAnalysisFailureCode = "resource_unavailable"
	AudioAnalysisFailureInterrupted         AudioAnalysisFailureCode = "interrupted"
	AudioAnalysisFailureCanceled            AudioAnalysisFailureCode = "canceled"
)

type AudioAnalysisInstructions added in v0.3.5

type AudioAnalysisInstructions struct {
	Release        ReleaseRef                  `json:"release"`
	ResourceID     string                      `json:"resourceId"`
	Selection      AudioAnalysisSelectionMode  `json:"selection"`
	TrackIDs       []string                    `json:"trackIds"`
	Variants       []AudioAnalysisVariant      `json:"variants"`
	ProfileVersion string                      `json:"profileVersion"`
	ResourceLimits AudioAnalysisResourceLimits `json:"resourceLimits,omitempty"`
}

AudioAnalysisInstructions request variants for an ordered selection of stable track IDs from one resource within a prepared generation. TrackIDs use prepared source order, not FFmpeg stream indexes; the preparation owner verifies them against the referenced generation.

func (AudioAnalysisInstructions) Normalize added in v0.3.5

Normalize validates request shape, fills the current profile and default decoder thread count, and returns detached track and variant slices. It does not verify the track IDs against a prepared release or decoder inventory.

type AudioAnalysisRef added in v0.3.5

type AudioAnalysisRef struct {
	ID       AudioAnalysisResultID `json:"id"`
	Revision WorkflowRevision      `json:"revision"`
}

AudioAnalysisRef references one exact audio-analysis attempt.

type AudioAnalysisResourceLimits added in v0.3.5

type AudioAnalysisResourceLimits struct {
	// DecoderThreads requests FFmpeg decoder threads; zero uses the default.
	DecoderThreads int `json:"decoderThreads,omitempty"`
}

AudioAnalysisResourceLimits bounds decoder work for one attempt.

type AudioAnalysisResult added in v0.3.5

type AudioAnalysisResult struct {
	ID                  AudioAnalysisResultID       `json:"id"`
	WorkflowID          WorkflowID                  `json:"workflowId"`
	Revision            WorkflowRevision            `json:"revision"`
	Release             ReleaseRef                  `json:"release"`
	ResourceID          string                      `json:"resourceId"`
	ManifestFingerprint string                      `json:"manifestFingerprint"`
	AttemptID           string                      `json:"attemptId"`
	Selection           AudioAnalysisSelectionMode  `json:"selection"`
	TrackIDs            []string                    `json:"trackIds"`
	Variants            []AudioAnalysisVariant      `json:"variants"`
	ProfileVersion      string                      `json:"profileVersion"`
	ResourceLimits      AudioAnalysisResourceLimits `json:"resourceLimits"`
	Status              StageStatus                 `json:"status"`
	Tracks              []AudioAnalysisTrackResult  `json:"tracks"`
	CreatedAt           time.Time                   `json:"createdAt" ts_type:"string"`
	CompletedAt         *time.Time                  `json:"completedAt,omitempty" ts_type:"string"`
}

AudioAnalysisResult is one immutable generation-bound analysis attempt. A partial result retains successful artifacts alongside failed tracks or variants; canceled and interrupted attempts may also retain completed work.

func (AudioAnalysisResult) Validate added in v0.3.5

func (r AudioAnalysisResult) Validate() error

Validate verifies public identity, authority, and terminal result shape, including ordered track results and artifact status consistency. It does not inspect retained artifact bytes or their private paths.

type AudioAnalysisResultID added in v0.3.5

type AudioAnalysisResultID string

AudioAnalysisResultID identifies one immutable audio-analysis attempt.

type AudioAnalysisSelectionMode added in v0.3.5

type AudioAnalysisSelectionMode string

AudioAnalysisSelectionMode records how an ordered stable-track selection was requested.

const (
	AudioAnalysisSelectionPrimary  AudioAnalysisSelectionMode = "primary"
	AudioAnalysisSelectionAll      AudioAnalysisSelectionMode = "all"
	AudioAnalysisSelectionSelected AudioAnalysisSelectionMode = "selected"
)

type AudioAnalysisSubject added in v0.3.5

type AudioAnalysisSubject struct {
	MediaBinding        PreparedMediaBinding
	Release             ReleaseRef
	SourcePath          string
	VideoPath           string
	SourceFingerprint   string
	ResourceID          string
	ManifestFingerprint string
	PrimaryTrackID      string
	Tracks              []MediaTrackFacts
}

AudioAnalysisSubject is the private exact-generation input used by the decoder. VideoPath is a host filesystem path and must not enter public workflow state.

type AudioAnalysisTrackResult added in v0.3.5

type AudioAnalysisTrackResult struct {
	TrackID       string                  `json:"trackId"`
	Ordinal       int                     `json:"ordinal"`
	Title         string                  `json:"title,omitempty"`
	Codec         string                  `json:"codec,omitempty"`
	Language      string                  `json:"language,omitempty"`
	ChannelLayout string                  `json:"channelLayout,omitempty"`
	Channels      int                     `json:"channels"`
	SampleRate    int                     `json:"sampleRate"`
	SampleFrames  int64                   `json:"sampleFrames"`
	Duration      float64                 `json:"durationSeconds"`
	Status        StageStatus             `json:"status"`
	Artifacts     []AudioAnalysisArtifact `json:"artifacts"`
	Failure       *AudioAnalysisFailure   `json:"failure,omitempty"`
}

AudioAnalysisTrackResult reports decoded facts and variant outcomes for one selected track. SampleFrames counts frames per channel, and Duration is in seconds, derived from SampleFrames and SampleRate.

type AudioAnalysisVariant added in v0.3.5

type AudioAnalysisVariant string

AudioAnalysisVariant identifies one retained local analysis output.

const (
	AudioAnalysisWaveform    AudioAnalysisVariant = "waveform"
	AudioAnalysisSpectrogram AudioAnalysisVariant = "spectrogram"
	AudioAnalysisStats       AudioAnalysisVariant = "stats"
)

type AudioDescriptionTrack added in v0.3.5

type AudioDescriptionTrack struct {
	Ordinal int
	Images  []ScreenshotImage
	Stats   string
}

AudioDescriptionTrack is a separate description channel for hosted analysis graphs and the textual statistics of one source audio track.

type AudioTrackRole added in v0.4.1

type AudioTrackRole string

AudioTrackRole distinguishes programme content from separately assessed audio. Empty means the inspected evidence did not establish the role.

const (
	AudioRoleProgramme     AudioTrackRole = "programme"
	AudioRoleCommentary    AudioTrackRole = "commentary"
	AudioRoleCompatibility AudioTrackRole = "compatibility"
	AudioRoleIsolatedScore AudioTrackRole = "isolated_score"
	AudioRoleHistorical    AudioTrackRole = "historical"
	AudioRoleAlternateMix  AudioTrackRole = "alternate_mix"
	AudioRoleInterview     AudioTrackRole = "interview"
	AudioRoleNovelty       AudioTrackRole = "novelty"
	AudioRoleDescription   AudioTrackRole = "audio_description"
	AudioRoleVoiceOver     AudioTrackRole = "voice_over"
)

type AvailabilityFacts added in v0.3.0

type AvailabilityFacts struct {
	// Status describes the completeness of Providers as a set, not the result
	// of any one provider lookup.
	Status    MetadataEvidenceStatus
	Providers []ProviderAvailabilityEvidence
}

AvailabilityFacts contains provider-entry evidence available to validation. The aggregate status remains partial because the current contract does not declare the complete provider lookup scope.

type BDMVRescanRequiredError

type BDMVRescanRequiredError struct {
	// SourcePath identifies the requested local Blu-ray source.
	SourcePath string
	// SelectedPlaylists contains the complete requested playlist set.
	SelectedPlaylists []string
	// CachedPlaylists contains the playlists already present in the cache.
	CachedPlaylists []string
	// MissingPlaylists contains the selected playlists that require a rescan.
	MissingPlaylists []string
}

BDMVRescanRequiredError reports a partial cached Blu-ray analysis that needs caller confirmation before rescanning the selected playlists.

func (*BDMVRescanRequiredError) Error

func (e *BDMVRescanRequiredError) Error() string

Error returns a stable confirmation-required message without the source path.

type BlurayCandidateSelection added in v0.3.0

type BlurayCandidateSelection struct {
	ReleaseID string             `json:"releaseId"`
	Release   ReleaseSnapshotRef `json:"release"`
}

BlurayCandidateSelection records a candidate selected from retained preparation authority.

type BlurayDiscSpec

type BlurayDiscSpec struct {
	Type   string
	Count  int
	Format string
}

type BlurayImage

type BlurayImage struct {
	Kind       string
	URL        string
	PreviewURL string
}

type BlurayMetadata

type BlurayMetadata struct {
	SourcePath        string
	IMDBID            int
	SearchURL         string
	SelectedReleaseID string
	SelectedURL       string
	AutoSelected      bool
	SelectionReason   string
	BestScore         float64
	Threshold         float64
	Candidates        []BlurayReleaseCandidate
	UpdatedAt         time.Time `ts_type:"string"`
}

func (*BlurayMetadata) CandidateByID

func (m *BlurayMetadata) CandidateByID(releaseID string) *BlurayReleaseCandidate

func (*BlurayMetadata) SelectCandidate

func (m *BlurayMetadata) SelectCandidate(releaseID string, auto bool, reason string) bool

func (*BlurayMetadata) SelectedCandidate

func (m *BlurayMetadata) SelectedCandidate() *BlurayReleaseCandidate

type BlurayPlaybackSpec

type BlurayPlaybackSpec struct {
	Region      string
	RegionNotes string
}

type BlurayReleaseCandidate

type BlurayReleaseCandidate struct {
	ReleaseID    string
	ProductID    string
	MovieTitle   string
	MovieYear    string
	Title        string
	URL          string
	Price        string
	Publisher    string
	Country      string
	Region       string
	Score        float64
	Accepted     bool
	Warnings     []string
	MatchNotes   []string
	Specs        BluraySpecs
	CoverImages  []BlurayImage
	GenericDisc  bool
	SpecsMissing bool
}

type BluraySpecs

type BluraySpecs struct {
	Video     BlurayVideoSpec
	Audio     []string
	Subtitles []string
	Discs     BlurayDiscSpec
	Playback  BlurayPlaybackSpec
}

type BlurayVideoSpec

type BlurayVideoSpec struct {
	Codec      string
	Resolution string
}

type BrowseDirectoryEntry

type BrowseDirectoryEntry struct {
	Name string `json:"name"`
	// Path preserves the listed host path, including an allowed symlink's spelling.
	Path  string `json:"path"`
	IsDir bool   `json:"isDir"`
	// Size is the filesystem-reported byte size; virtual root entries leave it zero.
	Size int64 `json:"size"`
	// ModifiedAt is UTC RFC3339 when available; virtual root entries leave it empty.
	ModifiedAt string `json:"modifiedAt"`
}

BrowseDirectoryEntry describes a selectable or navigable host filesystem path.

type BrowseDirectoryRequest

type BrowseDirectoryRequest struct {
	// Path is a host filesystem path; a file path lists its containing directory.
	// Roots scope requires an empty path.
	Path string `json:"path"`
	// Mode defaults to "folder". "file" includes recognized video files alongside directories.
	Mode string `json:"mode"`
	// Scope selects "roots" for a root listing or recursive search, or "directory" for a listing.
	// Omitting it preserves initial-path fallback and automatic root selection.
	Scope string `json:"scope,omitempty"`
	// Query searches entry names recursively in roots scope and is limited to 1024 UTF-8 bytes.
	// An empty query after name normalization returns the roots themselves.
	Query string `json:"query,omitempty"`
}

BrowseDirectoryRequest selects a host directory listing or a search across authorized roots.

type BrowseDirectoryResponse

type BrowseDirectoryResponse struct {
	// CurrentPath is the listed host directory and is empty for roots scope.
	CurrentPath string `json:"currentPath"`
	// ParentPath is empty when navigation would leave the authorized root.
	ParentPath string                 `json:"parentPath"`
	Mode       string                 `json:"mode"`
	Entries    []BrowseDirectoryEntry `json:"entries"`
	// Scope describes the returned view, which can be "roots" for an initial directory request.
	Scope string `json:"scope"`
	// Incomplete means a recursive search reached a time, entry, or result limit,
	// or could not inspect a directory or matching entry. Returned matches remain usable.
	Incomplete bool `json:"incomplete,omitempty"`
}

BrowseDirectoryResponse contains a directory listing, root listing, or bounded recursive matches.

type CancelReleaseWorkflowRequest added in v0.3.0

type CancelReleaseWorkflowRequest struct {
	ReleaseWorkflowCommandContext
	Reason string `json:"reason,omitempty"`
}

CancelReleaseWorkflowRequest cancels one workflow.

func (CancelReleaseWorkflowRequest) Validate added in v0.3.0

func (r CancelReleaseWorkflowRequest) Validate() error

Validate verifies exact revision authority.

type CanonicalCategory added in v0.3.0

type CanonicalCategory string

CanonicalCategory is the finalized top-level movie-or-TV classification.

const (
	// CanonicalCategoryUnknown represents an intentionally or currently unknown category.
	CanonicalCategoryUnknown CanonicalCategory = "unknown"
	// CanonicalCategoryMovie identifies movie releases.
	CanonicalCategoryMovie CanonicalCategory = "movie"
	// CanonicalCategoryTV identifies television releases.
	CanonicalCategoryTV CanonicalCategory = "tv"
)

func NormalizeCanonicalCategory added in v0.3.0

func NormalizeCanonicalCategory(value string) (CanonicalCategory, error)

NormalizeCanonicalCategory maps supported legacy/user labels to a canonical movie, TV, or explicit unknown value.

type CaptureReleaseWorkflowMediaRequest added in v0.3.0

type CaptureReleaseWorkflowMediaRequest struct {
	ReleaseWorkflowCommandContext
	Instructions MediaCaptureInstructions `json:"instructions"`
}

CaptureReleaseWorkflowMediaRequest captures authoritative media.

func (CaptureReleaseWorkflowMediaRequest) Validate added in v0.3.0

Validate verifies exact revision authority.

type Category

type Category string
const (
	CategoryUnknown Category = ""
	CategoryMovie   Category = "MOVIE"
	CategoryTV      Category = "TV"
)

func NormalizeCategory

func NormalizeCategory(value string) Category

func (Category) Canonical

func (c Category) Canonical() Category

func (Category) IsValid

func (c Category) IsValid() bool

func (*Category) Scan

func (c *Category) Scan(src any) error

func (Category) Value

func (c Category) Value() (driver.Value, error)

type CheckReleaseWorkflowDuplicatesRequest added in v0.3.0

type CheckReleaseWorkflowDuplicatesRequest struct {
	ReleaseWorkflowCommandContext
	SkipRemote bool `json:"skipRemote"`
}

CheckReleaseWorkflowDuplicatesRequest runs projection-bound duplicate checks.

func (CheckReleaseWorkflowDuplicatesRequest) Validate added in v0.3.0

Validate verifies exact revision authority.

type ClientInjectionOutcome added in v0.3.0

type ClientInjectionOutcome struct {
	Status   StageStatus       `json:"status"`
	Message  string            `json:"message,omitempty"`
	Failures []WorkflowFailure `json:"failures,omitempty"`
}

ClientInjectionOutcome records client injection independently from tracker submission.

type ClientInjectionRetryRef added in v0.3.0

type ClientInjectionRetryRef struct {
	Result     UploadResultRef `json:"result"`
	TrackerIDs []TrackerID     `json:"trackerIds"`
}

ClientInjectionRetryRef targets failed client effects from one exact prior result without granting tracker-submission authority.

type ClientOverrides

type ClientOverrides struct {
	Client       *string
	QbitCategory *string
	QbitTag      *string
	ForceRecheck *bool
}

type ClientSearchPolicy added in v0.3.0

type ClientSearchPolicy struct {
	// Skip disables torrent-client discovery for this preparation.
	Skip bool
	// Client optionally selects one configured client; nil uses normal client selection.
	Client *string
}

ClientSearchPolicy contains fact-producing torrent-client search choices. These values participate in preparation compatibility.

type ClientSearchResult

type ClientSearchResult struct {
	InfoHash            string
	TrackerIDs          map[string]string
	FoundTrackerMatch   bool
	TorrentComments     []TorrentMatch
	PieceSizeConstraint string
	FoundPreferredPiece string
	MatchedTrackers     []string
	TorrentPath         string
	// TorrentDataVerified reports that TorrentPath was selected from a complete
	// client record whose content path exactly matched the searched source.
	TorrentDataVerified bool
}

type ClientService

type ClientService interface {
	Inject(ctx context.Context, subject ClientSubject, torrent TorrentResult) error
	SearchPathedTorrents(ctx context.Context, subject ClientSubject) (ClientSearchResult, error)
}

type ClientSubject added in v0.3.0

type ClientSubject struct {
	SourcePath      string
	FileList        []string
	DiscType        string
	ClientOverrides ClientOverrides
}

ClientSubject contains prepared content source facts and caller instructions for torrent-client search, linking, and injection. TorrentResult paths and URLs identify torrent artifacts and do not replace these source facts.

type Config

type Config interface {
	Validate() error
}

Config defines the minimum application configuration contract required by core wiring. Keeping this in pkg/api avoids leaking internal package types into exported APIs.

type ConfigActivation added in v0.3.5

type ConfigActivation struct {
	Status            ConfigActivationStatus      `json:"status"`
	ActivationID      string                      `json:"activationId,omitzero"`
	ActiveGeneration  uint64                      `json:"activeGeneration"`
	Fingerprint       WorkflowFingerprint         `json:"-"`
	PendingGeneration uint64                      `json:"pendingGeneration,omitzero"`
	FailureCode       ConfigActivationFailureCode `json:"failureCode,omitzero"`
	Impacts           []ConfigImpact              `json:"impacts"`
	UpdatedAt         time.Time                   `json:"updatedAt"`
}

ConfigActivation is the safe, pollable status of the effective config. Candidate configuration is deliberately excluded because it may contain credentials.

type ConfigActivationAuthority added in v0.3.5

type ConfigActivationAuthority struct {
	Generation  uint64
	Fingerprint WorkflowFingerprint
}

ConfigActivationAuthority binds work admitted by one runtime bundle to the durable effective configuration generation that built that bundle.

func ConfigActivationAuthorityFromContext added in v0.3.5

func ConfigActivationAuthorityFromContext(ctx context.Context) (ConfigActivationAuthority, bool)

ConfigActivationAuthorityFromContext returns host-owned runtime generation authority when work was admitted through an activated runtime bundle.

type ConfigActivationFailureCode added in v0.3.5

type ConfigActivationFailureCode string

ConfigActivationFailureCode identifies the safe activation stage that prevented a deferred candidate from becoming active. It deliberately omits the underlying error because candidates and adapter errors may contain credentials or local paths.

const (
	ConfigActivationFailureNormalize       ConfigActivationFailureCode = "normalize"
	ConfigActivationFailureValidateStored  ConfigActivationFailureCode = "validate_stored"
	ConfigActivationFailureValidateRuntime ConfigActivationFailureCode = "validate_runtime"
	ConfigActivationFailureBuild           ConfigActivationFailureCode = "build"
	ConfigActivationFailureCookies         ConfigActivationFailureCode = "cookies"
	ConfigActivationFailurePersist         ConfigActivationFailureCode = "persist"
)

type ConfigActivationPendingError added in v0.3.5

type ConfigActivationPendingError struct {
	Activation ConfigActivation
}

ConfigActivationPendingError carries the safe status for a second settings save without exposing its pending candidate or credentials.

func (*ConfigActivationPendingError) Error added in v0.3.5

func (*ConfigActivationPendingError) Unwrap added in v0.3.5

func (e *ConfigActivationPendingError) Unwrap() error

type ConfigActivationStatus added in v0.3.5

type ConfigActivationStatus string

ConfigActivationStatus reports whether the saved effective configuration is active, waiting for workflow cleanup, or terminally failed while the prior active generation remains in use.

const (
	ConfigActivationActive  ConfigActivationStatus = "active"
	ConfigActivationPending ConfigActivationStatus = "pending"
	ConfigActivationFailed  ConfigActivationStatus = "failed"
)

type ConfigImpact added in v0.3.5

type ConfigImpact string

ConfigImpact identifies the workflow projection family affected by an effective runtime configuration change.

const (
	ConfigImpactProvider            ConfigImpact = "provider"
	ConfigImpactTrackers            ConfigImpact = "trackers"
	ConfigImpactDescription         ConfigImpact = "description"
	ConfigImpactScreenshotSelection ConfigImpact = "screenshot_selection"
	ConfigImpactScreenshotCapture   ConfigImpact = "screenshot_capture"
	ConfigImpactImageHosting        ConfigImpact = "image_hosting"
	ConfigImpactClientInjection     ConfigImpact = "client_injection"
	ConfigImpactPresentation        ConfigImpact = "presentation"
)

type ConfigImpactDetail added in v0.3.5

type ConfigImpactDetail struct {
	Kind       ConfigImpact `json:"kind"`
	TrackerIDs []TrackerID  `json:"trackerIds,omitempty"`
}

ConfigImpactDetail carries the narrow affected tracker lanes when a tracker-scoped setting changes. An empty TrackerIDs applies to the complete tracker projection because selection or global policy changed.

type ContentBinding added in v0.3.2

type ContentBinding struct {
	SourceFingerprint string            `json:"sourceFingerprint"`
	Category          CanonicalCategory `json:"category"`
	ProviderIDs       ProviderIDSet     `json:"providerIds"`
}

ContentBinding records the source and provider identity that accepted a content-derived correction. Provider IDs are resolved values, never manual intent.

type ContinueReleaseWorkflowRequest added in v0.3.0

type ContinueReleaseWorkflowRequest struct {
	Authority       *WorkflowAuthority     `json:"authority,omitempty"`
	IdempotencyKey  string                 `json:"idempotencyKey"`
	Goal            WorkflowGoal           `json:"goal"`
	Intent          WorkflowIntent         `json:"intent"`
	Answers         []RequiredActionAnswer `json:"answers,omitempty"`
	TrackerApproval *TrackerApproval       `json:"trackerApproval,omitempty"`
	// Deprecated: final upload approval is no longer required by runtime workflows.
	Approval *UploadApproval `json:"approval,omitempty"`
}

ContinueReleaseWorkflowRequest reconciles typed desired state toward one goal.

func (ContinueReleaseWorkflowRequest) Validate added in v0.3.0

Validate verifies request identity and typed desired-state shape.

type CoreDependencies

type CoreDependencies struct {
	// LiveTest is process-owned and must survive configuration activation.
	LiveTest *LiveTestPolicy
	// Config is validated before the core is created.
	Config Config
	// Logger receives core initialization and runtime messages. Nil uses NopLogger.
	Logger Logger
	// Services supplies optional service overrides; zero values use the core defaults.
	Services ServiceSet
	// Repository supplies immutable borrowed persistence capabilities. Its zero
	// value opens and owns a SQLite repository from Config.
	Repository RepositoryCapabilities
	// RepositoryOwner identifies the externally owned adapter used to build
	// Repository. It remains borrowed and is used only for owner-specific setup.
	RepositoryOwner RepositoryOwner
	// SkipCookieMigration skips legacy cookie migration for callers that already
	// synchronize cookie encryption state with the shared repository.
	SkipCookieMigration bool
	// EnforceConfigActivationGeneration fences workflow admission against the
	// durable active config generation owned by the WebUI runtime host.
	EnforceConfigActivationGeneration bool
	// ConfigActivationGeneration is the durable generation this Core was built
	// to serve when EnforceConfigActivationGeneration is enabled.
	ConfigActivationGeneration uint64
	// ConfigActivationFingerprint is the private effective-config fingerprint
	// expected for ConfigActivationGeneration. It never enters public state.
	ConfigActivationFingerprint WorkflowFingerprint
}

CoreDependencies supplies the externally owned services used to construct the core runtime.

type CorrectionConfirmation added in v0.3.2

type CorrectionConfirmation struct {
	Revision         uint64                             `json:"revision"`
	Fields           []CorrectionField                  `json:"fields"`
	PreviousBindings map[CorrectionField]ContentBinding `json:"previousBindings"`
	CurrentBinding   ContentBinding                     `json:"currentBinding"`
}

CorrectionConfirmation explains which retained facts need confirmation after source identity changes. Revision binds the correction patch to this record.

type CorrectionConflictError added in v0.3.2

type CorrectionConflictError struct {
	Field   CorrectionField
	TrackID string
	Reason  string
}

CorrectionConflictError describes a rejected correction target or revision.

func (*CorrectionConflictError) Error added in v0.3.2

func (e *CorrectionConflictError) Error() string

func (*CorrectionConflictError) Unwrap added in v0.3.2

func (e *CorrectionConflictError) Unwrap() error

type CorrectionField added in v0.3.2

type CorrectionField string

CorrectionField identifies one closed, resettable correction target.

const (
	CorrectionFieldIdentityTMDB   CorrectionField = "identity.tmdb"
	CorrectionFieldIdentityIMDB   CorrectionField = "identity.imdb"
	CorrectionFieldIdentityTVDB   CorrectionField = "identity.tvdb"
	CorrectionFieldIdentityTVmaze CorrectionField = "identity.tvmaze"
	CorrectionFieldIdentityMAL    CorrectionField = "identity.mal"

	CorrectionFieldReleaseNameCategory         CorrectionField = "release_name.category"
	CorrectionFieldReleaseNameType             CorrectionField = "release_name.type"
	CorrectionFieldReleaseNameSource           CorrectionField = "release_name.source"
	CorrectionFieldReleaseNameResolution       CorrectionField = "release_name.resolution"
	CorrectionFieldReleaseNameTag              CorrectionField = "release_name.tag"
	CorrectionFieldReleaseNameService          CorrectionField = "release_name.service"
	CorrectionFieldReleaseNameEdition          CorrectionField = "release_name.edition"
	CorrectionFieldReleaseNamePresentation     CorrectionField = "release_name.presentation"
	CorrectionFieldReleaseNameReleaseFeatures  CorrectionField = "release_name.release_features"
	CorrectionFieldReleaseNameRepack           CorrectionField = "release_name.repack"
	CorrectionFieldReleaseNameThreeD           CorrectionField = "release_name.three_d"
	CorrectionFieldReleaseNameSeason           CorrectionField = "release_name.season"
	CorrectionFieldReleaseNameEpisode          CorrectionField = "release_name.episode"
	CorrectionFieldReleaseNameEpisodeTitle     CorrectionField = "release_name.episode_title"
	CorrectionFieldReleaseNameManualYear       CorrectionField = "release_name.manual_year"
	CorrectionFieldReleaseNameManualDate       CorrectionField = "release_name.manual_date"
	CorrectionFieldReleaseNameUseSeasonEpisode CorrectionField = "release_name.use_season_episode"
	CorrectionFieldReleaseNameNoSeason         CorrectionField = "release_name.no_season"
	CorrectionFieldReleaseNameNoYear           CorrectionField = "release_name.no_year"
	CorrectionFieldReleaseNameNoAKA            CorrectionField = "release_name.no_aka"
	CorrectionFieldReleaseNameNoTag            CorrectionField = "release_name.no_tag"
	CorrectionFieldReleaseNameNoEpisodeTitle   CorrectionField = "release_name.no_episode_title"
	CorrectionFieldReleaseNameNoDistributor    CorrectionField = "release_name.no_distributor"
	CorrectionFieldReleaseNameNoEdition        CorrectionField = "release_name.no_edition"
	CorrectionFieldReleaseNameNoDub            CorrectionField = "release_name.no_dub"
	CorrectionFieldReleaseNameNoDual           CorrectionField = "release_name.no_dual"
	CorrectionFieldReleaseNameDualAudio        CorrectionField = "release_name.dual_audio"
	CorrectionFieldReleaseNameRegion           CorrectionField = "release_name.region"

	CorrectionFieldMetadataDistributor                CorrectionField = "metadata.distributor"
	CorrectionFieldMetadataOriginalLanguage           CorrectionField = "metadata.original_language"
	CorrectionFieldMetadataPersonalRelease            CorrectionField = "metadata.personal_release"
	CorrectionFieldMetadataCommentary                 CorrectionField = "metadata.commentary"
	CorrectionFieldMetadataWebDV                      CorrectionField = "metadata.web_dv"
	CorrectionFieldMetadataStreamOptimized            CorrectionField = "metadata.stream_optimized"
	CorrectionFieldMetadataAnime                      CorrectionField = "metadata.anime"
	CorrectionFieldMetadataTitle                      CorrectionField = "metadata.title"
	CorrectionFieldMetadataAlternateTitle             CorrectionField = "metadata.alternate_title"
	CorrectionFieldMetadataOriginalTitle              CorrectionField = "metadata.original_title"
	CorrectionFieldMetadataGenres                     CorrectionField = "metadata.genres"
	CorrectionFieldMetadataAudioLanguages             CorrectionField = "metadata.audio_languages"
	CorrectionFieldMetadataSubtitleLanguages          CorrectionField = "metadata.subtitle_languages"
	CorrectionFieldMetadataHardcodedSubs              CorrectionField = "metadata.hardcoded_subs"
	CorrectionFieldMetadataHardcodedSubtitleLanguages CorrectionField = "metadata.hardcoded_subtitle_languages"
	CorrectionFieldMetadataTrackLanguages             CorrectionField = "metadata.track_languages"
	CorrectionFieldMetadataTrackAudioOrigins          CorrectionField = "metadata.track_audio_origins"
)

func (CorrectionField) IsContentBound added in v0.3.2

func (field CorrectionField) IsContentBound() bool

IsContentBound identifies corrections that require confirmation when content identity changes.

type CorrectionFieldRef added in v0.3.2

type CorrectionFieldRef struct {
	Field   CorrectionField `json:"field"`
	TrackID string          `json:"trackId,omitempty"`
}

CorrectionFieldRef identifies one scalar field or one exact track correction.

type CorrectionRevisionConflictError added in v0.3.2

type CorrectionRevisionConflictError struct {
	Expected uint64
	Actual   uint64
}

CorrectionRevisionConflictError reports an update based on an older correction record.

func (*CorrectionRevisionConflictError) Error added in v0.3.2

func (*CorrectionRevisionConflictError) Unwrap added in v0.3.2

type CreateReleaseWorkflowRequest added in v0.3.0

type CreateReleaseWorkflowRequest struct {
	Instructions   ReleaseFactInstructions `json:"instructions"`
	IdempotencyKey string                  `json:"idempotencyKey"`
}

CreateReleaseWorkflowRequest creates one workflow from fact instructions.

func (CreateReleaseWorkflowRequest) Validate added in v0.3.0

func (r CreateReleaseWorkflowRequest) Validate() error

Validate rejects a create intent without idempotency authority.

type CreateReleaseWorkflowUploadRequest added in v0.3.0

type CreateReleaseWorkflowUploadRequest struct {
	// Authority continues an already-open input without repeating source verification.
	Authority              *WorkflowAuthority                `json:"authority,omitempty"`
	Source                 ReleaseWorkflowUploadSource       `json:"source"`
	Unattended             *ReleaseWorkflowUploadUnattended  `json:"unattended"`
	Execution              ReleaseWorkflowUploadExecution    `json:"execution,omitempty"`
	Trackers               ReleaseWorkflowUploadTrackers     `json:"trackers,omitempty"`
	Preparation            ReleaseWorkflowUploadPreparation  `json:"preparation,omitempty"`
	Duplicates             ReleaseWorkflowUploadDuplicates   `json:"duplicates,omitempty"`
	HDRComparisonSelection *HDRComparisonSelection           `json:"hdrComparisonSelection,omitempty"`
	HDRAnalysis            *HDRAnalysisRequest               `json:"hdrAnalysis,omitempty"`
	Media                  ReleaseWorkflowUploadMedia        `json:"media,omitempty"`
	Descriptions           ReleaseWorkflowUploadDescriptions `json:"descriptions,omitempty"`
	ImageHosting           ReleaseWorkflowUploadImageHosting `json:"imageHosting,omitempty"`
	Client                 ReleaseWorkflowUploadClient       `json:"client,omitempty"`
	Torrent                ReleaseWorkflowUploadTorrent      `json:"torrent,omitempty"`
	IdempotencyKey         string                            `json:"-"`
}

CreateReleaseWorkflowUploadRequest starts one durable single-source upload. IdempotencyKey is supplied by the transport and is never decoded from JSON.

func (CreateReleaseWorkflowUploadRequest) Validate added in v0.3.0

Validate rejects malformed or contradictory composite upload requests.

type DVDMediaInfo

type DVDMediaInfo struct {
	SourcePath      string
	IFOPath         string
	VOBPath         string
	VOBSet          string
	Width           int
	Height          int
	FrameRate       string
	ScanType        string
	Resolution      string
	HighFrameRate   bool
	MediaInfoJSON   string
	MediaInfoText   string
	VOBMediaInfoRaw string
	UpdatedAt       time.Time `ts_type:"string"`
}

type DVDMenuCapabilityProvider added in v0.2.4

type DVDMenuCapabilityProvider interface {
	// DVDMenuCapability probes the current FFmpeg executable without exposing its path.
	DVDMenuCapability(ctx context.Context) (DVDMenuEngineInfo, error)
}

DVDMenuCapabilityProvider is an optional Core diagnostic contract. Keeping it separate from Core avoids forcing unrelated test/runtime adapters to implement a capability probe.

type DVDMenuCaptureImage added in v0.2.4

type DVDMenuCaptureImage struct {
	// ScreenshotImage contains the persisted local image metadata.
	ScreenshotImage
	// Discovery records whether navigation or structural inventory found the screen.
	Discovery DVDMenuDiscovery
}

DVDMenuCaptureImage is one stored menu screenshot and its discovery source.

type DVDMenuCaptureResult added in v0.2.4

type DVDMenuCaptureResult struct {
	// SourcePath is the host filesystem path of the prepared DVD source.
	SourcePath string
	// Images contains captures persisted for SourcePath in display order.
	Images []DVDMenuCaptureImage
	// SelectedLanguage is the menu language requested from the DVD engine.
	SelectedLanguage string
	// Region is the DVD region selection used for capture; zero means no override.
	Region int
	// DiscoveredMenus is the number of structurally inventoried menu programs.
	DiscoveredMenus int
	// VisitedStates is the number of distinct VM states evaluated during traversal.
	VisitedStates int
	// VisitedButtons is the number of authored button commands evaluated.
	VisitedButtons int
	// MaxItems is the configured upper bound on persisted automatic captures.
	MaxItems int
	// Complete reports that every selected screen was captured without coverage warnings.
	Complete bool
	// Partial reports that warnings prevented complete navigation or rendering coverage.
	Partial bool
	// Truncated reports that MaxItems prevented one or more eligible captures.
	Truncated bool
	// Warnings contains deduplicated, stable, path-free coverage diagnostics.
	Warnings []DVDMenuCaptureWarning
	// Engine describes the pure-Go engine and FFmpeg capability used for capture.
	Engine DVDMenuEngineInfo
}

DVDMenuCaptureResult reports persisted captures plus bounded traversal state.

type DVDMenuCaptureWarning added in v0.2.4

type DVDMenuCaptureWarning struct {
	// DiscID identifies the uncovered prepared disc when applicable.
	DiscID string
	// DiscName is the safe page-facing label for the uncovered disc.
	DiscName string
	// Code is a stable machine-readable warning identifier.
	Code string
	// Message is a redacted user-facing description of the incomplete coverage.
	Message string
}

DVDMenuCaptureWarning is a stable, redacted partial-capture diagnostic.

type DVDMenuDiscSubject added in v0.3.2

type DVDMenuDiscSubject struct {
	ID   string
	Name string
	Root string
}

DVDMenuDiscSubject identifies one private DVD root eligible for menu capture.

type DVDMenuDiscovery added in v0.2.4

type DVDMenuDiscovery string

DVDMenuDiscovery describes how the navigation engine found a menu screen.

const (
	// DVDMenuDiscoveryReachable marks a screen reached by deterministic VM navigation.
	DVDMenuDiscoveryReachable DVDMenuDiscovery = "reachable"
	// DVDMenuDiscoveryStructural marks an interactive screen found only in the IFO inventory.
	DVDMenuDiscoveryStructural DVDMenuDiscovery = "structural"
)

DVD menu discovery sources serialized across CLI and WebUI.

type DVDMenuEngineInfo added in v0.2.4

type DVDMenuEngineInfo struct {
	// EngineVersion identifies the bundled pure-Go DVD navigation engine.
	EngineVersion string
	// SchemaVersion identifies the capture metadata contract version.
	SchemaVersion int
	// SupportedFeatures lists the engine stages available in this build.
	SupportedFeatures []string
	// FFmpegVersion is the bounded first line of FFmpeg version output.
	FFmpegVersion string
	// FFmpegDVDVideo reports whether the required dvdvideo demuxer options are available.
	FFmpegDVDVideo bool
	// MissingFFmpegOptions lists required dvdvideo options absent from the probe.
	MissingFFmpegOptions []string
}

DVDMenuEngineInfo reports pure-Go engine and external FFmpeg capability.

type DVDMenuProgressReporter added in v0.2.4

type DVDMenuProgressReporter func(update DVDMenuProgressUpdate)

DVDMenuProgressReporter receives capture progress updates.

type DVDMenuProgressUpdate added in v0.2.4

type DVDMenuProgressUpdate struct {
	// Phase is a stable capture stage such as preflight, discovering, capturing, or persisting.
	Phase string `json:"phase"`
	// Message is a user-facing summary of the current phase.
	Message string `json:"message"`
	// DiscoveredMenus is the current structural inventory count.
	DiscoveredMenus int `json:"discoveredMenus"`
	// VisitedStates is the current count of evaluated VM states.
	VisitedStates int `json:"visitedStates"`
	// VisitedButtons is the current count of evaluated button commands.
	VisitedButtons int `json:"visitedButtons"`
	// CapturedCount is the number of rendered menu images so far.
	CapturedCount int `json:"capturedCount"`
	// WarningCount is the number of distinct coverage warnings so far.
	WarningCount int `json:"warningCount"`
}

DVDMenuProgressUpdate reports bounded capture progress without source paths or disc-identifying material.

type DVDMenuService added in v0.2.4

type DVDMenuService interface {
	// Capture replaces automatic captures up to maxItems while preserving manual menus.
	Capture(ctx context.Context, subject DVDMenuSubject, maxItems int) (DVDMenuCaptureResult, error)
	// List returns persisted manual and automatic menu images in selection order.
	List(ctx context.Context, subject DVDMenuSubject) ([]ScreenshotImage, error)
	// Delete removes one managed menu image and its local repository references.
	Delete(ctx context.Context, subject DVDMenuSubject, imagePath string) error
	// Capability reports path-free engine and FFmpeg dvdvideo support.
	Capability(ctx context.Context) (DVDMenuEngineInfo, error)
}

DVDMenuService captures and manages persisted menu images for prepared DVD metadata.

type DVDMenuSubject added in v0.3.0

type DVDMenuSubject struct {
	MediaBinding PreparedMediaBinding
	SourcePath   string
	DiscType     string
	Discs        []DVDMenuDiscSubject
}

DVDMenuSubject contains the stable source facts required by DVD-menu capture and lifecycle operations.

type DecideReleaseWorkflowDuplicatesRequest added in v0.3.0

type DecideReleaseWorkflowDuplicatesRequest struct {
	// StaffTokenConfirmations binds each staff-required ignored decision to the
	// current assessment ID; stale or absent confirmation cannot authorize an override.
	StaffTokenConfirmations map[TrackerID]DupeAssessmentID `json:"staffTokenConfirmations,omitempty"`
	ReleaseWorkflowCommandContext
	Decisions map[TrackerID]DupeDecision `json:"decisions"`
}

DecideReleaseWorkflowDuplicatesRequest records owner duplicate decisions.

func (DecideReleaseWorkflowDuplicatesRequest) Validate added in v0.3.0

Validate verifies exact revision authority.

type DeleteReleaseWorkflowMediaRequest added in v0.3.0

type DeleteReleaseWorkflowMediaRequest struct {
	ReleaseWorkflowCommandContext
	Media       MediaArtifactSetRef `json:"media"`
	ArtifactIDs []PublicResourceID  `json:"artifactIds"`
}

DeleteReleaseWorkflowMediaRequest deletes opaque retained artifacts.

func (DeleteReleaseWorkflowMediaRequest) Validate added in v0.3.0

Validate verifies revision authority and opaque media refs.

type DescriptionBuilderGroup

type DescriptionBuilderGroup struct {
	GroupKey           string
	Trackers           []string
	Description        string
	DescriptionHTML    string
	RawDescription     string
	RawDescriptionHTML string
	HasOverride        bool
	// Final marks complete edited output whose generated sections must not be rebuilt.
	Final     bool
	ImageHost ImageHostFeedback
}

func CloneDescriptionBuilderGroups

func CloneDescriptionBuilderGroups(groups []DescriptionBuilderGroup) []DescriptionBuilderGroup

CloneDescriptionBuilderGroups deep-copies the reference-typed fields used by DescriptionBuilderGroup so callers can safely reuse cached or queued values.

func (DescriptionBuilderGroup) Source added in v0.3.0

func (g DescriptionBuilderGroup) Source() string

Source returns the preferred editable BBCode source for the group. Legacy callers that only populate Description remain supported.

type DescriptionBuilderPreview

type DescriptionBuilderPreview struct {
	SourcePath      string
	Groups          []DescriptionBuilderGroup
	ContentFailures []TrackerContentFailure
}

type DescriptionImageHostStatus

type DescriptionImageHostStatus struct {
	Trackers  []string
	ImageHost ImageHostFeedback
}

type DescriptionInput added in v0.3.0

type DescriptionInput struct {
	Release           ReleaseRef
	Trackers          []string
	GroupKey          string
	Groups            []DescriptionBuilderGroup
	ImageHost         ImageHostOverrides
	QuestionnaireData map[string]map[string]string
	Options           UploadOptions
}

DescriptionInput contains description projection choices for one exact prepared generation.

type DescriptionInstructions added in v0.3.0

type DescriptionInstructions struct {
	Overrides            []DescriptionOverrideInput      `json:"overrides,omitempty"`
	QuestionnaireAnswers map[TrackerID]map[string]string `json:"questionnaireAnswers,omitempty"`
	Options              UploadOptions                   `json:"options"`
	ImageHost            ImageHostOverrides              `json:"imageHost"`
	TrackerConfig        TrackerConfigOverrides          `json:"trackerConfig,omitempty"`
	TrackerSite          TrackerSiteOverrides            `json:"trackerSite,omitempty"`
	Client               ClientOverrides                 `json:"client,omitempty"`
	Torrent              TorrentOverrides                `json:"torrent,omitempty"`
	TemplateVersion      string                          `json:"templateVersion,omitempty"`
}

DescriptionInstructions are transport-safe generation choices. Canonical templates and generated output remain backend-owned workflow state.

func (DescriptionInstructions) Validate added in v0.3.0

func (i DescriptionInstructions) Validate() error

Validate verifies transport-safe description generation choices.

type DescriptionOverride

type DescriptionOverride struct {
	SourcePath  string
	GroupKey    string
	Description string
	UpdatedAt   time.Time `ts_type:"string"`
}

type DescriptionOverrideInput added in v0.3.0

type DescriptionOverrideInput struct {
	GroupKey string `json:"groupKey"`
	Source   string `json:"source"`
	// Final preserves saved editor output instead of composing generated sections again.
	Final bool `json:"final,omitempty"`
	// TrackerIDs binds a saved composite group to its original tracker members.
	// Omitted membership retains the group-wide behavior of custom input notes.
	TrackerIDs []TrackerID `json:"trackerIds,omitempty"`
}

DescriptionOverrideInput is one explicit user-authored group description. Rendered output is generated and retained by the backend.

type DescriptionOverrideMutation added in v0.3.0

type DescriptionOverrideMutation struct {
	Descriptions DescriptionSetRef `json:"descriptions"`
	GroupKey     string            `json:"groupKey"`
	Source       string            `json:"source"`
}

DescriptionOverrideMutation changes one exact description group only.

type DescriptionReuseRepository added in v0.3.5

type DescriptionReuseRepository interface {
	LoadReusableDescription(context.Context, string) (ReusableDescription, bool, error)
}

DescriptionReuseRepository retrieves reusable public descriptions and explicit override text. Workflow-state persistence owns their atomic save.

type DescriptionSet added in v0.3.0

type DescriptionSet struct {
	// HDRArtifacts is server-owned evidence from this exact description generation.
	HDRArtifacts        map[TrackerID][]HDRArtifactEvidence `json:"hdrArtifacts,omitempty"`
	ID                  DescriptionSetID                    `json:"id"`
	WorkflowID          WorkflowID                          `json:"workflowId"`
	Revision            WorkflowRevision                    `json:"revision"`
	Release             ReleaseSnapshotRef                  `json:"release"`
	ReleaseRef          ReleaseRef                          `json:"releaseRef"`
	ProjectionSet       TrackerReleaseProjectionSetRef      `json:"projectionSet"`
	TrackerApproval     *TrackerApprovalSnapshotRef         `json:"trackerApproval,omitempty"`
	Media               *MediaArtifactSetRef                `json:"media,omitempty"`
	InputFingerprint    WorkflowFingerprint                 `json:"inputFingerprint"`
	TemplateFingerprint WorkflowFingerprint                 `json:"templateFingerprint"`
	Descriptions        []RenderedDescription               `json:"descriptions"`
	TrackerResults      []DescriptionTrackerResult          `json:"trackerResults,omitempty"`
	Status              StageStatus                         `json:"status"`
	RequiredActions     []RequiredAction                    `json:"requiredActions,omitempty"`
	Failures            []WorkflowFailure                   `json:"failures,omitempty"`
	CreatedAt           time.Time                           `json:"createdAt" ts_type:"string"`
}

DescriptionSet retains descriptions for exact release, projection, and media revisions.

func (DescriptionSet) Clone added in v0.3.0

func (s DescriptionSet) Clone() (DescriptionSet, error)

Clone returns a detached description set.

func (DescriptionSet) Validate added in v0.3.0

func (s DescriptionSet) Validate() error

Validate verifies exact dependency lineage and description fingerprints.

type DescriptionSetID added in v0.3.0

type DescriptionSetID string

DescriptionSetID identifies one immutable generated-description set.

type DescriptionSetRef added in v0.3.0

type DescriptionSetRef struct {
	ID       DescriptionSetID `json:"id"`
	Revision WorkflowRevision `json:"revision"`
}

DescriptionSetRef references one exact description-set revision.

type DescriptionSubject added in v0.3.0

type DescriptionSubject struct {
	// SuppressImportedScreenshotReferences preserves exact user selections during composition.
	SuppressImportedScreenshotReferences map[string]bool `json:"-"`
	TrackerHDRArtifacts                  map[string][]HDRArtifactEvidence
	VideoCodec                           string
	HasEncodeSettings                    bool
	TrackerQuestionnaireAnswers          map[string]map[string]string
	EffectiveMetadata                    EffectiveMetadata
	ManualLanguages                      ManualLanguageFacts
	HardcodedSubs                        bool
	HardcodedSubtitleLanguages           []string
	HardcodedSubtitleCoverage            []SubtitleLanguageCoverage
	MediaBinding                         PreparedMediaBinding
	SourcePath                           string
	DiscType                             string
	MediaInfoTextPath                    string
	DVDVOBMediaInfoText                  string
	DescriptionTemplate                  string
	DescriptionGroups                    []DescriptionBuilderGroup
	EpisodeOverview                      string
	Options                              UploadOptions
	Release                              ReleaseInfo
	SelectedBDMVPlaylists                []PlaylistInfo
	Disc                                 DiscFacts
	Discs                                []DiscEvidenceResource
	Tag                                  string
	Identity                             ExternalIdentity
	ProviderMetadata                     SourceScopedMetadata
	SeasonInt                            int
	EpisodeInt                           int
	Filename                             string
	ReleaseName                          string
	ReleaseNameNoTag                     string
	ServiceLongName                      string
	Type                                 string
	HDR                                  string
	ArrReleaseGroup                      string
	Trackers                             []string
	TrackerConfig                        TrackerConfigOverrides
	TrackerSite                          TrackerSiteOverrides
	ImageHost                            ImageHostOverrides
	TrackerData                          []TrackerMetadata
	ExactMedia                           *ExactMediaAssets
}

DescriptionSubject contains only facts, local resources, and rendering instructions consumed by tracker description builders. VideoCodec and HasEncodeSettings come from the prepared generation; TrackerQuestionnaireAnswers contains operation-local evidence keyed by tracker and field, rather than reusable media facts.

func NewDescriptionSubject added in v0.3.0

func NewDescriptionSubject(subject UploadSubject) DescriptionSubject

NewDescriptionSubject projects upload state into the description builder's read model and detaches mutable collections.

type DescriptionTrackerResult added in v0.3.0

type DescriptionTrackerResult struct {
	TrackerID TrackerID   `json:"trackerId"`
	Status    StageStatus `json:"status"`
	Message   string      `json:"message,omitempty"`
}

DescriptionTrackerResult is one retained tracker-scoped description outcome.

type DiagnosticSeverity added in v0.3.0

type DiagnosticSeverity string

DiagnosticSeverity classifies preparation diagnostics without turning them into workflow outcomes.

const (
	// DiagnosticSeverityInfo records explanatory evidence.
	DiagnosticSeverityInfo DiagnosticSeverity = "info"
	// DiagnosticSeverityWarning records a non-fatal preparation concern.
	DiagnosticSeverityWarning DiagnosticSeverity = "warning"
)

type DiscEvidenceResource added in v0.3.2

type DiscEvidenceResource struct {
	ID                  string
	Name                string
	Type                string
	Root                string
	SelectedPlaylists   []PlaylistInfo
	VideoPath           string
	FileList            []string
	Reports             []DiscReportResource
	MediaInfoJSONPath   string
	MediaInfoTextPath   string
	DVDIFOPath          string
	DVDVOBPath          string
	DVDVOBSet           string
	DurationSeconds     float64
	DVDVOBMediaInfoJSON string
	DVDVOBMediaInfoText string
}

DiscEvidenceResource contains preparation-private evidence for one ordered disc.

type DiscFacts added in v0.3.0

type DiscFacts struct {
	Type            string
	Summary         string
	DurationSeconds float64
	PlaylistCount   int
	DVDVOBSet       string
	PrimaryDiscID   string
	PrimaryReportID string
	Items           []DiscItemFacts
}

DiscFacts contains typed disc measurements that are safe to publish as reusable facts. Local report and media paths remain preparation resources.

func (DiscFacts) AggregateSummary added in v0.3.2

func (d DiscFacts) AggregateSummary() string

AggregateSummary returns deterministic plain-text BDMV evidence in disc and report order. One disc with one report remains unchanged after trimming; larger sets receive safe headings.

func (DiscFacts) CanonicalPrimary added in v0.3.2

func (d DiscFacts) CanonicalPrimary() (discID string, reportID string, durationSeconds float64, dvdVOBSet string)

CanonicalPrimary returns the first disc with a usable title. BDMV reports use highest score with report-order ties; DVD titles use the selected VOB set.

func (DiscFacts) PrimaryReport added in v0.3.2

func (d DiscFacts) PrimaryReport() (DiscItemFacts, DiscReportFacts, bool)

PrimaryReport returns the canonical primary BDMV report when one exists.

func (DiscFacts) SelectedPlaylists added in v0.3.2

func (d DiscFacts) SelectedPlaylists() []PlaylistInfo

SelectedPlaylists returns all canonical selected playlists in disc/report order.

type DiscItemFacts added in v0.3.2

type DiscItemFacts struct {
	ID              string
	Name            string
	Type            string
	Reports         []DiscReportFacts
	DurationSeconds float64
	DVDVOBSet       string
}

DiscItemFacts contains canonical public facts for one ordered source disc.

type DiscMenuDeleteResult added in v0.2.4

type DiscMenuDeleteResult struct {
	// Selection is the deleted manual or automatic menu selection.
	Selection ScreenshotFinalSelection
	// Screenshot is the deleted local screenshot record when one existed.
	Screenshot *Screenshot
	// UploadedImages are deleted local upload records. Remote assets are unchanged.
	UploadedImages []UploadedImageLink
	// ScreenshotSlots are deleted slot records whose selected image was removed.
	ScreenshotSlots []ScreenshotSlot
	// ScreenshotSlotVariants are variants deleted with a slot or because they
	// referenced the removed image.
	ScreenshotSlotVariants []ScreenshotSlotVariant
	// UploadedLinks counts local upload records removed with the selection.
	UploadedLinks int
}

DiscMenuDeleteResult describes local references removed by one atomic menu deletion and retains the records needed for transactional compensation.

type DiscReportFacts added in v0.3.2

type DiscReportFacts struct {
	Playlist PlaylistInfo
	Summary  string
	// HDR10PlusConfirmed records native HDR10+ confirmation for this selected timeline.
	HDR10PlusConfirmed bool
}

DiscReportFacts contains canonical facts for one selected BDMV report.

type DiscReportResource added in v0.3.2

type DiscReportResource struct {
	Playlist        PlaylistInfo
	Summary         string
	ExtSummary      string
	FullSummary     string
	SummaryPath     string
	ExtSummaryPath  string
	FullSummaryPath string
}

DiscReportResource contains one selected BDMV report and its private artifacts.

type DryRunReleaseWorkflowRequest added in v0.3.0

type DryRunReleaseWorkflowRequest struct {
	ReleaseWorkflowCommandContext
	NoSeed     bool        `json:"noSeed"`
	TrackerIDs []TrackerID `json:"trackerIds,omitempty"`
}

DryRunReleaseWorkflowRequest prepares safe reports without tracker submission.

func (DryRunReleaseWorkflowRequest) Validate added in v0.3.0

func (r DryRunReleaseWorkflowRequest) Validate() error

Validate verifies exact workflow authority.

type DupeAssessment added in v0.3.0

type DupeAssessment struct {
	ID               DupeAssessmentID               `json:"id"`
	WorkflowID       WorkflowID                     `json:"workflowId"`
	Revision         WorkflowRevision               `json:"revision"`
	Release          ReleaseSnapshotRef             `json:"release"`
	ReleaseRef       ReleaseRef                     `json:"releaseRef"`
	Selection        TrackerSelectionRef            `json:"selection"`
	ProjectionSet    TrackerReleaseProjectionSetRef `json:"projectionSet"`
	Preflight        *TrackerPreflightAssessmentRef `json:"preflight,omitempty"`
	InputFingerprint WorkflowFingerprint            `json:"inputFingerprint"`
	CheckOrdinal     uint8                          `json:"checkOrdinal,omitempty"`
	Results          []TrackerDupeAssessment        `json:"results"`
	Status           StageStatus                    `json:"status"`
	CreatedAt        time.Time                      `json:"createdAt" ts_type:"string"`
	ExpiresAt        time.Time                      `json:"expiresAt" ts_type:"string"`
}

DupeAssessment retains duplicate results for exact projection and preflight revisions.

func (DupeAssessment) Clone added in v0.3.0

func (s DupeAssessment) Clone() (DupeAssessment, error)

Clone returns a detached duplicate assessment.

func (DupeAssessment) Validate added in v0.3.0

func (s DupeAssessment) Validate() error

Validate verifies exact projection lineage, unique tracker results, and freshness.

type DupeAssessmentEvidence added in v0.3.0

type DupeAssessmentEvidence interface {
	Apply(*DuplicateSubject)
	MarshalBinary() ([]byte, error)
}

DupeAssessmentEvidence is private retained duplicate authority. Public workflow state receives only sanitized candidate projections.

type DupeAssessmentID added in v0.3.0

type DupeAssessmentID string

DupeAssessmentID identifies one immutable duplicate assessment.

type DupeAssessmentRef added in v0.3.0

type DupeAssessmentRef struct {
	ID       DupeAssessmentID `json:"id"`
	Revision WorkflowRevision `json:"revision"`
}

DupeAssessmentRef references one exact duplicate assessment revision.

type DupeCandidateEvaluation added in v0.3.0

type DupeCandidateEvaluation struct {
	EvidenceFingerprint WorkflowFingerprint `json:"evidenceFingerprint,omitempty"`

	ID             string            `json:"id,omitempty"`
	Name           string            `json:"name"`
	Link           string            `json:"link,omitempty"`
	SizeBytes      int64             `json:"sizeBytes,omitempty"`
	Relation       DupeRelation      `json:"relation"`
	Reasons        []DupeReason      `json:"reasons"`
	Flags          []string          `json:"flags,omitempty"`
	HDR            HDRFacts          `json:"hdr"`
	Category       string            `json:"category,omitempty"`
	Type           string            `json:"type,omitempty"`
	Resolution     string            `json:"resolution,omitempty"`
	Source         string            `json:"source,omitempty"`
	Codec          string            `json:"codec,omitempty"`
	Container      string            `json:"container,omitempty"`
	Provider       string            `json:"provider,omitempty"`
	Group          string            `json:"group,omitempty"`
	ReleaseOrigin  string            `json:"releaseOrigin,omitempty"`
	Edition        string            `json:"edition,omitempty"`
	Region         string            `json:"region,omitempty"`
	ThreeD         string            `json:"threeD,omitempty"`
	Repack         string            `json:"repack,omitempty"`
	Season         int               `json:"season,omitempty"`
	Episode        int               `json:"episode,omitempty"`
	Date           string            `json:"date,omitempty"`
	Pack           bool              `json:"pack"`
	Internal       bool              `json:"internal"`
	Trumpable      bool              `json:"trumpable"`
	EvidenceStatus HDREvidenceStatus `json:"evidenceStatus"`
}

DupeCandidateEvaluation is one sanitized per-candidate decision. EvidenceStatus describes HDR evidence only; other comparison dimensions may still be incomplete.

type DupeCheckResult

type DupeCheckResult struct {
	// RequiresStaffToken requires explicit owner attestation before overriding
	// duplicate or incomplete-search evidence; it carries no token contents.
	RequiresStaffToken    bool
	Tracker               string
	CanonicalReleaseName  string
	UploadReleaseName     string
	ProjectionFingerprint WorkflowFingerprint
	CriteriaFingerprint   WorkflowFingerprint
	ProjectionStatus      ReadinessStatus
	PolicyID              string
	PolicyFingerprint     WorkflowFingerprint
	TargetFingerprint     WorkflowFingerprint
	SearchFingerprint     WorkflowFingerprint
	Search                DupeSearchEvidence
	Evaluations           []DupeCandidateEvaluation
	// ReviewReasons require target-level policy acknowledgement, even without candidates.
	ReviewReasons []DupeReason
	HasDupes      bool
	Notes         []string
	Skipped       bool
	SkipReason    string
	// SkipCode is a stable machine-readable skip reason.
	SkipCode  string
	Status    string
	Error     string
	CheckedAt time.Time `ts_type:"string"`
}

DupeCheckResult is the sanitized duplicate-search outcome for one tracker. Private adapter payloads and download authority are retained separately.

type DupeCheckSummary

type DupeCheckSummary struct {
	SourcePath string
	Results    []DupeCheckResult
	Notes      []string
}

DupeCheckSummary groups duplicate-search results for one prepared source path.

type DupeComparisonEvidence added in v0.4.1

type DupeComparisonEvidence struct {
	CandidateID          string              `json:"candidateId,omitempty"`
	CandidateFingerprint WorkflowFingerprint `json:"candidateFingerprint,omitempty"`
	Candidate            DupeReleaseEvidence `json:"candidate"`
	VisualImprovement    bool                `json:"visualImprovement,omitempty"`
	MeaningfulBenefit    string              `json:"meaningfulBenefit,omitempty"`
	Quality              string              `json:"quality,omitempty"`
	DefectImproved       bool                `json:"defectImproved,omitempty"`
	Replacement          string              `json:"replacement,omitempty"`
	Reviewed             bool                `json:"reviewed,omitempty"`
	Source               string              `json:"source,omitempty"`
}

DupeComparisonEvidence binds an explicitly reviewed comparison to the exact existing candidate. Quality is equivalent, superior or inferior from the proposed release's perspective.

type DupeDecision added in v0.3.0

type DupeDecision string

DupeDecision is the retained owner decision for one duplicate result.

const (
	// DupeDecisionPending means review has not resolved the result.
	DupeDecisionPending DupeDecision = "pending"
	// DupeDecisionAccepted means matching evidence blocks upload.
	DupeDecisionAccepted DupeDecision = "accepted"
	// DupeDecisionIgnored means the owner explicitly accepted upload risk.
	DupeDecisionIgnored DupeDecision = "ignored"
	// DupeDecisionNoMatch means no blocking duplicate exists.
	DupeDecisionNoMatch DupeDecision = "no_match"
	// DupeDecisionBypassed means debug authority waived a runtime policy gate.
	DupeDecisionBypassed DupeDecision = "bypassed"
	// DupeDecisionSkipped means backend policy skipped remote search.
	DupeDecisionSkipped DupeDecision = "skipped"
)

type DupeEntry

type DupeEntry struct {
	Evidence DupeReleaseEvidence
	// EnglishSubtitles records positive inspected subtitle-language evidence, never a title inference.
	EnglishSubtitles      bool
	EnglishSubtitlesKnown bool

	// TrackerSlot is opaque tracker-native slot evidence, which may be partial.
	TrackerSlot   string
	Name          string
	SizeBytes     int64
	SizeKnown     bool
	SizeText      string
	Files         []string
	FileCount     int
	Trumpable     bool
	Link          string
	Download      string
	Flags         []string
	FlagsPresent  bool
	FlagsComplete bool
	HDR           HDRFacts
	ID            string
	Type          string
	CanonicalType string
	Res           string
	Category      string
	Source        string
	Codec         string
	Container     string
	Provider      string
	ProviderIDs   []TrackerProviderID
	Group         string
	ReleaseOrigin string
	Edition       string
	Region        string
	ThreeD        string
	Repack        string
	Attributes    map[string]string
	Season        int
	Episode       int
	Pack          bool
	Internal      bool
	MediaInfo     string
	BDInfo        string
	Description   string
}

DupeEntry is one backend adapter's private duplicate-search hit.

type DupeEpisodeMatch

type DupeEpisodeMatch struct {
	ID       string
	Name     string
	Link     string
	Tracker  string
	Internal bool
}

DupeEpisodeMatch identifies an episode-level match found inside a duplicate search result, including season packs that contain the requested episode.

type DupeEvidenceContext added in v0.4.1

type DupeEvidenceContext struct {
	// SlotEvidenceComplete requires authoritative work, content, resolution, media kind and HDR facts.
	SlotEvidenceComplete bool
	Target               TrackerDuplicateTarget
	Candidate            TrackerDuplicateTarget
	CandidateID          string
	CandidateFingerprint WorkflowFingerprint
	Trumpable            bool
	Relation             DupeRelation
	Reason               string
}

DupeEvidenceContext supplies normalized comparison facts and the ordinary policy result.

type DupeEvidenceDecision added in v0.4.1

type DupeEvidenceDecision struct {
	Relation DupeRelation
	Reason   string
}

DupeEvidenceDecision is a tracker-owned evidence overlay; an empty relation preserves the ordinary result.

type DupeMatch

type DupeMatch struct {
	FilenameMatch             string
	FileCountMatch            int
	SizeMatch                 string
	TrumpableID               string
	MatchedID                 string
	MatchedName               string
	MatchedLink               string
	MatchedDownload           string
	MatchedReason             string
	SeasonPackExists          bool
	SeasonPackName            string
	SeasonPackLink            string
	SeasonPackID              string
	SeasonPackContainsEpisode bool
	MatchedEpisodeIDs         []DupeEpisodeMatch
}

DupeMatch is private retained authority for the selected candidate and any cross-seed injection evidence.

type DupeMatchProjection added in v0.3.0

type DupeMatchProjection struct {
	EvidenceFingerprint WorkflowFingerprint `json:"evidenceFingerprint,omitempty"`
	ID                  string              `json:"id,omitempty"`
	Name                string              `json:"name"`
	Link                string              `json:"link,omitempty"`
	SizeBytes           int64               `json:"sizeBytes,omitempty"`
	Flags               []string            `json:"flags,omitempty"`
	Reason              string              `json:"reason,omitempty"`
	Relation            DupeRelation        `json:"relation,omitempty"`
	Reasons             []DupeReason        `json:"reasons,omitempty"`
	HDR                 HDRFacts            `json:"hdr"`
	Category            string              `json:"category,omitempty"`
	Type                string              `json:"type,omitempty"`
	Resolution          string              `json:"resolution,omitempty"`
	Source              string              `json:"source,omitempty"`
	Codec               string              `json:"codec,omitempty"`
	Container           string              `json:"container,omitempty"`
	Provider            string              `json:"provider,omitempty"`
	Group               string              `json:"group,omitempty"`
	ReleaseOrigin       string              `json:"releaseOrigin,omitempty"`
	Edition             string              `json:"edition,omitempty"`
	Region              string              `json:"region,omitempty"`
	ThreeD              string              `json:"threeD,omitempty"`
	Repack              string              `json:"repack,omitempty"`
	Season              int                 `json:"season,omitempty"`
	Episode             int                 `json:"episode,omitempty"`
	Date                string              `json:"date,omitempty"`
	Pack                bool                `json:"pack"`
	Internal            bool                `json:"internal"`
	Trumpable           bool                `json:"trumpable"`
	EvidenceStatus      HDREvidenceStatus   `json:"evidenceStatus,omitempty"`
}

DupeMatchProjection is sanitized duplicate evidence safe for public clients.

type DupeProgressReporter

type DupeProgressReporter func(update DupeProgressUpdate)

type DupeProgressUpdate

type DupeProgressUpdate struct {
	SourcePath string          `json:"sourcePath"`
	Tracker    string          `json:"tracker"`
	Status     string          `json:"status"`
	Message    string          `json:"message"`
	Completed  int             `json:"completed"`
	Total      int             `json:"total"`
	Result     DupeCheckResult `json:"result"`
}

type DupeReason added in v0.3.0

type DupeReason struct {
	Code    string `json:"code"`
	Message string `json:"message,omitempty"`
}

DupeReason pairs a stable evaluator code with a public-safe explanation.

type DupeRelation added in v0.3.0

type DupeRelation string

DupeRelation is one directional proposed-to-candidate relationship.

const (
	DupeRelationExactDuplicate       DupeRelation = "exact_duplicate"
	DupeRelationExistingPreferred    DupeRelation = "existing_preferred"
	DupeRelationSameSlot             DupeRelation = "same_slot"
	DupeRelationProposedTrumps       DupeRelation = "proposed_trumps"
	DupeRelationCoexists             DupeRelation = "coexists"
	DupeRelationManualReview         DupeRelation = "manual_review"
	DupeRelationInsufficientEvidence DupeRelation = "insufficient_evidence"
)

type DupeReleaseEvidence added in v0.4.1

type DupeReleaseEvidence struct {
	PersonalRelease bool   `json:"personalRelease,omitempty"`
	InternalStatus  string `json:"internalStatus,omitempty"`
	Group           string `json:"group,omitempty"`
	BackCatalogue   string `json:"backCatalogue,omitempty"`
	HDRLayerSource  string `json:"hdrLayerSource,omitempty"`
	DiscIdentity    string `json:"discIdentity,omitempty"`
	DiscForm        string `json:"discForm,omitempty"`
}

DupeReleaseEvidence retains verified source facts, independently of naming and upload flags. Empty values are unknown. InternalStatus is internal or non_internal; DiscForm is custom or unmodified.

type DupeSearchEvidence added in v0.3.0

type DupeSearchEvidence struct {
	Complete       bool   `json:"complete"`
	Pages          int    `json:"pages"`
	CandidateCount int    `json:"candidateCount"`
	Scope          string `json:"scope,omitempty"`
	// WorkScope reports how the search was bound to one work
	// (provider_id, tracker_group, or title_fallback).
	WorkScope string `json:"workScope,omitempty"`
	// WrongWorkCount is the number of returned rows excluded because they
	// belonged to a conflicting work.
	WrongWorkCount int      `json:"wrongWorkCount,omitempty"`
	Warnings       []string `json:"warnings,omitempty"`
}

DupeSearchEvidence is the safe completion state of one tracker search.

type DuplicateCheckInput added in v0.3.0

type DuplicateCheckInput struct {
	Release        ReleaseRef
	Trackers       []string
	Interaction    InteractionMode
	IgnoreFor      []string
	Skip           bool
	SkipAsActual   bool
	DoubleCheck    bool
	Authorizations []string
	// TrackerIDs contains explicit tracker IDs that override discovered client evidence.
	TrackerIDs map[string]string
}

DuplicateCheckInput contains duplicate-check choices for one exact prepared generation. It does not carry prepared facts.

type DuplicateSubject added in v0.3.0

type DuplicateSubject struct {
	EffectiveMetadata    EffectiveMetadata
	SourcePath           string
	SourceSize           int64
	VideoPath            string
	FileList             []string
	Filename             string
	SceneName            string
	ReleaseName          string
	Release              ReleaseInfo
	ReleaseNameOverrides ReleaseNameOverrides
	Identity             ExternalIdentity
	ProviderMetadata     SourceScopedMetadata
	TrackerIDs           map[string]string
	DiscType             string
	Disc                 DiscFacts
	Type                 string
	Source               string
	Tag                  string
	HDR                  string
	HDRFacts             HDRFacts
	UHD                  string
	VideoEncode          string
	VideoCodec           string
	HasEncodeSettings    bool
	SeasonInt            int
	EpisodeInt           int
	SeasonStr            string
	EpisodeStr           string
	DailyEpisodeDate     string
	TVPack               bool
	Anime                bool
	MatchedTrackers      []string
	TrackerRuleFailures  map[string][]RuleFailure
	BlockedTrackers      map[string][]TrackerBlockReason
	CrossSeedTorrents    []UploadedTorrent
	// Projection is the exact safe tracker-local interpretation used for this search.
	Projection *TrackerReleaseProjection
}

DuplicateSubject is the duplicate module's source-scoped read model. It contains only facts, instructions, and prior workflow outcomes that affect duplicate search or authorization.

func (DuplicateSubject) CanonicalSeasonEpisode added in v0.3.0

func (s DuplicateSubject) CanonicalSeasonEpisode() (int, int)

CanonicalSeasonEpisode returns the prepared TV season and episode.

type EditionDisplayPart added in v0.4.1

type EditionDisplayPart struct {
	Text    string
	Feature ReleaseFeature `json:",omitempty"`
}

EditionDisplayPart retains one ordered fragment of previously rendered automatic edition wording. Feature references an independently classified release feature; an empty reference is display text, not edition evidence. Only naming and feature-review presentation consume this projection.

func EditionDisplayWithoutThreeD added in v0.4.1

func EditionDisplayWithoutThreeD(parts []EditionDisplayPart) []EditionDisplayPart

EditionDisplayWithoutThreeD returns independent display parts without 3D subtypes or their orphaned separators, preserving the original evidence.

type EffectiveMetadata added in v0.3.2

type EffectiveMetadata struct {
	Title                      string
	AlternateTitle             string
	OriginalTitle              string
	Year                       int
	Genres                     []string
	OriginalLanguage           string
	Distributor                string
	TitleProvenance            FactProvenance
	AlternateTitleProvenance   FactProvenance
	OriginalTitleProvenance    FactProvenance
	YearProvenance             FactProvenance
	GenresProvenance           FactProvenance
	OriginalLanguageProvenance FactProvenance
	DistributorProvenance      FactProvenance
}

EffectiveMetadata contains detached resolved descriptive facts. Provider snapshots remain evidence; preference methods preserve manual authority.

func (EffectiveMetadata) PreferredAlternateTitle added in v0.3.2

func (m EffectiveMetadata) PreferredAlternateTitle(provider string) string

PreferredAlternateTitle preserves an explicit empty alternate title.

func (EffectiveMetadata) PreferredDistributor added in v0.3.2

func (m EffectiveMetadata) PreferredDistributor(provider string) string

PreferredDistributor preserves explicit distributor clears.

func (EffectiveMetadata) PreferredGenres added in v0.3.2

func (m EffectiveMetadata) PreferredGenres(provider []string) []string

PreferredGenres returns a detached list, retaining an explicit empty correction.

func (EffectiveMetadata) PreferredOriginalLanguage added in v0.3.2

func (m EffectiveMetadata) PreferredOriginalLanguage(provider string) string

PreferredOriginalLanguage preserves explicit language clears.

func (EffectiveMetadata) PreferredOriginalTitle added in v0.3.2

func (m EffectiveMetadata) PreferredOriginalTitle(provider string) string

PreferredOriginalTitle preserves an explicit empty original title.

func (EffectiveMetadata) PreferredTitle added in v0.3.2

func (m EffectiveMetadata) PreferredTitle(provider string) string

PreferredTitle selects manual intent, then the tracker's provider, then the canonical title.

func (EffectiveMetadata) PreferredYear added in v0.3.2

func (m EffectiveMetadata) PreferredYear(provider int) int

PreferredYear selects the manual year before a tracker-preferred provider year.

type EncodeSettingsStatus added in v0.3.0

type EncodeSettingsStatus string

EncodeSettingsStatus records the concrete MediaInfo encode-settings assessment.

const (
	// EncodeSettingsStatusUnknown means preparation has not established the fact.
	EncodeSettingsStatusUnknown EncodeSettingsStatus = "unknown"
	// EncodeSettingsStatusNotApplicable means the source does not require encode settings.
	EncodeSettingsStatusNotApplicable EncodeSettingsStatus = "not_applicable"
	// EncodeSettingsStatusPresent means required encode settings are present.
	EncodeSettingsStatusPresent EncodeSettingsStatus = "present"
	// EncodeSettingsStatusMissing means required encode settings are absent.
	EncodeSettingsStatusMissing EncodeSettingsStatus = "missing"
)

type EpisodeFacts added in v0.3.0

type EpisodeFacts struct {
	Season  int
	Episode int
	// MultipleEpisodes retains known combined or conflicting source episode membership.
	MultipleEpisodes  bool
	SeasonLabel       string
	EpisodeLabel      string
	DailyDate         string
	Pack              bool
	Title             string
	Overview          string
	Year              int
	AiredDate         string
	AirDays           []string
	AirTime           string
	AirTimezone       string
	AirTimezoneSource string
	DateMatched       bool
}

EpisodeFacts contains canonical reusable episodic identity and schedule facts, independent of tracker policy.

type EpisodeTitleMode added in v0.3.0

type EpisodeTitleMode string

EpisodeTitleMode controls automatic episode-title rendering in generated release names.

const (
	// EpisodeTitleModeUnspecified inherits the shared include default.
	EpisodeTitleModeUnspecified EpisodeTitleMode = ""
	// EpisodeTitleModeInclude keeps an automatically generated single-episode title.
	EpisodeTitleModeInclude EpisodeTitleMode = "include"
	// EpisodeTitleModeOmit removes an automatically generated single-episode title.
	EpisodeTitleModeOmit EpisodeTitleMode = "omit"
)

func NormalizeEpisodeTitleMode added in v0.3.0

func NormalizeEpisodeTitleMode(mode EpisodeTitleMode) EpisodeTitleMode

NormalizeEpisodeTitleMode resolves the shared unspecified default while preserving unsupported values for policy validation.

type ExactMediaAssets added in v0.3.0

type ExactMediaAssets struct {
	// ImageHostUploadSkipped preserves the workflow's explicit upload opt-out.
	// Compatible cached links remain usable, but missing variants must not trigger uploads.
	ImageHostUploadSkipped bool
	HDRAnalysis            *HDRAnalysisRef
	HDRPlots               []HDRDescriptionPlot
	HDRStats               []HDRDescriptionStats
	HDRUploads             []UploadedImageLink
	HDRUploadHosts         map[string]string
	Screenshots            []ScreenshotImage
	DVDMenus               []DVDMenuCaptureImage
	ScreenshotUploads      []UploadedImageLink
	DVDMenuUploads         []UploadedImageLink
	AudioAnalysis          *AudioAnalysisRef
	AudioTracks            []AudioDescriptionTrack
	AudioUploads           []UploadedImageLink
	AudioUploadHosts       map[string]string
}

ExactMediaAssets is one authoritative workflow-owned media revision. Screenshots, DVD menus, and audio analysis are independent channels, as are their hosted variants. Audio tracks, uploads, and host choices require an AudioAnalysis reference to the exact revision used for a description.

func (*ExactMediaAssets) Clone added in v0.3.0

func (a *ExactMediaAssets) Clone() *ExactMediaAssets

Clone returns a detached exact-media bundle while preserving nil slices. It retains the hosting opt-out and returns nil for a nil receiver.

func (*ExactMediaAssets) Validate added in v0.3.0

func (a *ExactMediaAssets) Validate() error

Validate enforces the normal-screenshot and DVD-menu channel boundary.

type ExecutionOptions

type ExecutionOptions struct {
	QueueName         string
	QueueLimit        int
	SiteCheck         bool
	SiteUploadTracker string
}

ExecutionOptions controls queued and site-check execution behavior.

type ExternalFreshness added in v0.3.5

type ExternalFreshness string

ExternalFreshness controls whether preparation may reuse retained external provider facts, retry empty results on a new input load, or fetch current data.

const (
	// ExternalFreshnessReuse permits retained provider facts to satisfy an
	// ordinary preparation request.
	ExternalFreshnessReuse ExternalFreshness = ""
	// ExternalFreshnessLoad permits a newly loaded input to retry retained empty
	// provider results while reusing successful facts and completed failures.
	ExternalFreshnessLoad ExternalFreshness = "load"
	// ExternalFreshnessRefresh requires current provider responses. It is a
	// one-shot collection control and does not change preparation compatibility.
	ExternalFreshnessRefresh ExternalFreshness = "refresh"
)

func (ExternalFreshness) RequiresRefresh added in v0.3.5

func (freshness ExternalFreshness) RequiresRefresh() bool

RequiresRefresh reports whether provider collection must obtain current data.

type ExternalIDInfo

type ExternalIDInfo struct {
	Provider string
	ID       int
	Source   string
}

ExternalIDInfo is the user-visible provider ID plus the resolver source label that produced it.

type ExternalIDOverrides

type ExternalIDOverrides struct {
	TMDBID   *int
	IMDBID   *int
	TVDBID   *int
	TVmazeID *int
	// MALID carries caller intent for the canonical MAL/AniList-compatible
	// anime identifier. Nil leaves resolution unchanged; zero clears it.
	MALID *int
}

ExternalIDOverrides carries caller-supplied ID intent into metadata resolution. Nil means the resolver may fill the provider; a positive value locks that provider to the supplied ID; zero locks an explicit clear for the current request.

type ExternalIdentity added in v0.3.0

type ExternalIdentity struct {
	SourcePath   string
	Generation   PreparedGeneration
	TMDBID       int
	IMDBID       int
	TVDBID       int
	TVmazeID     int
	MALID        int
	Category     CanonicalCategory
	Provenance   IdentityProvenanceSet
	Overrides    IdentityOverrideState
	Conflict     IdentityConflictStatus
	Resolution   IdentityResolutionKey
	Dependencies IdentityDependencySet
	ResolvedAt   time.Time `ts_type:"string"`
}

ExternalIdentity is the only prepared-release source for provider IDs and top-level movie-or-TV classification.

func (ExternalIdentity) ProviderID added in v0.3.0

func (i ExternalIdentity) ProviderID(provider IdentityProvider) (int, bool)

ProviderID returns the canonical ID for provider without applying fallbacks.

func (ExternalIdentity) RequireCategory added in v0.3.0

func (i ExternalIdentity) RequireCategory() (CanonicalCategory, error)

RequireCategory returns the canonical category or a typed missing requirement error.

func (ExternalIdentity) RequireProviderID added in v0.3.0

func (i ExternalIdentity) RequireProviderID(provider IdentityProvider) (int, error)

RequireProviderID returns one canonical provider ID or a typed missing requirement error.

func (ExternalIdentity) WithoutResetPins added in v0.3.2

func (identity ExternalIdentity) WithoutResetPins(fields []CorrectionField) ExternalIdentity

WithoutResetPins removes prior explicit pins for fields returned to Auto. Automatic provider and legacy evidence, and unrelated explicit pins, remain available.

type ExternalIdentityCandidate added in v0.3.0

type ExternalIdentityCandidate struct {
	Provider      IdentityProvider
	ID            int
	Title         string
	OriginalTitle string
	Year          int
	Category      CanonicalCategory
	MediaType     string
	Overview      string
	PosterURL     string
	Similarity    float64
}

ExternalIdentityCandidate is possible provider evidence exposed for review, never a canonical external-identity fact.

type FactProvenance added in v0.3.2

type FactProvenance string

FactProvenance identifies how a finalized field was selected.

const (
	FactProvenanceAutomatic   FactProvenance = "automatic"
	FactProvenanceManual      FactProvenance = "manual"
	FactProvenanceManualEmpty FactProvenance = "manual_empty"
)

func (FactProvenance) IsManual added in v0.3.2

func (p FactProvenance) IsManual() bool

IsManual reports whether even an empty resolved value has explicit authority.

type FailedTrackerRetryRef added in v0.3.0

type FailedTrackerRetryRef struct {
	Result     UploadResultRef `json:"result"`
	TrackerIDs []TrackerID     `json:"trackerIds"`
}

FailedTrackerRetryRef targets only failed trackers from one exact prior result.

type FileMetadata

type FileMetadata struct {
	Path       string
	InfoHash   string
	UpdatedAt  time.Time `ts_type:"string"`
	DiscType   string
	VideoPath  string
	FileList   []string
	SourceSize int64
	Scene      bool
	SceneName  string
	SceneIMDB  int
	// Category is the normalized movie/TV content category that drives upload
	// logic. It is seeded from release parsing but should be overridden by a
	// supported TrackerMetadata.Category when that value is available, since a
	// site-reported movie/TV category is the authoritative classification for
	// the upload.
	Category   Category
	Type       string
	Artist     string
	Title      string
	Subtitle   string
	Alt        string
	Year       int
	Month      int
	Day        int
	Source     string
	Resolution string
	Codec      []string
	Audio      []string
	HDR        []string
	Ext        string
	Language   []string
	Site       string
	Genre      string
	Channels   string
	Collection string
	Region     string
	Size       string
	Group      string
	Disc       string
	Cut        []string
	Edition    []string
	Other      []string
}

type FilesystemService

type FilesystemService interface {
	ValidatePaths(ctx context.Context, paths []string) ([]string, error)
}

type FramePreview added in v0.3.0

type FramePreview struct {
	ID               PublicResourceID   `json:"id"`
	WorkflowID       WorkflowID         `json:"workflowId"`
	WorkflowRevision WorkflowRevision   `json:"workflowRevision"`
	Release          ReleaseSnapshotRef `json:"release"`
	// DiscID identifies the prepared disc used for the preview.
	DiscID string `json:"discId,omitempty"`
	// DiscName is the safe page-facing label for DiscID.
	DiscName         string    `json:"discName,omitempty"`
	TimestampSeconds float64   `json:"timestampSeconds"`
	ContentURL       string    `json:"contentUrl"`
	ExpiresAt        time.Time `json:"expiresAt" ts_type:"string"`
}

FramePreview is one non-authoritative opaque frame preview.

type GenerateReleaseWorkflowDescriptionsRequest added in v0.3.0

type GenerateReleaseWorkflowDescriptionsRequest struct {
	ReleaseWorkflowCommandContext
	Instructions DescriptionInstructions `json:"instructions"`
}

GenerateReleaseWorkflowDescriptionsRequest generates authoritative descriptions.

func (GenerateReleaseWorkflowDescriptionsRequest) Validate added in v0.3.0

Validate verifies exact revision authority.

type GeneratedReleaseNameVariants added in v0.3.0

type GeneratedReleaseNameVariants struct {
	// IncludeEpisodeTitle retains the canonical single-episode title.
	IncludeEpisodeTitle ReleaseNameVariant
	// OmitEpisodeTitle removes only the automatically generated episode title.
	OmitEpisodeTitle ReleaseNameVariant
}

GeneratedReleaseNameVariants contains safe structural alternatives produced by the canonical name builder. Empty variants mean the current name must not be treated as automatically generated.

type GetReleaseWorkflowMediaPlanRequest added in v0.3.0

type GetReleaseWorkflowMediaPlanRequest struct {
	WorkflowID WorkflowID `json:"workflowId"`
}

GetReleaseWorkflowMediaPlanRequest retrieves the safe media plan for one workflow.

func (GetReleaseWorkflowMediaPlanRequest) Validate added in v0.3.0

Validate rejects an empty workflow lookup.

type GetReleaseWorkflowRequest added in v0.3.0

type GetReleaseWorkflowRequest struct {
	WorkflowID WorkflowID `json:"workflowId"`
}

GetReleaseWorkflowRequest retrieves one owner-scoped workflow.

func (GetReleaseWorkflowRequest) Validate added in v0.3.0

func (r GetReleaseWorkflowRequest) Validate() error

Validate rejects an empty workflow lookup.

type GoalAvailability added in v0.3.0

type GoalAvailability struct {
	Goal       WorkflowGoal `json:"goal"`
	Available  bool         `json:"available"`
	ReasonCode string       `json:"reasonCode,omitempty"`
	Reason     string       `json:"reason,omitempty"`
}

GoalAvailability reports backend-owned transition policy for one goal.

type HDRAnalysisArtifact added in v0.4.1

type HDRAnalysisArtifact struct {
	ID     PublicResourceID `json:"id"`
	Width  int              `json:"width"`
	Height int              `json:"height"`
}

type HDRAnalysisError added in v0.4.1

type HDRAnalysisError struct {
	Failure HDRAnalysisFailure
	// contains filtered or unexported fields
}

HDRAnalysisError carries a typed target failure while preserving its diagnostic cause.

func (*HDRAnalysisError) Error added in v0.4.1

func (e *HDRAnalysisError) Error() string

func (*HDRAnalysisError) Unwrap added in v0.4.1

func (e *HDRAnalysisError) Unwrap() error

type HDRAnalysisFailure added in v0.4.1

type HDRAnalysisFailure struct {
	Code    HDRAnalysisFailureCode `json:"code"`
	Message string                 `json:"message"`
}

func AsHDRAnalysisFailure added in v0.4.1

func AsHDRAnalysisFailure(err error) (HDRAnalysisFailure, bool)

AsHDRAnalysisFailure retrieves a valid typed failure through wrapped errors.

func (HDRAnalysisFailure) Validate added in v0.4.1

func (f HDRAnalysisFailure) Validate() error

type HDRAnalysisFailureCode added in v0.4.1

type HDRAnalysisFailureCode string
const (
	HDRAnalysisFailureInvalidSelection    HDRAnalysisFailureCode = "invalid_selection"
	HDRAnalysisFailureAmbiguousBinding    HDRAnalysisFailureCode = "ambiguous_binding"
	HDRAnalysisFailureStaleSource         HDRAnalysisFailureCode = "stale_source"
	HDRAnalysisFailureAbsent              HDRAnalysisFailureCode = "absent_hdr10plus"
	HDRAnalysisFailureUnsupportedInput    HDRAnalysisFailureCode = "unsupported_input"
	HDRAnalysisFailureUnsupportedMetadata HDRAnalysisFailureCode = "unsupported_metadata"
	HDRAnalysisFailureInvalidBitstream    HDRAnalysisFailureCode = "invalid_bitstream"
	HDRAnalysisFailureIncomplete          HDRAnalysisFailureCode = "incomplete_extraction"
	HDRAnalysisFailureResourceLimit       HDRAnalysisFailureCode = "resource_limit"
	HDRAnalysisFailureRead                HDRAnalysisFailureCode = "read_failed"
	HDRAnalysisFailureOutput              HDRAnalysisFailureCode = "output_failed"
	HDRAnalysisFailureCanceled            HDRAnalysisFailureCode = "canceled"
	HDRAnalysisFailureInterrupted         HDRAnalysisFailureCode = "interrupted"
	HDRAnalysisFailureResourceUnavailable HDRAnalysisFailureCode = "resource_unavailable"
)

type HDRAnalysisFormats added in v0.4.1

type HDRAnalysisFormats string

HDRAnalysisFormats controls collectors in one shared source traversal.

const (
	HDRAnalysisFormatsAuto        HDRAnalysisFormats = "auto"
	HDRAnalysisFormatsHDR10Plus   HDRAnalysisFormats = "hdr10plus"
	HDRAnalysisFormatsDolbyVision HDRAnalysisFormats = "dolby-vision"
	HDRAnalysisFormatsBoth        HDRAnalysisFormats = "both"
)

func (HDRAnalysisFormats) Normalize added in v0.4.1

func (f HDRAnalysisFormats) Normalize() (HDRAnalysisFormats, error)

Normalize maps an empty selection to auto and rejects unknown collector selections.

func (HDRAnalysisFormats) ValidateResults added in v0.4.1

func (f HDRAnalysisFormats) ValidateResults(results []HDRFormatResult) error

ValidateResults binds outcomes to the selected collectors for both retained extraction manifests and public analysis results.

type HDRAnalysisInstructions added in v0.4.1

type HDRAnalysisInstructions struct {
	Decoded        *HDRDecodedOptions `json:"decoded,omitempty"`
	DecodedRetry   *HDRDecodedRetry   `json:"decodedRetry,omitempty"`
	Formats        HDRAnalysisFormats `json:"formats,omitempty"`
	Release        ReleaseRef         `json:"release"`
	TargetIDs      []string           `json:"targetIds"`
	PeakSource     HDRPeakSource      `json:"peakSource"`
	ProfileVersion string             `json:"profileVersion"`
}

HDRAnalysisInstructions selects ordered targets from one exact prepared generation.

func (HDRAnalysisInstructions) Normalize added in v0.4.1

Normalize validates the release reference and unique targets, copies the target slice, and supplies default estimator/profile values. Prepared-source membership is resolved separately.

type HDRAnalysisRef added in v0.4.1

type HDRAnalysisRef struct {
	ID       HDRAnalysisResultID `json:"id"`
	Revision WorkflowRevision    `json:"revision"`
}

HDRAnalysisRef identifies a retained plot result at its exact workflow revision.

type HDRAnalysisRequest added in v0.4.1

type HDRAnalysisRequest struct {
	Decoded    *HDRDecodedOptions `json:"decoded,omitempty"`
	Formats    HDRAnalysisFormats `json:"formats,omitempty"`
	TargetIDs  []string           `json:"targetIds,omitempty"`
	PeakSource HDRPeakSource      `json:"peakSource,omitempty"`
}

HDRAnalysisRequest requests complete HDR analysis before hosting and descriptions. An omitted target set is resolved only when one prepared target exists.

func (HDRAnalysisRequest) Normalize added in v0.4.1

func (r HDRAnalysisRequest) Normalize() (HDRAnalysisRequest, error)

Normalize validates target IDs, copies the selection and defaults the estimator. An empty target selection remains deferred to prepared-target resolution.

type HDRAnalysisResult added in v0.4.1

type HDRAnalysisResult struct {
	Decoded             *HDRDecodedOptions        `json:"decoded,omitempty"`
	Formats             HDRAnalysisFormats        `json:"formats,omitempty"`
	ID                  HDRAnalysisResultID       `json:"id"`
	WorkflowID          WorkflowID                `json:"workflowId"`
	Revision            WorkflowRevision          `json:"revision"`
	Release             ReleaseRef                `json:"release"`
	ManifestFingerprint string                    `json:"manifestFingerprint"`
	RenderFingerprint   string                    `json:"renderFingerprint,omitempty"`
	AttemptID           string                    `json:"attemptId"`
	TargetIDs           []string                  `json:"targetIds"`
	PeakSource          HDRPeakSource             `json:"peakSource"`
	ProfileVersion      string                    `json:"profileVersion"`
	Status              StageStatus               `json:"status"`
	Targets             []HDRAnalysisTargetResult `json:"targets"`
	CreatedAt           time.Time                 `json:"createdAt" ts_type:"string"`
	CompletedAt         *time.Time                `json:"completedAt,omitempty" ts_type:"string"`
}

HDRAnalysisResult retains terminal target outcomes and plot references for one workflow attempt.

func (HDRAnalysisResult) CanIncludeDefaultImages added in v0.4.1

func (r HDRAnalysisResult) CanIncludeDefaultImages() bool

CanIncludeDefaultImages reflects native plots and primary-audio outputs. Picture-check images remain eligible through an explicit artifact selection.

func (HDRAnalysisResult) CanIncludeImages added in v0.4.1

func (r HDRAnalysisResult) CanIncludeImages() bool

CanIncludeImages reports usable description images or primary-audio statistics.

func (HDRAnalysisResult) TargetNeedsSourceRetry added in v0.4.1

func (r HDRAnalysisResult) TargetNeedsSourceRetry(id string) bool

TargetNeedsSourceRetry identifies an explicit retry after unavailable retained metadata. Only a failed resource_unavailable outcome authorizes bypassing the target's retained extraction.

func (HDRAnalysisResult) Validate added in v0.4.1

func (r HDRAnalysisResult) Validate() error

Validate checks result identity, ordered terminal targets and aggregate/artifact metadata. Prepared-source and retained-file authority must be verified separately.

type HDRAnalysisResultID added in v0.4.1

type HDRAnalysisResultID string

type HDRAnalysisSubject added in v0.4.1

type HDRAnalysisSubject struct {
	Release             ReleaseRef
	SourceFingerprint   string
	ManifestFingerprint string
	MediaBinding        PreparedMediaBinding
	Title               string
	Targets             []HDRAnalysisTargetSubject
}

HDRAnalysisSubject contains private path authority for one prepared generation.

type HDRAnalysisTarget added in v0.4.1

type HDRAnalysisTarget struct {
	Evidence        HDRSourceEvidence `json:"evidence,omitempty"`
	ID              string            `json:"id"`
	Label           string            `json:"label"`
	Playlist        string            `json:"playlist,omitempty"`
	SelectionPolicy string            `json:"selectionPolicy"`
	Supported       bool              `json:"supported"`
	Reason          string            `json:"reason,omitempty"`
}

HDRAnalysisTarget supplies safe inventory evidence; extraction establishes actual metadata presence.

type HDRAnalysisTargetResult added in v0.4.1

type HDRAnalysisTargetResult struct {
	Decoded   []HDRDecodedResult   `json:"decoded,omitempty"`
	Formats   []HDRFormatResult    `json:"formats,omitempty"`
	Artifacts []HDRTypedArtifact   `json:"artifacts,omitempty"`
	TargetID  string               `json:"targetId"`
	Label     string               `json:"label"`
	Status    StageStatus          `json:"status"`
	Frames    int                  `json:"frames"`
	Scenes    int                  `json:"scenes"`
	Profile   string               `json:"profile,omitempty"`
	Artifact  *HDRAnalysisArtifact `json:"artifact,omitempty"`
	Failure   *HDRAnalysisFailure  `json:"failure,omitempty"`
}

func (HDRAnalysisTargetResult) AnalysisStatus added in v0.4.1

func (t HDRAnalysisTargetResult) AnalysisStatus() StageStatus

AnalysisStatus includes optional measurement outcomes without changing the independently reusable native-format outcomes.

func (HDRAnalysisTargetResult) ArtifactGenerationComplete added in v0.4.1

func (t HDRAnalysisTargetResult) ArtifactGenerationComplete(artifact HDRTypedArtifact) bool

ArtifactGenerationComplete reports completed source extraction or measured decoding for this exact artifact. Check verdicts do not establish completion.

func (HDRAnalysisTargetResult) AudioStatistics added in v0.4.1

func (t HDRAnalysisTargetResult) AudioStatistics() (HDRTypedArtifact, bool)

AudioStatistics identifies retained text from a successful primary-audio result.

func (HDRAnalysisTargetResult) AudioStatisticsEntries added in v0.4.1

func (t HDRAnalysisTargetResult) AudioStatisticsEntries() []HDRTypedArtifact

AudioStatisticsEntries returns every successful selected track's statistics in source order. Legacy primary-only results retain their original ordering.

func (HDRAnalysisTargetResult) DescriptionImages added in v0.4.1

func (t HDRAnalysisTargetResult) DescriptionImages() []HDRTypedArtifact

DescriptionImages projects native plots and successful primary-audio images. Picture checks remain opt-in; reports are never hosted.

func (HDRAnalysisTargetResult) NativeStatus added in v0.4.1

func (t HDRAnalysisTargetResult) NativeStatus() StageStatus

NativeStatus folds requested supported work; opportunistic verified absence does not make a successful single-format source partial.

func (HDRAnalysisTargetResult) SelectableImages added in v0.4.1

func (t HDRAnalysisTargetResult) SelectableImages() []HDRTypedArtifact

SelectableImages also includes successful picture checks for explicit selection.

type HDRAnalysisTargetSubject added in v0.4.1

type HDRAnalysisTargetSubject struct {
	// Audio is nil for unknown scope; a non-nil subject with no tracks records
	// inspected audio absence for this exact file and prepared generation.
	Audio                *AudioAnalysisSubject
	Target               HDRAnalysisTarget
	Path                 string
	DiscRoot             string
	CapturedPath         string
	CapturedNativePath   string
	CapturedNativeSize   int64
	CapturedNativeSHA256 string
	CapturedSize         int64
	CapturedSHA256       string
	CapturedTrackID      uint64
	CapturedAbsent       bool
	CapturedFailure      *HDRAnalysisFailure
}

type HDRArtifactEvidence added in v0.4.1

type HDRArtifactEvidence struct {
	// GenerationComplete records completed extraction/measurement, never a quality verdict.
	GenerationComplete     bool             `json:"generationComplete"`
	Analysis               HDRAnalysisRef   `json:"analysis"`
	ArtifactID             PublicResourceID `json:"artifactId"`
	Kind                   HDRArtifactKind  `json:"kind"`
	TargetID               string           `json:"targetId"`
	MeasurementFingerprint string           `json:"measurementFingerprint,omitempty"`
	RenderFingerprint      string           `json:"renderFingerprint,omitempty"`
	ImageURLs              []string         `json:"imageUrls,omitempty"`
}

HDRArtifactEvidence identifies a selected, source-bound analysis image without local paths. Hosted URLs establish description inclusion, not the quality of the underlying evidence.

type HDRArtifactKind added in v0.4.1

type HDRArtifactKind string
const (
	HDRArtifactPicturePlot                 HDRArtifactKind = "picture_brightness_plot"
	HDRArtifactReferencePicturePlot        HDRArtifactKind = "reference_brightness_plot"
	HDRArtifactDVOverlay                   HDRArtifactKind = "dolby_vision_overlay"
	HDRArtifactHDR10PlusOverlay            HDRArtifactKind = "hdr10plus_overlay"
	HDRArtifactDVDifference                HDRArtifactKind = "dolby_vision_difference"
	HDRArtifactHDR10PlusDifference         HDRArtifactKind = "hdr10plus_difference"
	HDRArtifactDVSceneSheet                HDRArtifactKind = "dolby_vision_scene_sheet"
	HDRArtifactHDR10PlusSceneSheet         HDRArtifactKind = "hdr10plus_scene_sheet"
	HDRArtifactBoundaryDVSceneSheet        HDRArtifactKind = "boundary_dolby_vision_scene_sheet"
	HDRArtifactBoundaryHDR10PlusSceneSheet HDRArtifactKind = "boundary_hdr10plus_scene_sheet"
	HDRArtifactAutomaticArea               HDRArtifactKind = "automatic_active_area"
	HDRArtifactAutomaticGrade              HDRArtifactKind = "automatic_grade_difference"
	HDRArtifactAutomaticColour             HDRArtifactKind = "automatic_colour_bias"
	HDRArtifactChromaticity                HDRArtifactKind = "chromaticity_plot"
	HDRArtifactAudioWaveform               HDRArtifactKind = "audio_waveform"
	HDRArtifactAudioSpectrogram            HDRArtifactKind = "audio_spectrogram"
	HDRArtifactAudioStats                  HDRArtifactKind = "audio_stats"
	HDRArtifactHDR10PlusPlot               HDRArtifactKind = "hdr10plus_plot"
	HDRArtifactSceneContactSheet           HDRArtifactKind = "scene_contact_sheet"
	HDRArtifactActiveAreaContactSheet      HDRArtifactKind = "active_area_contact_sheet"
	HDRArtifactGradePlot                   HDRArtifactKind = "grade_plot"
	HDRArtifactColourPlot                  HDRArtifactKind = "colour_plot"
	HDRArtifactDolbyVisionL1Plot           HDRArtifactKind = "dolby_vision_l1_plot"
	HDRArtifactStructuralReport            HDRArtifactKind = "structural_report"
)

func (HDRArtifactKind) DecodedMode added in v0.4.1

func (k HDRArtifactKind) DecodedMode() HDRDecodedMode

DecodedMode returns the owning decoded analysis mode, or empty for native plots and reports.

func (HDRArtifactKind) ImageDimensions added in v0.4.1

func (k HDRArtifactKind) ImageDimensions() (int, int)

ImageDimensions returns the fixed raster size, or zeroes for non-image and unknown kinds.

func (HDRArtifactKind) MatchesFilename added in v0.4.1

func (kind HDRArtifactKind) MatchesFilename(name string) bool

MatchesFilename accepts the fixed artifact name or, for audio, a hashed track name.

type HDRAudioTrackResult added in v0.4.1

type HDRAudioTrackResult struct {
	TrackID       string                `json:"trackId"`
	Ordinal       int                   `json:"ordinal"`
	Language      string                `json:"language,omitempty"`
	Codec         string                `json:"codec"`
	ChannelLayout string                `json:"channelLayout"`
	State         HDRDecodedState       `json:"state"`
	PCMMeasured   bool                  `json:"pcmMeasured"`
	Channels      int                   `json:"channels"`
	SampleRate    int                   `json:"sampleRate"`
	SampleFrames  int64                 `json:"sampleFrames"`
	Artifacts     []PublicResourceID    `json:"artifacts"`
	Failure       *AudioAnalysisFailure `json:"failure,omitempty"`
}

HDRAudioTrackResult distinguishes complete PCM measurement from artifact publication. Artifacts contains only successful variants belonging to this exact prepared track.

type HDRCheckResult added in v0.4.1

type HDRCheckResult struct {
	Code    string        `json:"code"`
	State   HDRCheckState `json:"state"`
	Message string        `json:"message"`
}

HDRCheckResult is a structured observation about metadata or an associated artifact.

type HDRCheckState added in v0.4.1

type HDRCheckState string
const (
	HDRCheckPass         HDRCheckState = "pass"
	HDRCheckWarning      HDRCheckState = "warning"
	HDRCheckFail         HDRCheckState = "fail"
	HDRCheckInconclusive HDRCheckState = "inconclusive"
	HDRCheckNotRun       HDRCheckState = "not_run"
	HDRCheckUnsupported  HDRCheckState = "unsupported"
)

type HDRComparisonOptions added in v0.4.1

type HDRComparisonOptions struct {
	// SourceID is the private, generation-bound comparison handle, not a path.
	SourceID string `json:"sourceId"`
	// FrameOffset maps primary index A to B = A + offset. Nil is invalid; zero is explicit alignment.
	FrameOffset *int    `json:"frameOffset"`
	Crop        HDRCrop `json:"crop"`
	Grade       bool    `json:"grade"`
	Colour      bool    `json:"colour"`
}

HDRComparisonOptions binds paired measurements to an explicitly selected source B. Measurements use the same crop on both sources without resizing or automatic alignment.

type HDRComparisonSelection added in v0.4.1

type HDRComparisonSelection struct {
	Path string `json:"path"`
}

HDRComparisonSelection is explicit source-selection intent for an initial upload. It is replaced by a private generation-bound handle after preparation.

func (HDRComparisonSelection) Validate added in v0.4.1

func (s HDRComparisonSelection) Validate(request *HDRAnalysisRequest) error

Validate requires unresolved comparison options: the request's SourceID must still be empty.

type HDRComparisonSourceRef added in v0.4.1

type HDRComparisonSourceRef struct {
	ID          string     `json:"id"`
	Fingerprint string     `json:"fingerprint"`
	Release     ReleaseRef `json:"release"`
	ExpiresAt   time.Time  `json:"expiresAt"`
}

HDRComparisonSourceRef identifies private source B without exposing its path. Its handle is valid only for Release and before ExpiresAt.

type HDRCoverage added in v0.4.1

type HDRCoverage string

HDRCoverage describes metadata presence across the retained output timeline. A completed scan may still have partial or absent metadata coverage.

const (
	HDRCoverageComplete HDRCoverage = "complete"
	HDRCoveragePartial  HDRCoverage = "partial"
	HDRCoverageAbsent   HDRCoverage = "absent"
	HDRCoverageUnknown  HDRCoverage = "unknown"
)

type HDRCrop added in v0.4.1

type HDRCrop struct {
	Left   int `json:"left"`
	Top    int `json:"top"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

HDRCrop is a rectangle in each source's coded-pixel coordinates. Width and height must be positive even values; decoding checks actual raster bounds.

type HDRDecodedMode added in v0.4.1

type HDRDecodedMode string

HDRDecodedMode identifies audio or picture analysis, separate from native metadata extraction.

const (
	HDRDecodedAutomatic    HDRDecodedMode = "automatic"
	HDRDecodedBoundarySync HDRDecodedMode = "boundary_sync"
	HDRDecodedAudio        HDRDecodedMode = "audio"
	HDRDecodedSceneSync    HDRDecodedMode = "scene_sync"
	HDRDecodedActiveArea   HDRDecodedMode = "active_area"
	HDRDecodedGrade        HDRDecodedMode = "grade"
	HDRDecodedColour       HDRDecodedMode = "colour"
)

func HDRDecodedModes added in v0.4.1

func HDRDecodedModes() []HDRDecodedMode

HDRDecodedModes returns the public terminal-outcome order.

type HDRDecodedOptions added in v0.4.1

type HDRDecodedOptions struct {
	Automatic           bool `json:"automatic,omitempty"`
	BoundarySync        bool `json:"boundarySync,omitempty"`
	AllAudioTracks      bool `json:"allAudioTracks,omitempty"`
	VideoDecoderThreads int  `json:"videoDecoderThreads,omitempty"`
	// Audio requests complete primary audio alongside native metadata without picture decoding.
	// Automatic already includes audio; Normalize removes a redundant Audio selection.
	Audio bool `json:"audio,omitempty"`
	// Sampled reduces picture measurement while retaining complete native metadata and audio.
	// False preserves existing full-frame requests and retained measurement identities.
	Sampled    bool                  `json:"sampled,omitempty"`
	SceneSync  bool                  `json:"sceneSync"`
	ActiveArea bool                  `json:"activeArea"`
	Comparison *HDRComparisonOptions `json:"comparison,omitempty"`
}

HDRDecodedOptions selects primary-source checks and optional paired-source measurements. The zero value is invalid; at least one check must be selected.

func (HDRDecodedOptions) Normalize added in v0.4.1

func (o HDRDecodedOptions) Normalize() (HDRDecodedOptions, error)

Normalize validates the selection and returns an independent copy of its comparison options.

func (HDRDecodedOptions) Requested added in v0.4.1

func (o HDRDecodedOptions) Requested(mode HDRDecodedMode) bool

Requested reports whether mode is selected; unknown modes return false.

func (HDRDecodedOptions) RequiresV3 added in v0.4.1

func (o HDRDecodedOptions) RequiresV3() bool

RequiresV3 reports whether the request needs the track-aware bounded profile.

func (HDRDecodedOptions) Validate added in v0.4.1

func (o HDRDecodedOptions) Validate() error

Validate checks selection and mapping bounds without opening either source or resolving its handle.

type HDRDecodedResult added in v0.4.1

type HDRDecodedResult struct {
	Coverage    HDRCoverage           `json:"coverage,omitempty"`
	AudioTracks []HDRAudioTrackResult `json:"audioTracks,omitempty"`
	Checks      []HDRCheckResult      `json:"checks,omitempty"`
	Mode        HDRDecodedMode        `json:"mode"`
	State       HDRDecodedState       `json:"state"`
	Reason      string                `json:"reason,omitempty"`
	Profile     string                `json:"profile"`
	Selected    int                   `json:"selected"`
	Measured    int                   `json:"measured"`
	Artifacts   []PublicResourceID    `json:"artifacts"`
}

HDRDecodedResult describes one decoded analysis mode and its retained artifact IDs. Counts refer to selected work for that mode, such as picture samples or audio tracks. Coverage describes execution within that scope, including confirmed audio absence.

func (HDRDecodedResult) Validate added in v0.4.1

func (r HDRDecodedResult) Validate() error

type HDRDecodedRetry added in v0.4.1

type HDRDecodedRetry struct {
	AnalysisAttemptID string           `json:"analysisAttemptId"`
	Modes             []HDRDecodedMode `json:"modes"`
}

HDRDecodedRetry grants one explicit new measurement pass for eligible modes in the current retained attempt. It never grants a native source retry.

func (HDRDecodedRetry) Validate added in v0.4.1

func (r HDRDecodedRetry) Validate(options *HDRDecodedOptions) error

Validate requires a bounded attempt ID and distinct modes present in options. The workflow separately checks current-attempt ownership and retry eligibility.

type HDRDecodedSourceEvidence added in v0.4.1

type HDRDecodedSourceEvidence struct {
	DolbyVisionProfile string `json:"dolbyVisionProfile,omitempty"`
	VideoStreams       int    `json:"videoStreams"`
	// VideoStreamOrdinal selects the unique HEVC among non-attached video streams.
	VideoStreamOrdinal     int    `json:"videoStreamOrdinal,omitempty"`
	RawHEVC                bool   `json:"rawHEVC"`
	Codec                  string `json:"codec"`
	Width                  int    `json:"width"`
	Height                 int    `json:"height"`
	BitDepth               int    `json:"bitDepth"`
	PixelAspectNumerator   int    `json:"pixelAspectNumerator"`
	PixelAspectDenominator int    `json:"pixelAspectDenominator"`
	Range                  string `json:"range"`
	Matrix                 string `json:"matrix"`
	Transfer               string `json:"transfer"`
	Primaries              string `json:"primaries"`
	FrameRateNumerator     string `json:"frameRateNumerator,omitempty"`
	FrameRateDenominator   string `json:"frameRateDenominator,omitempty"`
}

HDRDecodedSourceEvidence is per-file probe evidence. Decoder output must independently confirm geometry with codec cropping and rotation disabled. Empty colour or rational fields mean unknown, never a default.

type HDRDecodedState added in v0.4.1

type HDRDecodedState string

HDRDecodedState describes measurement completion, not a pass/fail verdict on the media.

const (
	HDRDecodedComplete     HDRDecodedState = "complete"
	HDRDecodedFailed       HDRDecodedState = "failed"
	HDRDecodedCanceled     HDRDecodedState = "canceled"
	HDRDecodedInterrupted  HDRDecodedState = "interrupted"
	HDRDecodedUnsupported  HDRDecodedState = "unsupported"
	HDRDecodedInconclusive HDRDecodedState = "inconclusive"
	HDRDecodedNotRun       HDRDecodedState = "not_run"
)

type HDRDescriptionPlot added in v0.4.1

type HDRDescriptionPlot struct {
	GenerationComplete     bool
	AudioTrackID           string
	MeasurementFingerprint string
	RenderFingerprint      string
	ArtifactID             PublicResourceID
	Format                 HDRNativeFormat
	Kind                   HDRArtifactKind
	TargetID               string
	Label                  string
	Image                  ScreenshotImage
}

type HDRDescriptionStats added in v0.4.1

type HDRDescriptionStats struct {
	AudioTrackID           string
	MeasurementFingerprint string
	RenderFingerprint      string
	ArtifactID             PublicResourceID
	TargetID               string
	Label                  string
	Text                   string
}

HDRDescriptionStats carries one track's text owned by the exact HDR analysis.

type HDREvidenceOrigin added in v0.3.0

type HDREvidenceOrigin string

HDREvidenceOrigin identifies the strongest evidence used to derive HDR facts.

const (
	HDREvidenceUnknown         HDREvidenceOrigin = "unknown"
	HDREvidenceBDInfo          HDREvidenceOrigin = "bdinfo"
	HDREvidenceMediaInfo       HDREvidenceOrigin = "mediainfo"
	HDREvidenceTrackerAPI      HDREvidenceOrigin = "tracker_api"
	HDREvidenceTrackerDetails  HDREvidenceOrigin = "tracker_details"
	HDREvidenceTrackerTitle    HDREvidenceOrigin = "tracker_title"
	HDREvidenceContentFilename HDREvidenceOrigin = "content_filename"
	HDREvidenceReleaseName     HDREvidenceOrigin = "release_name"
)

type HDREvidenceStatus added in v0.3.0

type HDREvidenceStatus string

HDREvidenceStatus describes whether normalized HDR facts are authoritative enough for automatic comparison.

const (
	HDREvidenceComplete      HDREvidenceStatus = "complete"
	HDREvidencePartial       HDREvidenceStatus = "partial"
	HDREvidenceMissing       HDREvidenceStatus = "missing"
	HDREvidenceContradictory HDREvidenceStatus = "contradictory"
)

type HDRExtractionID added in v0.4.1

type HDRExtractionID string

type HDRExtractionState added in v0.4.1

type HDRExtractionState string

HDRExtractionState records one collector's outcome independently of its sibling format.

const (
	HDRExtractionComplete    HDRExtractionState = "complete"
	HDRExtractionAbsent      HDRExtractionState = "absent"
	HDRExtractionUnsupported HDRExtractionState = "unsupported"
	HDRExtractionFailed      HDRExtractionState = "failed"
	HDRExtractionCanceled    HDRExtractionState = "canceled"
	HDRExtractionInterrupted HDRExtractionState = "interrupted"
	HDRExtractionNotAnalyzed HDRExtractionState = "not_analyzed"
)

type HDRFacts added in v0.3.0

type HDRFacts struct {
	Formats            []HDRFormat       `json:"formats,omitempty"`
	DolbyVisionProfile string            `json:"dolbyVisionProfile,omitempty"`
	FallbackFormats    []HDRFormat       `json:"fallbackFormats,omitempty"`
	Origin             HDREvidenceOrigin `json:"origin"`
	Status             HDREvidenceStatus `json:"status"`
	SourceFields       []string          `json:"sourceFields,omitempty"`
	Contradictions     []string          `json:"contradictions,omitempty"`
}

HDRFacts preserves normalized HDR formats, compatibility, and provenance. Formats and fallback formats are ordered, duplicate-free values.

type HDRFormat added in v0.3.0

type HDRFormat string

HDRFormat is one normalized video dynamic-range or compatibility format.

const (
	HDRFormatSDR         HDRFormat = "sdr"
	HDRFormatDolbyVision HDRFormat = "dolby_vision"
	HDRFormatHDR10       HDRFormat = "hdr10"
	HDRFormatHDR10Plus   HDRFormat = "hdr10_plus"
	HDRFormatHLG         HDRFormat = "hlg"
	HDRFormatPQ10        HDRFormat = "pq10"
	HDRFormatHDRVivid    HDRFormat = "hdr_vivid"
	HDRFormatWCG         HDRFormat = "wide_color_gamut"
)

type HDRFormatResult added in v0.4.1

type HDRFormatResult struct {
	Format     HDRNativeFormat     `json:"format"`
	State      HDRExtractionState  `json:"state"`
	Coverage   HDRCoverage         `json:"coverage"`
	Requested  bool                `json:"requested"`
	Advertised bool                `json:"advertised"`
	TrackID    string              `json:"trackId,omitempty"`
	Frames     int                 `json:"frames"`
	Retained   int                 `json:"retained"`
	Observed   int                 `json:"observed"`
	Suppressed int                 `json:"suppressed"`
	Missing    int                 `json:"missing"`
	L1Samples  int                 `json:"l1Samples"`
	Scenes     int                 `json:"scenes"`
	Profile    string              `json:"profile,omitempty"`
	Checks     []HDRCheckResult    `json:"checks"`
	Failure    *HDRAnalysisFailure `json:"failure,omitempty"`
}

HDRFormatResult separates successful extraction from coverage and check findings. TrackID is a decimal string so browser consumers never round native identities.

func (HDRFormatResult) Validate added in v0.4.1

func (r HDRFormatResult) Validate() error

type HDRImageSelection added in v0.4.1

type HDRImageSelection struct {
	ArtifactIDs  []PublicResourceID `json:"artifactIds"`
	RecoveryNote string             `json:"recoveryNote,omitempty"`
}

HDRImageSelection distinguishes default inclusion (a nil selection) from an explicit empty selection. IDs always belong to the exact retained result.

type HDRNativeFormat added in v0.4.1

type HDRNativeFormat string

HDRNativeFormat labels metadata without conflating their measurements.

const (
	HDRNativeHDR10Plus   HDRNativeFormat = "hdr10plus"
	HDRNativeDolbyVision HDRNativeFormat = "dolby_vision"
)

type HDRPeakSource added in v0.4.1

type HDRPeakSource string

HDRPeakSource selects a metadata brightness estimator, independently of extraction.

const (
	HDRPeakHistogram       HDRPeakSource = "histogram"
	HDRPeakHistogram99     HDRPeakSource = "histogram99"
	HDRPeakMaxSCL          HDRPeakSource = "max-scl"
	HDRPeakMaxSCLLuminance HDRPeakSource = "max-scl-luminance"
)

func (HDRPeakSource) Normalize added in v0.4.1

func (p HDRPeakSource) Normalize() (HDRPeakSource, error)

Normalize defaults an omitted estimator to histogram and rejects unsupported values.

type HDRSourceEvidence added in v0.4.1

type HDRSourceEvidence struct {
	UniqueHEVC  bool                      `json:"uniqueHEVC"`
	HDR10Plus   bool                      `json:"hdr10plus"`
	DolbyVision bool                      `json:"dolbyVision"`
	Decoded     *HDRDecodedSourceEvidence `json:"decoded,omitempty"`
}

HDRSourceEvidence records advertised formats separately from native capability. UniqueHEVC is selection evidence, not a MediaInfo array index or native track ID.

type HDRTypedArtifact added in v0.4.1

type HDRTypedArtifact struct {
	AudioTrackID           string           `json:"audioTrackId,omitempty"`
	MeasurementFingerprint string           `json:"measurementFingerprint,omitempty"`
	RenderFingerprint      string           `json:"renderFingerprint,omitempty"`
	ID                     PublicResourceID `json:"id"`
	Kind                   HDRArtifactKind  `json:"kind"`
	Format                 HDRNativeFormat  `json:"format,omitempty"`
	Width                  int              `json:"width"`
	Height                 int              `json:"height"`
	MIME                   string           `json:"mime"`
	Profile                string           `json:"profile"`
}

HDRTypedArtifact identifies a retained image or structural JSON report without exposing its path. Only selectable image kinds may be included in tracker descriptions.

func (HDRTypedArtifact) Filename added in v0.4.1

func (a HDRTypedArtifact) Filename() string

Filename uses only backend-owned artifact kinds.

func (HDRTypedArtifact) Validate added in v0.4.1

func (a HDRTypedArtifact) Validate(formats []HDRFormatResult) error

Validate verifies media properties and the completed metadata authority behind an image. Reports have no format-specific image authority.

type HistoryCleanupSnapshot added in v0.3.0

type HistoryCleanupSnapshot struct {
	Metadata       *FileMetadata
	ArtifactPaths  []string
	WorkflowScopes []WorkflowScope
}

HistoryCleanupSnapshot contains persisted local paths and private workflow scopes needed by Core's cleanup policy. Its slices are caller-owned.

type HistoryEntry

type HistoryEntry struct {
	SourcePath         string
	ReleaseTitle       string
	ReleaseSource      string
	ReleaseResolution  string
	MetadataUpdatedAt  time.Time `ts_type:"string"`
	LatestUploadStatus string
	LatestUploadAt     time.Time `ts_type:"string"`
	RuleFailureCount   int
	// RuleAdvisoryCount contains non-blocking advisory rule results.
	RuleAdvisoryCount int
}

type HistoryOverview

type HistoryOverview struct {
	SourcePath           string
	ReleaseTitle         string
	ReleaseSource        string
	ReleaseResolution    string
	MetadataUpdatedAt    time.Time `ts_type:"string"`
	LatestUploadStatus   string
	LatestUploadAt       time.Time `ts_type:"string"`
	StatusLabel          string
	Metadata             FileMetadata
	Release              ReleaseRef
	Identity             ExternalIdentity
	Display              PreparedReleaseDisplay
	ReleaseNameOverrides ReleaseNameOverrides
	DescriptionOverride  DescriptionOverride
	DescriptionOverrides []DescriptionOverride
	PlaylistSelection    PlaylistSelection
	TrackerMetadata      []TrackerMetadata
	TrackerRuleFailures  []TrackerRuleFailure
	Screenshots          []Screenshot
	FinalSelections      []ScreenshotFinalSelection
	UploadedImages       []UploadedImageLink
	UploadHistory        []UploadRecord
}

HistoryOverview is the transport projection for one stored release.

type HistoryRecord added in v0.3.0

type HistoryRecord struct {
	Corrections          ReleaseCorrectionsSnapshot
	SourcePath           string
	ReleaseTitle         string
	ReleaseSource        string
	ReleaseResolution    string
	MetadataUpdatedAt    time.Time `ts_type:"string"`
	LatestUploadStatus   string
	LatestUploadAt       time.Time `ts_type:"string"`
	Metadata             FileMetadata
	PreparedRelease      *PreparedRelease
	ReleaseNameOverrides ReleaseNameOverrides
	DescriptionOverride  DescriptionOverride
	DescriptionOverrides []DescriptionOverride
	PlaylistSelection    PlaylistSelection
	TrackerMetadata      []TrackerMetadata
	TrackerRuleFailures  []TrackerRuleFailure
	Screenshots          []Screenshot
	FinalSelections      []ScreenshotFinalSelection
	UploadedImages       []UploadedImageLink
	UploadHistory        []UploadRecord
}

HistoryRecord is the persistence-facing history aggregate.

type HistoryRepository added in v0.3.0

type HistoryRepository interface {
	ListHistoryEntries(ctx context.Context) ([]HistoryEntry, error)
	LoadHistoryRecord(ctx context.Context, sourcePath string) (HistoryRecord, error)
	LoadHistoryCleanupSnapshot(ctx context.Context, sourcePath string) (HistoryCleanupSnapshot, error)
	// WithHistoryDeletion serializes guarded history cleanup with repository
	// deletion. The callback context carries the transaction-scoped repository.
	WithHistoryDeletion(context.Context, func(context.Context) error) error
	ListHistoryProtectedSourcePaths(ctx context.Context) ([]string, error)
	ListStoredHistoryArtifactPaths(ctx context.Context) ([]string, error)
	ListStoredReleasePaths(ctx context.Context) ([]string, error)
	PurgeContentData(ctx context.Context, path string) error
}

HistoryRepository owns persisted history projection, cleanup discovery, and atomic release-state purge. Filesystem deletion remains outside this seam.

type HostedImageAttempt added in v0.3.0

type HostedImageAttempt struct {
	ID          PublicResourceID    `json:"id"`
	Media       MediaArtifactSetRef `json:"media"`
	Host        string              `json:"host"`
	UsageScope  string              `json:"usageScope,omitempty"`
	TrackerIDs  []TrackerID         `json:"trackerIds,omitempty"`
	Fallback    bool                `json:"fallback"`
	Status      StageStatus         `json:"status"`
	ArtifactIDs []PublicResourceID  `json:"artifactIds"`
	Results     []MediaArtifact     `json:"results,omitempty"`
	Failures    []WorkflowFailure   `json:"failures,omitempty"`
	AttemptedAt time.Time           `json:"attemptedAt" ts_type:"string"`
}

HostedImageAttempt is the absolute outcome of one host attempt for exact media lineage.

type IMDBAKA

type IMDBAKA struct {
	Title      string
	Country    string
	Language   string
	Attributes []string
}

type IMDBEditionDetail

type IMDBEditionDetail struct {
	DisplayName string
	Seconds     int
	Minutes     int
	Attributes  []string
}

type IMDBEpisode

type IMDBEpisode struct {
	ID          string
	Title       string
	ReleaseYear int
	ReleaseDate IMDBReleaseDate
	Season      int
	// SeasonKnown retains provider presence; false cannot prove explicit season zero.
	SeasonKnown bool
	EpisodeText string
}

type IMDBMetadata

type IMDBMetadata struct {
	IMDBID           int
	IMDbIDText       string
	IMDbURL          string
	Title            string
	Year             int
	EndYear          int
	AKA              string
	Type             string
	Plot             string
	Rating           float64
	RatingCount      int
	RatingText       string
	RuntimeMinutes   int
	RuntimeText      string
	Genres           string
	Country          string
	CountryList      string
	Cover            string
	Directors        []IMDBPerson
	Creators         []IMDBPerson
	Writers          []IMDBPerson
	Stars            []IMDBPerson
	Editions         []string
	EditionDetails   map[string]IMDBEditionDetail
	Akas             []IMDBAKA
	Episodes         []IMDBEpisode
	SeasonsSummary   []IMDBSeasonSummary
	SoundMixes       []string
	TVYear           int
	OriginalLanguage string
}

type IMDBPerson

type IMDBPerson struct {
	ID   string
	Name string
}

type IMDBReleaseDate

type IMDBReleaseDate struct {
	Year  int
	Month int
	Day   int
}

type IMDBSeasonSummary

type IMDBSeasonSummary struct {
	Season    int
	Year      int
	YearRange string
}

type IdentityConflictStatus added in v0.3.0

type IdentityConflictStatus string

IdentityConflictStatus records whether accepted evidence contains an unverified inconsistency. Proven locked conflicts are fatal and unpublished.

const (
	// IdentityConflictNone means no inconsistency was found.
	IdentityConflictNone IdentityConflictStatus = "none"
	// IdentityConflictUnverified means evidence may conflict but cannot be proven inconsistent.
	IdentityConflictUnverified IdentityConflictStatus = "unverified"
)

type IdentityDependency added in v0.3.2

type IdentityDependency struct {
	ID       int
	TMDBID   int
	IMDBID   int
	TVDBID   int
	TVmazeID int
	MALID    int
}

IdentityDependency records provider IDs supplied to the lookup that produced ID. Zero ID means the derivation was not recorded; a positive ID with no provider inputs records an independently resolved fact. Inputs conservatively include every supplied provider ID, even when a lookup uses only one. They describe invalidation dependencies, not the winning provider.

type IdentityDependencySet added in v0.3.2

type IdentityDependencySet struct {
	TMDB   IdentityDependency
	IMDB   IdentityDependency
	TVDB   IdentityDependency
	TVmaze IdentityDependency
	MAL    IdentityDependency
}

IdentityDependencySet records derivation inputs for each canonical provider ID. Each entry applies only while its ID matches that provider's canonical ID.

type IdentityOverrideState added in v0.3.0

type IdentityOverrideState struct {
	TMDB     OverrideState
	IMDB     OverrideState
	TVDB     OverrideState
	TVmaze   OverrideState
	MAL      OverrideState
	Category OverrideState
}

IdentityOverrideState records tri-state override intent for every canonical provider and the category.

type IdentityProvenance added in v0.3.0

type IdentityProvenance string

IdentityProvenance identifies the origin of one canonical identity fact.

const (
	// IdentityProvenanceUnknown means no canonical fact has been resolved.
	IdentityProvenanceUnknown IdentityProvenance = "unknown"
	// IdentityProvenanceExplicit identifies a caller-locked fact.
	IdentityProvenanceExplicit IdentityProvenance = "explicit"
	// IdentityProvenancePersisted identifies reusable source-scoped state.
	IdentityProvenancePersisted IdentityProvenance = "persisted"
	// IdentityProvenanceMediaInfo identifies embedded MediaInfo evidence.
	IdentityProvenanceMediaInfo IdentityProvenance = "mediainfo"
	// IdentityProvenanceScene identifies scene/NFO evidence.
	IdentityProvenanceScene IdentityProvenance = "scene"
	// IdentityProvenanceArr identifies Sonarr or Radarr evidence.
	IdentityProvenanceArr IdentityProvenance = "arr"
	// IdentityProvenanceTracker identifies tracker evidence.
	IdentityProvenanceTracker IdentityProvenance = "tracker"
	// IdentityProvenanceProvider identifies provider-derived evidence.
	IdentityProvenanceProvider IdentityProvenance = "provider"
	// IdentityProvenanceLegacy identifies migrated pre-contract evidence.
	IdentityProvenanceLegacy IdentityProvenance = "legacy"
)

type IdentityProvenanceSet added in v0.3.0

type IdentityProvenanceSet struct {
	TMDB     IdentityProvenance
	IMDB     IdentityProvenance
	TVDB     IdentityProvenance
	TVmaze   IdentityProvenance
	MAL      IdentityProvenance
	Category IdentityProvenance
}

IdentityProvenanceSet records provenance for every canonical provider and category fact.

type IdentityProvider added in v0.3.0

type IdentityProvider string

IdentityProvider identifies one explicit external-ID provider.

const (
	// IdentityProviderTMDB identifies The Movie Database.
	IdentityProviderTMDB IdentityProvider = "tmdb"
	// IdentityProviderIMDB identifies IMDb.
	IdentityProviderIMDB IdentityProvider = "imdb"
	// IdentityProviderTVDB identifies TheTVDB.
	IdentityProviderTVDB IdentityProvider = "tvdb"
	// IdentityProviderTVmaze identifies TVmaze.
	IdentityProviderTVmaze IdentityProvider = "tvmaze"
	// IdentityProviderMAL identifies MyAnimeList/AniList-compatible identity.
	IdentityProviderMAL IdentityProvider = "mal"
)

type IdentityResolutionKey added in v0.3.0

type IdentityResolutionKey struct {
	SourceFingerprint string
	IntentFingerprint string
	ContractVersion   string
}

IdentityResolutionKey records non-secret fingerprints controlling canonical identity reuse.

type ImageHostFeedback

type ImageHostFeedback struct {
	Status       string
	SelectedHost string
	AllowedHosts []string
	Warnings     []ImageHostWarning
	Reuploaded   bool
	Message      string
}

type ImageHostOverrides

type ImageHostOverrides struct {
	PreferredHost *string
	SkipUpload    *bool
	// FailedHosts lists image hosts whose earlier attempt failed for this run.
	// Later stages must not reuse or retry them.
	FailedHosts []string
}

type ImageHostWarning

type ImageHostWarning struct {
	Host    string
	Message string
}

type ImageHostingDiscSubject added in v0.3.2

type ImageHostingDiscSubject struct {
	ID   string
	Name string
}

ImageHostingDiscSubject identifies one ordered disc without private paths.

type ImageHostingInput added in v0.3.0

type ImageHostingInput struct {
	Release       ReleaseRef
	Trackers      []string
	Host          string
	Scope         string
	ExcludedHosts []string
}

ImageHostingInput contains image-host choices for one exact prepared generation. Selected images are supplied separately to keep the subject contract independent from transport payloads.

type ImageHostingService

type ImageHostingService interface {
	ListCandidates(ctx context.Context, subject ImageHostingSubject) ([]ScreenshotImage, error)
	Upload(ctx context.Context, subject ImageHostingSubject, host string, usageScope string, images []ScreenshotImage) ([]UploadedImageLink, error)
}

type ImageHostingSubject added in v0.3.0

type ImageHostingSubject struct {
	// MediaBinding owns persisted uploads and slot variants for one exact prepared generation.
	MediaBinding PreparedMediaBinding
	SourcePath   string
	GalleryName  string
	// Discs defines stable display and upload ordering without exposing private roots.
	Discs []ImageHostingDiscSubject
}

ImageHostingSubject scopes image-host operations to one prepared source. GalleryName is the already-resolved display name used by batch hosts.

func NewImageHostingSubject added in v0.3.2

func NewImageHostingSubject(subject UploadSubject) ImageHostingSubject

NewImageHostingSubject projects upload state into the image-hosting operation's prepared-media identity and display model.

type ImageUploadProgressReporter added in v0.3.0

type ImageUploadProgressReporter func(update ImageUploadProgressUpdate)

ImageUploadProgressReporter receives advisory image-host progress snapshots.

type ImageUploadProgressStatus added in v0.3.0

type ImageUploadProgressStatus string

ImageUploadProgressStatus describes the latest advisory state of one host attempt.

const (
	// ImageUploadProgressRunning marks a host attempt that still has pending images.
	ImageUploadProgressRunning ImageUploadProgressStatus = "running"
	// ImageUploadProgressCompleted marks a host attempt whose images are all ready.
	ImageUploadProgressCompleted ImageUploadProgressStatus = "completed"
	// ImageUploadProgressFailed marks a host attempt with one or more failed images.
	ImageUploadProgressFailed ImageUploadProgressStatus = "failed"
)

type ImageUploadProgressTarget added in v0.3.0

type ImageUploadProgressTarget struct {
	// AttemptID is stable for the host/scope pair within one command.
	AttemptID string
	// Host is the normalized configured image-host name.
	Host string
	// UsageScope distinguishes global and tracker-owned upload records.
	UsageScope string
	// Trackers lists upload targets served by this host attempt.
	Trackers []string
	// Fallback reports whether this attempt follows an earlier host failure.
	Fallback bool
	// Total is the number of selected images required on this host.
	Total int
	// Reused is the subset already available from persisted host records.
	Reused int
}

ImageUploadProgressTarget identifies one host/scope attempt and its immutable presentation metadata. Total includes reused images as well as network uploads.

func ImageUploadProgressTargetFromContext added in v0.3.0

func ImageUploadProgressTargetFromContext(ctx context.Context) (ImageUploadProgressTarget, bool)

ImageUploadProgressTargetFromContext returns the current host attempt when present.

type ImageUploadProgressUpdate added in v0.3.0

type ImageUploadProgressUpdate struct {
	// CorrelationID binds the update to one frontend upload command.
	CorrelationID string `json:"correlationID"`
	// AttemptID identifies the host/scope row updated by this snapshot.
	AttemptID string `json:"attemptID"`
	// Host is the normalized configured image-host name.
	Host string `json:"host"`
	// UsageScope distinguishes global and tracker-owned upload records.
	UsageScope string `json:"usageScope"`
	// Trackers lists upload targets served by this host attempt.
	Trackers []string `json:"trackers"`
	// Fallback reports whether this attempt follows an earlier host failure.
	Fallback bool `json:"fallback"`
	// Completed counts succeeded, failed, and reused images in terminal states.
	Completed int `json:"completed"`
	// Total is the number of selected images required on this host.
	Total int `json:"total"`
	// Succeeded counts completed network uploads in this attempt.
	Succeeded int `json:"succeeded"`
	// Failed counts completed network uploads that did not produce a usable link.
	Failed int `json:"failed"`
	// Reused counts images satisfied by existing persisted host records.
	Reused int `json:"reused"`
	// Status is the latest advisory state for this host attempt.
	Status ImageUploadProgressStatus `json:"status"`
	// Message provides frontend-safe detail about the latest transition.
	Message string `json:"message"`
	// Timestamp is an RFC3339 timestamp injected by the WebUI boundary.
	Timestamp string `json:"timestamp"`
}

ImageUploadProgressUpdate is one frontend-safe absolute snapshot for a host attempt. CorrelationID and Timestamp are injected by the WebUI boundary.

type ImportedScreenshotEvidence added in v0.4.1

type ImportedScreenshotEvidence struct {
	Tracker                string
	TrackerID              string
	InfoHash               string
	SourceFingerprint      string
	PolicyVersion          string
	DescriptionFingerprint WorkflowFingerprint
	References             []ImportedScreenshotReference
}

ImportedScreenshotEvidence captures one selected source tracker's accepted references. The containing SourceScopedMetadata owns source and generation; the source and original-description fingerprints bind the collected receipt.

func (*ImportedScreenshotEvidence) Clone added in v0.4.1

Clone detaches the reference slice without creating authority for absent evidence.

type ImportedScreenshotReference added in v0.4.1

type ImportedScreenshotReference struct {
	RawURL string
}

ImportedScreenshotReference records a current policy-accepted image URL whose bounded byte inspection or local retention was unavailable. It does not establish a valid image, complete-body size, local artifact, format, dimensions, or preservation. Preview and page URLs cannot inherit the full URL's acceptance.

type InputHistory added in v0.3.2

type InputHistory struct {
	Release           ReleaseRef
	SourceFingerprint string
	Corrections       ReleaseCorrectionsSnapshot
	Tracks            []MediaTrackFacts
}

InputHistory contains the retained source evidence needed to address a track correction without repeating a media probe. Preparation revalidates it.

type InputReadinessEvaluation added in v0.3.2

type InputReadinessEvaluation struct {
	// TrackerQuestionnaires validate legacy explicit answer staging without
	// publishing tracker controls or adding canonical Input prerequisites.
	TrackerQuestionnaires   []TrackerQuestionnaire       `json:"-"`
	Schemas                 []TrackerQuestionnaire       `json:"schemas,omitempty"`
	RequirementsFingerprint WorkflowFingerprint          `json:"requirementsFingerprint"`
	Fields                  []InputReadinessFieldOutcome `json:"fields,omitempty"`
	RequiredActions         []RequiredAction             `json:"requiredActions,omitempty"`
}

InputReadinessEvaluation is the pure, local result returned by the tracker policy owner.

type InputReadinessFieldOutcome added in v0.3.2

type InputReadinessFieldOutcome struct {
	// TrackID identifies a canonical per-track correction, never a tracker answer.
	TrackID         string                    `json:"trackId,omitempty"`
	Key             string                    `json:"key"`
	CorrectionField *CorrectionField          `json:"correctionField,omitempty"`
	TrackerIDs      []TrackerID               `json:"trackerIds,omitempty"`
	Status          InputReadinessFieldStatus `json:"status"`
	Disposition     RuleDisposition           `json:"disposition"`
	Message         string                    `json:"message,omitempty"`
}

InputReadinessFieldOutcome is one safe local-input outcome. Key is a stable evaluator schema key, while CorrectionField identifies a fact correction when applicable.

type InputReadinessFieldStatus added in v0.3.2

type InputReadinessFieldStatus string

InputReadinessFieldStatus describes one evaluated Input field.

const (
	InputReadinessFieldReady   InputReadinessFieldStatus = "ready"
	InputReadinessFieldMissing InputReadinessFieldStatus = "missing"
	InputReadinessFieldInvalid InputReadinessFieldStatus = "invalid"
)

type InputReadinessSnapshot added in v0.3.2

type InputReadinessSnapshot struct {
	Schemas                 []TrackerQuestionnaire            `json:"schemas,omitempty"`
	ID                      InputReadinessSnapshotID          `json:"id"`
	WorkflowID              WorkflowID                        `json:"workflowId"`
	Revision                WorkflowRevision                  `json:"revision"`
	Release                 ReleaseRef                        `json:"release"`
	FactInstructions        ReleaseFactInstructionSnapshotRef `json:"factInstructions"`
	CorrectionRevision      uint64                            `json:"correctionRevision,omitempty"`
	SelectedTrackerIDs      []TrackerID                       `json:"selectedTrackerIds,omitempty"`
	RequirementsFingerprint WorkflowFingerprint               `json:"requirementsFingerprint"`
	Fields                  []InputReadinessFieldOutcome      `json:"fields,omitempty"`
	RequiredActions         []RequiredAction                  `json:"requiredActions,omitempty"`
	Status                  StageStatus                       `json:"status"`
	CreatedAt               time.Time                         `json:"createdAt" ts_type:"string"`
}

InputReadinessSnapshot records local readiness before tracker projection, authentication, duplicate checks, or other remote work.

func (InputReadinessSnapshot) Clone added in v0.3.2

Clone returns a detached readiness snapshot.

func (InputReadinessSnapshot) Validate added in v0.3.2

func (s InputReadinessSnapshot) Validate() error

Validate verifies snapshot identity and its exact local-input bindings.

type InputReadinessSnapshotID added in v0.3.2

type InputReadinessSnapshotID string

InputReadinessSnapshotID identifies one immutable local-input readiness projection.

type InputReadinessSnapshotRef added in v0.3.2

type InputReadinessSnapshotRef struct {
	ID       InputReadinessSnapshotID `json:"id"`
	Revision WorkflowRevision         `json:"revision"`
}

InputReadinessSnapshotRef references one exact input-readiness snapshot revision.

type InputRecord added in v0.3.5

type InputRecord struct {
	ID            string
	CanonicalPath string
	SourceVersion string
	Manifest      []byte
	UpdatedAt     time.Time
}

InputRecord belongs to a canonical local source, independently of its prepared generations. It is private repository data, not a transport response.

type InputWorkflowAssociation added in v0.4.1

type InputWorkflowAssociation struct {
	WorkflowID      WorkflowID
	AudioAnalysisID AudioAnalysisResultID
	HDRAnalysisID   HDRAnalysisResultID
}

InputWorkflowAssociation retains optional analysis IDs without positional coupling.

type InteractionMode

type InteractionMode string
const (
	InteractionModeInteractive       InteractionMode = "interactive"
	InteractionModeUnattended        InteractionMode = "unattended"
	InteractionModeUnattendedConfirm InteractionMode = "unattended_confirm"
)

type InvalidPlaylistSelectionError added in v0.3.0

type InvalidPlaylistSelectionError struct {
	// SourcePath identifies the requested local Blu-ray source.
	SourcePath string
	// Playlist identifies the rejected playlist when one was available.
	Playlist string
	// Reason explains the validation failure and is appended to Error's result.
	Reason string
}

InvalidPlaylistSelectionError reports a selected playlist that cannot be safely resolved from the current BDMV source.

func (*InvalidPlaylistSelectionError) Error added in v0.3.0

Error returns the stable invalid-selection message and any non-empty reason.

type InvalidateReleaseWorkflowTrackersRequest added in v0.3.0

type InvalidateReleaseWorkflowTrackersRequest struct {
	ReleaseWorkflowCommandContext
	TrackerIDs []TrackerID `json:"trackerIds"`
	Reason     string      `json:"reason"`
}

InvalidateReleaseWorkflowTrackersRequest invalidates selected tracker chains.

func (InvalidateReleaseWorkflowTrackersRequest) Validate added in v0.3.0

Validate verifies exact revision authority and a non-empty tracker set.

type LanguageFacts added in v0.4.1

type LanguageFacts struct {
	AudioAbsent            bool
	OriginalLanguages      []string
	OriginalLanguagesKnown bool
	ProgrammeLanguages     []string
	SubtitleLanguages      []string
	FullSubtitleLanguages  []string
	Tracks                 []MediaTrackFacts
	PrimaryAudioTrackID    string
	AudioStatus            MetadataEvidenceStatus
	ProgrammeStatus        MetadataEvidenceStatus
	SubtitleStatus         MetadataEvidenceStatus
	TrackCoverageComplete  bool
}

LanguageFacts retains finalized language and inspected-track evidence from one prepared generation. Presentation overrides cannot alter these facts.

func (LanguageFacts) Clone added in v0.4.1

func (f LanguageFacts) Clone() LanguageFacts

Clone detaches all retained language and track slices.

func (LanguageFacts) HasEnglishDub added in v0.4.1

func (f LanguageFacts) HasEnglishDub() bool

HasEnglishDub identifies classified or inferred English programme dubs, excluding English dialogue within an original multilingual stream and aggregate corrections.

func (LanguageFacts) HasOriginalAudio added in v0.4.1

func (f LanguageFacts) HasOriginalAudio() bool

HasOriginalAudio accepts original programme tracks, including verified multilingual content whose main-language tag differs from the title's recorded original language.

func (LanguageFacts) HasUnresolvedProgrammeAudioOrigin added in v0.4.1

func (f LanguageFacts) HasUnresolvedProgrammeAudioOrigin() bool

HasUnresolvedProgrammeAudioOrigin distinguishes missing soundtrack evidence from a proven absence of original audio. Commentary and other non-programme roles do not count.

func (LanguageFacts) ProgrammeAudioOrigin added in v0.4.1

func (f LanguageFacts) ProgrammeAudioOrigin(track MediaTrackFacts) TrackAudioOrigin

ProgrammeAudioOrigin preserves explicit source evidence. Matching-language tracks are original; a separate English programme track is a dub when the same resource contains established non-English original audio.

type LiveTestEffectCounts added in v0.3.2

type LiveTestEffectCounts struct {
	RequestsDenied       uint64 `json:"requestsDenied"`
	MutationCallsDenied  uint64 `json:"mutationCallsDenied"`
	RemoteCallsStarted   uint64 `json:"remoteCallsStarted"`
	RemoteCallsSucceeded uint64 `json:"remoteCallsSucceeded"`
}

LiveTestEffectCounts distinguishes rejected requests from guarded writes for one forbidden effect class. Allowed lookup and image-host requests are excluded.

type LiveTestPolicy added in v0.3.2

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

LiveTestPolicy is an immutable dependency shared by every runtime generation. Its private identity and journal path cannot be changed by workflow requests or configuration activation. A nil policy preserves ordinary execution.

func NewLiveTestPolicy added in v0.3.2

func NewLiveTestPolicy(runID, journalPath string, maxImages int) (*LiveTestPolicy, error)

NewLiveTestPolicy binds already-validated profile identity and private journal. The application entrypoint must validate the profile before constructing it.

func (*LiveTestPolicy) ImageJournalPath added in v0.3.2

func (p *LiveTestPolicy) ImageJournalPath() string

ImageJournalPath returns private dependency configuration, never a UI field.

func (*LiveTestPolicy) ImageUploadLimit added in v0.3.2

func (p *LiveTestPolicy) ImageUploadLimit() int

ImageUploadLimit is the maximum image count permitted across this run's attempts.

func (*LiveTestPolicy) RejectMutation added in v0.3.2

func (p *LiveTestPolicy) RejectMutation(operation OperationKind) error

RejectMutation guards the actual mutation boundary without relying on context. Live-test dependencies never delegate forbidden writes, so their remote-call counts remain zero. Tests additionally assert the underlying fake is untouched.

func (*LiveTestPolicy) RejectRequest added in v0.3.2

func (p *LiveTestPolicy) RejectRequest(operation OperationKind) error

RejectRequest records a prohibited request before any mutation is dispatched.

func (*LiveTestPolicy) RunID added in v0.3.2

func (p *LiveTestPolicy) RunID() string

RunID returns the opaque process-bound run identity.

func (*LiveTestPolicy) Snapshot added in v0.3.2

func (p *LiveTestPolicy) Snapshot() *TestRuntimeInfo

Snapshot returns a path-free receipt; nil means ordinary execution.

type Logger

type Logger interface {
	Tracef(format string, args ...any)
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
}

type ManualLanguageFacts added in v0.3.2

type ManualLanguageFacts struct {
	Audio              []string
	Subtitles          []string
	HardcodedSubtitles []string
}

ManualLanguageFacts contains the resolved manual lists used in generated descriptions.

type MediaArtifact added in v0.3.0

type MediaArtifact struct {
	ID PublicResourceID `json:"id"`
	// DiscID identifies the prepared disc that produced this artifact.
	DiscID string `json:"discId,omitempty"`
	// DiscName is the safe page-facing label derived from prepared facts.
	DiscName         string            `json:"discName,omitempty"`
	Kind             MediaArtifactKind `json:"kind"`
	Purpose          ScreenshotPurpose `json:"purpose"`
	Selected         bool              `json:"selected"`
	Order            int               `json:"order,omitempty"`
	Index            int               `json:"index,omitempty"`
	TimestampSeconds float64           `json:"timestampSeconds,omitempty"`
	Source           string            `json:"source,omitempty"`
	Width            int               `json:"width,omitempty"`
	Height           int               `json:"height,omitempty"`
	SizeBytes        int64             `json:"sizeBytes,omitempty"`
	Host             string            `json:"host,omitempty"`
	URL              string            `json:"url,omitempty"`
}

MediaArtifact is a safe opaque projection of one retained private artifact.

type MediaArtifactKind added in v0.3.0

type MediaArtifactKind string

MediaArtifactKind classifies one safe retained media artifact.

const (
	// MediaArtifactScreenshot identifies a captured screenshot.
	MediaArtifactScreenshot MediaArtifactKind = "screenshot"
	// MediaArtifactDVDMenu identifies an automatically or manually captured DVD menu.
	MediaArtifactDVDMenu MediaArtifactKind = "dvd_menu"
	// MediaArtifactHostedImage identifies a hosted image result.
	MediaArtifactHostedImage MediaArtifactKind = "hosted_image"
)

type MediaArtifactSet added in v0.3.0

type MediaArtifactSet struct {
	// AutomaticScreenshotSelection records known automatic screenshot intent.
	// False includes legacy/unknown and explicit selections; imported references must not expand those selections.
	AutomaticScreenshotSelection bool                           `json:"automaticScreenshotSelection,omitempty"`
	ID                           MediaArtifactSetID             `json:"id"`
	WorkflowID                   WorkflowID                     `json:"workflowId"`
	Revision                     WorkflowRevision               `json:"revision"`
	Release                      ReleaseSnapshotRef             `json:"release"`
	ReleaseRef                   ReleaseRef                     `json:"releaseRef"`
	ProjectionSet                TrackerReleaseProjectionSetRef `json:"projectionSet"`
	TrackerApproval              *TrackerApprovalSnapshotRef    `json:"trackerApproval,omitempty"`
	CaptureFingerprint           WorkflowFingerprint            `json:"captureFingerprint"`
	// SavedImagePlanID retains the reviewed import plan across workflow continuation.
	SavedImagePlanID        MediaPlanID          `json:"savedImagePlanId,omitempty"`
	RequirementsFingerprint WorkflowFingerprint  `json:"requirementsFingerprint"`
	Artifacts               []MediaArtifact      `json:"artifacts"`
	HostAttempts            []HostedImageAttempt `json:"hostAttempts,omitempty"`
	FailedHosts             []string             `json:"failedHosts,omitempty"`
	// ImageRequirementsPrepared records that required image preparation is satisfied
	// through hosting or explicit skip. Status still determines overall media readiness.
	ImageRequirementsPrepared bool `json:"imageRequirementsPrepared"`
	// ImageHostUploadSkipped records preparation without new host uploads. Cached
	// links remain reusable, and unknown external outcomes still require reconciliation.
	ImageHostUploadSkipped bool              `json:"imageHostUploadSkipped,omitempty"`
	Status                 StageStatus       `json:"status"`
	RequiredActions        []RequiredAction  `json:"requiredActions,omitempty"`
	Failures               []WorkflowFailure `json:"failures,omitempty"`
	CreatedAt              time.Time         `json:"createdAt" ts_type:"string"`
}

MediaArtifactSet retains generation- and projection-bound media results.

func (MediaArtifactSet) Clone added in v0.3.0

Clone returns a detached media-artifact set.

func (MediaArtifactSet) Validate added in v0.3.0

func (s MediaArtifactSet) Validate() error

Validate verifies exact release/projection lineage and opaque artifact identity.

type MediaArtifactSetID added in v0.3.0

type MediaArtifactSetID string

MediaArtifactSetID identifies one immutable media-artifact set.

type MediaArtifactSetRef added in v0.3.0

type MediaArtifactSetRef struct {
	ID       MediaArtifactSetID `json:"id"`
	Revision WorkflowRevision   `json:"revision"`
}

MediaArtifactSetRef references one exact media-artifact revision.

type MediaAssetRepository added in v0.3.0

type MediaAssetRepository interface {
	// CloneAudioAnalysisUploads copies hosted links for integrity-verified audio clones within one source; callers verify compatibility and pass exact artifact paths.
	CloneAudioAnalysisUploads(ctx context.Context, prior ReleaseRef, binding PreparedMediaBinding, paths map[string]string) error
	// CloneHDRAnalysisUploads copies only HDR hosted provenance to integrity-verified PNG clones.
	CloneHDRAnalysisUploads(ctx context.Context, prior ReleaseRef, binding PreparedMediaBinding, paths map[string]string) error
	ScreenshotLifecycleRepository
	LoadMediaAssetSnapshot(ctx context.Context, binding PreparedMediaBinding) (MediaAssetSnapshot, error)
	SaveScreenshot(ctx context.Context, binding PreparedMediaBinding, screenshot Screenshot) error
	ListScreenshotsByPath(ctx context.Context, binding PreparedMediaBinding) ([]Screenshot, error)
	DeleteScreenshot(ctx context.Context, binding PreparedMediaBinding, imagePath string) error
	SaveFinalSelections(ctx context.Context, binding PreparedMediaBinding, selections []ScreenshotFinalSelection) error
	ListFinalSelections(ctx context.Context, binding PreparedMediaBinding) ([]ScreenshotFinalSelection, error)
	DeleteFinalSelection(ctx context.Context, binding PreparedMediaBinding, imagePath string) error
	ReplaceScreenshotSlots(ctx context.Context, binding PreparedMediaBinding, slots []ScreenshotSlot) error
	ListScreenshotSlotsByPath(ctx context.Context, binding PreparedMediaBinding) ([]ScreenshotSlot, error)
	UpsertScreenshotSlotVariants(ctx context.Context, binding PreparedMediaBinding, variants []ScreenshotSlotVariant) error
	SaveUploadedImages(ctx context.Context, binding PreparedMediaBinding, host string, images []UploadedImageLink) error
	ListUploadedImagesByPath(ctx context.Context, binding PreparedMediaBinding) ([]UploadedImageLink, error)
	DeleteUploadedImage(ctx context.Context, binding PreparedMediaBinding, imagePath string, host string) error
}

MediaAssetRepository persists screenshot, selection, slot, variant, and uploaded-image records. Screenshot lifecycle mutations are atomic.

type MediaAssetSnapshot added in v0.3.0

type MediaAssetSnapshot struct {
	Screenshots     []Screenshot
	FinalSelections []ScreenshotFinalSelection
	ScreenshotSlots []ScreenshotSlot
	UploadedImages  []UploadedImageLink
}

MediaAssetSnapshot is a coherent caller-owned view of persisted media records for one release. Returned slices and nested variant slices may be mutated by callers without changing repository state.

type MediaAttachment added in v0.3.0

type MediaAttachment struct {
	Resource WorkflowResourceRef `json:"resource"`
	Kind     MediaArtifactKind   `json:"kind"`
	Purpose  ScreenshotPurpose   `json:"purpose"`
	// DiscID is required for a multi-disc attachment and optional for single-disc compatibility.
	DiscID string `json:"discId,omitempty"`
	Order  int    `json:"order,omitempty"`
}

MediaAttachment describes staged private bytes to attach to retained workflow media.

type MediaCaptureInstructions added in v0.3.0

type MediaCaptureInstructions struct {
	ScreenshotCount int                   `json:"screenshotCount"`
	Purpose         ScreenshotPurpose     `json:"purpose"`
	Selections      []ScreenshotSelection `json:"selections,omitempty"`
	// SavedImagePlanID binds an explicit saved-image import to its reviewed plan.
	SavedImagePlanID MediaPlanID `json:"savedImagePlanId,omitempty"`
	// ManualFrames applies the same raw frame numbers to every prepared disc.
	ManualFrames    []int `json:"manualFrames,omitempty"`
	CaptureDVDMenus bool  `json:"captureDvdMenus"`
	// MaxDVDMenuItems caps an explicitly requested automatic menu capture.
	MaxDVDMenuItems int `json:"maxDvdMenuItems,omitempty"`
}

MediaCaptureInstructions are transport-safe capture choices. Local paths and image bytes remain private workflow resources.

type MediaCaptureRequirement added in v0.3.0

type MediaCaptureRequirement struct {
	TrackerID       TrackerID         `json:"trackerId"`
	ScreenshotCount int               `json:"screenshotCount"`
	DVDMenuCount    int               `json:"dvdMenuCount"`
	Purpose         ScreenshotPurpose `json:"purpose"`
}

MediaCaptureRequirement is one tracker-derived final-media requirement.

type MediaCompatibilityKey added in v0.3.5

type MediaCompatibilityKey string

MediaCompatibilityKey identifies source facts that can safely reuse media across prepared generations. It is separate from PreparedMediaBinding, which remains the authority for an exact generation.

func (MediaCompatibilityKey) Valid added in v0.3.5

func (k MediaCompatibilityKey) Valid() bool

Valid reports whether the key is a complete strong compatibility claim.

type MediaDiscPlan added in v0.3.2

type MediaDiscPlan struct {
	DiscID              string                `json:"discId"`
	DiscName            string                `json:"discName"`
	DurationSeconds     float64               `json:"durationSeconds"`
	FrameRate           float64               `json:"frameRate"`
	SuggestedSelections []ScreenshotSelection `json:"suggestedSelections,omitempty"`
}

MediaDiscPlan is one safe page-facing disc capture plan.

type MediaFacts added in v0.3.0

type MediaFacts struct {
	MediaFileFacts                       MediaFileFacts
	AudioAbsent                          bool
	LanguageFacts                        LanguageFacts
	AudioLanguages                       []string
	SubtitleLanguages                    []string
	TrackAudioLanguages                  []string
	TrackSubtitleLanguages               []string
	Tracks                               []MediaTrackFacts
	PrimaryAudioTrackID                  string
	TrackCoverageComplete                bool
	AudioLanguagesProvenance             FactProvenance
	SubtitleLanguagesProvenance          FactProvenance
	HardcodedSubs                        bool
	HardcodedSubtitleLanguages           []string
	HardcodedSubtitleCoverage            []SubtitleLanguageCoverage `json:"HardcodedSubtitleCoverage,omitempty"`
	HardcodedSubsProvenance              FactProvenance
	HardcodedSubtitleLanguagesProvenance FactProvenance
	OriginalLanguage                     string
	OriginalLanguageProvenance           FactProvenance
	DistributorProvenance                FactProvenance
	Container                            string
	Audio                                string
	Channels                             string
	Commentary                           bool
	ThreeD                               string
	Source                               string
	Type                                 string
	UHD                                  string
	HDR                                  string
	HDRFacts                             HDRFacts
	Distributor                          string
	Region                               string
	VideoCodec                           string
	VideoEncoder                         string
	VideoEncode                          string
	HasEncodeSettings                    bool
	BitDepth                             string
	// ReleaseFeatures are source-backed annotations, separate from naming components.
	ReleaseFeatures []ReleaseFeature `json:",omitempty"`
	// EditionDisplay preserves previously rendered automatic annotation wording for display only.
	// Never use it for edition identity, validation mappings, or duplicate comparison.
	EditionDisplay []EditionDisplayPart
	// Cut, Edition, and Presentation are independently addressable naming facts.
	EditionSet        string
	Cut               string
	Presentation      string
	Edition           string
	Repack            string
	WebDV             bool
	StreamOptimized   int
	Service           string
	ServiceLongName   string
	MediaInfoUniqueID string
	Anime             bool
	AnimeKnown        bool
}

MediaFacts contains finalized reusable media characteristics.

func (MediaFacts) ManualLanguages added in v0.3.2

func (m MediaFacts) ManualLanguages() ManualLanguageFacts

ManualLanguages projects aggregate intent or corrected tracks in manifest order.

type MediaFileFact added in v0.3.0

type MediaFileFact struct {
	RateControl         VideoRateControl
	ResourceID          string
	HasEncodeSettings   bool
	EncodeSettingsKnown bool
	VideoEncoder        string
	HDRFacts            HDRFacts
	// Complete with an empty language list records inspected track absence;
	// partial or unavailable must never be interpreted as absence.
	AudioStatus       MetadataEvidenceStatus
	SubtitleStatus    MetadataEvidenceStatus
	FileName          string
	Primary           bool
	Container         string
	Source            string
	Resolution        string
	VideoCodec        string
	VideoEncode       string
	BitDepth          string
	VideoTrackCount   int
	AudioLanguages    []string
	SubtitleLanguages []string
}

MediaFileFact contains normalized technical and language facts for one media file. Empty values and zero track counts mean unknown.

type MediaFileFacts added in v0.3.0

type MediaFileFacts struct {
	Status            MetadataEvidenceStatus
	TechnicalStatus   MetadataEvidenceStatus
	LanguageStatus    MetadataEvidenceStatus
	ExpectedFileCount int
	OriginalLanguage  string
	Files             []MediaFileFact
}

MediaFileFacts contains all media facts available to shared validation. TechnicalStatus and LanguageStatus describe their respective projections.

func (MediaFileFacts) Clone added in v0.4.1

func (f MediaFileFacts) Clone() MediaFileFacts

Clone detaches per-file language lists from their prepared generation.

type MediaPlan added in v0.3.0

type MediaPlan struct {
	ID                  MediaPlanID                    `json:"id"`
	WorkflowID          WorkflowID                     `json:"workflowId"`
	Revision            WorkflowRevision               `json:"revision"`
	Release             ReleaseSnapshotRef             `json:"release"`
	ProjectionSet       TrackerReleaseProjectionSetRef `json:"projectionSet"`
	DurationSeconds     float64                        `json:"durationSeconds"`
	FrameRate           float64                        `json:"frameRate"`
	DiscType            string                         `json:"discType,omitempty"`
	SuggestedSelections []ScreenshotSelection          `json:"suggestedSelections,omitempty"`
	// Discs contains ordered per-disc timing and suggestions.
	Discs        []MediaDiscPlan           `json:"discs,omitempty"`
	Requirements []MediaCaptureRequirement `json:"requirements,omitempty"`
	// SavedTrackerImages lists validated tracker image URLs offered for explicit import.
	SavedTrackerImages []MediaPlanSavedImage `json:"savedTrackerImages,omitempty"`
	ExistingArtifacts  []MediaArtifact       `json:"existingArtifacts,omitempty"`
	CreatedAt          time.Time             `json:"createdAt" ts_type:"string"`
}

MediaPlan is the safe page-facing plan for one exact workflow revision.

type MediaPlanID added in v0.3.0

type MediaPlanID string

MediaPlanID identifies one immutable workflow media plan.

func MediaPlanContentID added in v0.4.0

func MediaPlanContentID(
	release ReleaseRef,
	projections TrackerReleaseProjectionSet,
	selections []ScreenshotSelection,
	images []MediaPlanSavedImage,
) (MediaPlanID, error)

MediaPlanContentID binds a screenshot plan to its release, projection revision, suggested selections, and saved image URLs. A changed input yields a new ID so an earlier saved-image import cannot be applied to a different plan.

type MediaPlanInput added in v0.3.0

type MediaPlanInput struct {
	Release ReleaseRef
	Count   int
	Purpose ScreenshotPurpose
	Options ScreenshotOverrides
}

MediaPlanInput contains media planning choices for one exact prepared generation.

type MediaPlanRef added in v0.3.0

type MediaPlanRef struct {
	ID       MediaPlanID      `json:"id"`
	Revision WorkflowRevision `json:"revision"`
}

MediaPlanRef references one exact immutable media plan.

type MediaPlanSavedImage added in v0.4.0

type MediaPlanSavedImage struct {
	TrackerID  TrackerID `json:"trackerId"`
	Host       string    `json:"host"`
	URL        string    `json:"url"`
	PreviewURL string    `json:"previewUrl,omitempty"`
}

MediaPlanSavedImage is a validated saved image available for media capture. The local artifact path remains private until the workflow retains it.

type MediaReuseRepository added in v0.3.5

type MediaReuseRepository interface {
	CommitReusableMedia(context.Context, PreparedMediaBinding, MediaCompatibilityKey, []ReusableMediaAsset, ReusableMediaCommit) error
	HasReusableMediaCommit(context.Context, ReusableMediaCommit) (bool, error)
	LoadReusableMediaAssets(context.Context, MediaCompatibilityKey) ([]ReusableMediaAsset, error)
	DeleteReusableMediaAssets(context.Context, PreparedMediaBinding, []string) error
}

MediaReuseRepository atomically records strong reusable-media evidence and its exact final workflow snapshot. It never grants access to prior workflow resources or approvals.

type MediaTrackFacts added in v0.3.2

type MediaTrackFacts struct {
	ID         string
	Kind       MediaTrackKind
	ResourceID string
	// DiscID and PlaylistID scope streams inspected from a BDInfo playlist report.
	DiscID              string
	PlaylistID          string
	ManifestFingerprint string
	NativeID            string
	Ordinal             int
	// StreamOrder is the measured container order, not the per-kind Ordinal or NativeID.
	// StreamOrderKnown is false when MediaInfo has no unambiguous nonnegative order.
	StreamOrder        int
	StreamOrderKnown   bool
	Title              string
	Codec              string
	AudioLabel         string
	ChannelLayout      string
	Channels           int
	SampleRate         int
	DetectedLanguages  []string
	Languages          []string
	LanguageProvenance FactProvenance
	// AudioOrigin is independent of language identification and describes the soundtrack.
	AudioOrigin           TrackAudioOrigin `json:",omitempty"`
	AudioOriginProvenance FactProvenance   `json:",omitempty"`
	Default               bool
	DefaultKnown          bool // True only for an explicit inspected MediaInfo Yes/No value.
	Forced                bool
	Role                  AudioTrackRole
	EmbeddedCompatibility bool
	Commentary            bool
	// BitrateBitsPerSecond retains whole-bit BDInfo bitrate; zero means unavailable or invalid.
	BitrateBitsPerSecond int64
	// Hidden records BDInfo's hidden-stream marker, not a commentary classification.
	Hidden bool
	// BitDepth is the inspected audio sample depth; zero means unavailable or invalid.
	BitDepth int `json:",omitempty"`
	// ChannelsKnown distinguishes an exact positive count from a partial channel value.
	ChannelsKnown bool `json:",omitempty"`
}

MediaTrackFacts describes only an inspected stream. An opaque resource ID and exact manifest bind ordinal identities when native IDs are unavailable.

type MediaTrackKind added in v0.3.2

type MediaTrackKind string

MediaTrackKind distinguishes physical audio and subtitle streams.

const (
	MediaTrackAudio    MediaTrackKind = "audio"
	MediaTrackSubtitle MediaTrackKind = "subtitle"
)

type MetadataEvidence added in v0.4.0

type MetadataEvidence struct {
	SourcePath        string
	SourceFingerprint string
	Domain            string
	Key               string
	Outcome           MetadataEvidenceOutcome
	Payload           json.RawMessage
}

MetadataEvidence retains one typed lookup result, independently of prepared generations and user corrections. Key is a caller-generated hash of the query's dependencies; raw query inputs, credentials, and errors are not stored. Success and empty outcomes carry valid JSON, including null or empty results, capped at 16 MiB. Failed outcomes may retain valid typed partial JSON under the same bound, or omit the payload when no usable facts were returned. Cancellation is not authoritative and must never produce a record.

type MetadataEvidenceOutcome added in v0.4.0

type MetadataEvidenceOutcome string

MetadataEvidenceOutcome distinguishes reusable results from unsuccessful queries. Empty means the query completed successfully without a match.

const (
	MetadataEvidenceSuccess MetadataEvidenceOutcome = "success"
	MetadataEvidenceEmpty   MetadataEvidenceOutcome = "empty"
	MetadataEvidenceFailed  MetadataEvidenceOutcome = "failed"
)

type MetadataEvidenceRepository added in v0.4.0

type MetadataEvidenceRepository interface {
	LoadMetadataEvidence(context.Context, string, string, string, string) (MetadataEvidence, error)
	SaveMetadataEvidence(context.Context, MetadataEvidence) error
}

MetadataEvidenceRepository retains source-scoped lookup evidence across preparations. Callers own canonical source paths, dependency keys, and outcome classification; removing a source from History also removes its evidence.

type MetadataEvidenceStatus added in v0.3.0

type MetadataEvidenceStatus string

MetadataEvidenceStatus describes whether provider evidence can support both positive and negative metadata decisions.

const (
	// MetadataEvidenceStatusComplete means the provider contract exposed all relevant evidence.
	MetadataEvidenceStatusComplete MetadataEvidenceStatus = "complete"
	// MetadataEvidenceStatusPartial means positive evidence is usable but negative evidence is incomplete.
	MetadataEvidenceStatusPartial MetadataEvidenceStatus = "partial"
	// MetadataEvidenceStatusUnavailable means the evidence lookup could not be performed.
	MetadataEvidenceStatusUnavailable MetadataEvidenceStatus = "unavailable"
	// MetadataEvidenceStatusContradictory means provider evidence disagreed about the same subject.
	MetadataEvidenceStatusContradictory MetadataEvidenceStatus = "contradictory"
)

type MetadataOverrides

type MetadataOverrides struct {
	Distributor                *string
	OriginalLanguage           *string
	PersonalRelease            *bool
	Commentary                 *bool
	WebDV                      *bool
	StreamOptimized            *bool
	Anime                      *bool
	Title                      *string
	AlternateTitle             *string
	OriginalTitle              *string
	Genres                     *[]string
	AudioLanguages             *[]string
	SubtitleLanguages          *[]string
	HardcodedSubs              *bool
	HardcodedSubtitleLanguages *[]string
	TrackLanguages             []TrackLanguageCorrection    `json:"TrackLanguages,omitempty"`
	TrackAudioOrigins          []TrackAudioOriginCorrection `json:"TrackAudioOrigins,omitempty"`
}

type MetadataPreview

type MetadataPreview struct {
	SourcePath           string
	TrackerName          string
	ReleaseName          string
	ReleaseNameOverrides ReleaseNameOverrides
	Release              ReleaseRef
	Identity             ExternalIdentity
	Display              PreparedReleaseDisplay
	Bluray               *BlurayMetadata
	Diagnostics          []PreparationDiagnostic
	TrackerData          []TrackerPreview
	// TrackerRuleFailures is keyed by normalized tracker code and contains
	// upload rule failures known at preview time.
	TrackerRuleFailures map[string][]RuleFailure
}

type MetadataRequirement added in v0.3.2

type MetadataRequirement struct {
	Scope       MetadataRequirementScope   `json:"scope"`
	AnyOf       []MetadataRequirementField `json:"anyOf"`
	Disposition RuleDisposition            `json:"disposition"`
}

MetadataRequirement describes one AnyOf group consumed during canonical preparation.

type MetadataRequirementField added in v0.3.2

type MetadataRequirementField string

MetadataRequirementField identifies one tracker-declared metadata fact.

type MetadataRequirementScope added in v0.3.2

type MetadataRequirementScope string

MetadataRequirementScope limits a metadata requirement to a canonical category.

const (
	MetadataRequirementScopeAny   MetadataRequirementScope = "any"
	MetadataRequirementScopeMovie MetadataRequirementScope = "movie"
	MetadataRequirementScopeTV    MetadataRequirementScope = "tv"
)

type MetadataRequirementSet added in v0.3.2

type MetadataRequirementSet struct {
	InspectProgrammeTracks bool                  `json:"inspectProgrammeTracks,omitempty"`
	Version                string                `json:"version"`
	Requirements           []MetadataRequirement `json:"requirements,omitempty"`
}

MetadataRequirementSet is the tracker-ID-free normalized union of selected tracker demands.

func (MetadataRequirementSet) Normalize added in v0.3.2

Normalize returns a deterministic demand set suitable for compatibility fingerprints.

type MissingRequirementError added in v0.3.0

type MissingRequirementError struct {
	Requirement RequirementKind
	Provider    IdentityProvider
}

MissingRequirementError reports one absent canonical prerequisite.

func (*MissingRequirementError) Error added in v0.3.0

func (e *MissingRequirementError) Error() string

type NamingAssessment added in v0.3.0

type NamingAssessment struct {
	Status  NamingStatus
	Missing []NamingRequirement
}

NamingAssessment records concrete naming completeness and typed missing fact labels without turning tracker policy into prepared truth.

type NamingFacts added in v0.3.0

type NamingFacts struct {
	Filename         string
	ReleaseName      string
	NameWithoutTag   string
	CleanName        string
	NamePresentation ReleaseNamePresentation
	// GeneratedName preserves the canonical semantic layout for automatic naming.
	GeneratedName *ReleaseNameDocument
	// GeneratedReleaseNames contains safe canonical structural alternatives.
	// Empty variants mean ReleaseName must remain exact.
	GeneratedReleaseNames    GeneratedReleaseNameVariants
	Tag                      string
	Type                     string
	Artist                   string
	Title                    string
	Subtitle                 string
	AlternateTitle           string
	OriginalTitle            string
	Genres                   []string
	TitleProvenance          FactProvenance
	AlternateTitleProvenance FactProvenance
	OriginalTitleProvenance  FactProvenance
	GenresProvenance         FactProvenance
	YearProvenance           FactProvenance
	Year                     int
	Month                    int
	Day                      int
	Version                  string
	Source                   string
	Resolution               string
	Codecs                   []string
	Audio                    []string
	HDR                      []string
	Extension                string
	Languages                []string
	Site                     string
	Genre                    string
	Channels                 string
	Collection               string
	Region                   string
	Size                     string
	Group                    string
	Disc                     string
	// EditionSet is the finalized multi-edition naming label; category facts remain separate.
	EditionSet    string
	Cuts          []string
	Presentations []string
	Editions      []string
	Other         []string
	Scene         bool
	SceneName     string
	Personal      bool
}

NamingFacts contains finalized reusable naming facts rather than raw parser output or workflow-specific name overrides. AlternateTitle is resolved before presentation omissions are applied.

type NamingRequirement added in v0.3.0

type NamingRequirement string

NamingRequirement identifies one missing finalized naming fact.

type NamingStatus added in v0.3.0

type NamingStatus string

NamingStatus records whether finalized naming facts are complete.

const (
	// NamingStatusUnknown means preparation has not assessed naming completeness.
	NamingStatusUnknown NamingStatus = "unknown"
	// NamingStatusComplete means all required naming facts are present.
	NamingStatusComplete NamingStatus = "complete"
	// NamingStatusIncomplete means one or more required naming facts are missing.
	NamingStatusIncomplete NamingStatus = "incomplete"
)

type NopLogger

type NopLogger struct{}

func (NopLogger) Debugf

func (NopLogger) Debugf(string, ...any)

func (NopLogger) Errorf

func (NopLogger) Errorf(string, ...any)

func (NopLogger) Infof

func (NopLogger) Infof(string, ...any)

func (NopLogger) Tracef

func (NopLogger) Tracef(string, ...any)

func (NopLogger) Warnf

func (NopLogger) Warnf(string, ...any)

type OpenActiveInputRequest added in v0.3.5

type OpenActiveInputRequest struct {
	ExpectedRevision uint64                         `json:"expectedRevision"`
	Request          ContinueReleaseWorkflowRequest `json:"request"`
}

OpenActiveInputRequest explicitly opens or refreshes one source under slot CAS.

func (OpenActiveInputRequest) Validate added in v0.3.5

func (r OpenActiveInputRequest) Validate() error

Validate requires source preparation without existing workflow authority and applies the continuation request's desired-state validation.

type OperationError added in v0.3.0

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

OperationError preserves one wrapped cause while exposing only its safe failure through Error and Failure.

func NewOperationError added in v0.3.0

func NewOperationError(failure OperationFailure, cause error) *OperationError

NewOperationError creates a typed safe operation error.

func (*OperationError) Error added in v0.3.0

func (e *OperationError) Error() string

func (*OperationError) Failure added in v0.3.0

func (e *OperationError) Failure() OperationFailure

Failure returns the stable safe transport value.

func (*OperationError) Unwrap added in v0.3.0

func (e *OperationError) Unwrap() error

Unwrap retains errors.Is/errors.As access to the private cause.

type OperationFailure added in v0.3.0

type OperationFailure struct {
	Code              OperationFailureCode
	Operation         OperationKind
	HDRAnalysisCode   HDRAnalysisFailureCode   `json:"HDRAnalysisCode,omitempty"`
	AudioAnalysisCode AudioAnalysisFailureCode `json:"AudioAnalysisCode,omitempty"`
	Message           string
	Recovery          OperationRecovery
}

OperationFailure is safe for CLI and browser transport. Raw causes are intentionally excluded.

func AsOperationFailure added in v0.3.0

func AsOperationFailure(err error) (OperationFailure, bool)

AsOperationFailure extracts a stable failure from a wrapped error chain.

type OperationFailureCode added in v0.3.0

type OperationFailureCode string

OperationFailureCode is a stable machine-readable failure classification.

const (
	OperationFailureInvalidInput             OperationFailureCode = "invalid_input"
	OperationFailureActiveInputBusy          OperationFailureCode = "active_input_busy"
	OperationFailureLiveTestMutationDisabled OperationFailureCode = "live_test_mutation_disabled"
	OperationFailureInvalidSource            OperationFailureCode = "invalid_source"
	OperationFailureConfirmationRequired     OperationFailureCode = "confirmation_required"
	OperationFailureStaleGeneration          OperationFailureCode = "stale_generation"
	OperationFailureIncompatibleGeneration   OperationFailureCode = "incompatible_generation"
	OperationFailureMissingPrerequisite      OperationFailureCode = "missing_prerequisite"
	OperationFailureTrackerAuthRequired      OperationFailureCode = "tracker_auth_required"
	OperationFailureTrackerAuthUnavailable   OperationFailureCode = "tracker_auth_unavailable"
	OperationFailureNoEligibleTrackers       OperationFailureCode = "no_eligible_trackers"
	OperationFailureStaleReview              OperationFailureCode = "stale_review"
	OperationFailureStaleResult              OperationFailureCode = "stale_result"
	OperationFailureMissingReview            OperationFailureCode = "missing_review"
	OperationFailureMissingPreparedTracker   OperationFailureCode = "missing_prepared_tracker_operation"
	OperationFailureMissingExactTorrent      OperationFailureCode = "missing_exact_torrent"
	OperationFailureDryRunClientInjection    OperationFailureCode = "dry_run_client_injection_failed"
	OperationFailureClientInjection          OperationFailureCode = "client_injection_failed"
	OperationFailureImageHostUnavailable     OperationFailureCode = "image_host_unavailable"
	OperationFailureHDRAnalysis              OperationFailureCode = "hdr_analysis_failed"
	OperationFailureAudioAnalysis            OperationFailureCode = "audio_analysis_failed"
	OperationFailureUnknownOutcome           OperationFailureCode = "unknown_submission_outcome"
	OperationFailureInternal                 OperationFailureCode = "internal"
)

type OperationKind added in v0.3.0

type OperationKind string

OperationKind identifies the domain operation that failed.

const (
	OperationKindUnknown         OperationKind = "unknown"
	OperationKindPreparation     OperationKind = "preparation"
	OperationKindDuplicateCheck  OperationKind = "duplicate_check"
	OperationKindDryRun          OperationKind = "dry_run"
	OperationKindUploadDryRun    OperationKind = "upload_dry_run"
	OperationKindUploadExecute   OperationKind = "upload_execute"
	OperationKindClientInjection OperationKind = "client_injection"
	OperationKindMedia           OperationKind = "media"
	OperationKindDescription     OperationKind = "description"
	OperationKindImageHosting    OperationKind = "image_hosting"
	OperationKindHDRAnalysis     OperationKind = "analyze_hdr"
	OperationKindAudioAnalysis   OperationKind = "analyze_audio"
)

type OperationLifecycle added in v0.3.0

type OperationLifecycle string

OperationLifecycle describes execution independently from business outcome.

const (
	OperationLifecycleQueued   OperationLifecycle = "queued"
	OperationLifecycleRunning  OperationLifecycle = "running"
	OperationLifecycleReady    OperationLifecycle = "ready"
	OperationLifecycleWaiting  OperationLifecycle = "waiting"
	OperationLifecycleTerminal OperationLifecycle = "terminal"
)

type OperationRecovery added in v0.3.0

type OperationRecovery string

OperationRecovery is the required caller action for a stable failure.

const (
	OperationRecoveryNone                 OperationRecovery = "none"
	OperationRecoveryEditInput            OperationRecovery = "edit_input"
	OperationRecoveryConfirm              OperationRecovery = "confirm"
	OperationRecoveryRefreshRelease       OperationRecovery = "refresh_release"
	OperationRecoveryCompletePrerequisite OperationRecovery = "complete_prerequisite"
	OperationRecoveryAuthenticateTrackers OperationRecovery = "authenticate_trackers"
	OperationRecoverySelectTrackers       OperationRecovery = "select_trackers"
	OperationRecoveryReviewAgain          OperationRecovery = "review_again"
	OperationRecoveryReprepare            OperationRecovery = "reprepare"
	OperationRecoveryRetry                OperationRecovery = "retry"
)

type OverrideState added in v0.3.0

type OverrideState string

OverrideState records tri-state caller intent.

const (
	// OverrideStateUnset means automatic resolution may supply a fact.
	OverrideStateUnset OverrideState = "unset"
	// OverrideStateValue means a caller locked an explicit non-empty value.
	OverrideStateValue OverrideState = "value"
	// OverrideStateClear means a caller locked the fact as unknown.
	OverrideStateClear OverrideState = "clear"
)

type PackageFacts added in v0.3.0

type PackageFacts struct {
	Status                    MetadataEvidenceStatus
	KnownFileCount            int
	MediaFileCount            int
	ArchiveFileCount          int
	ExternalSubtitleFileCount int
	ExternalFileCount         int
	NestedFileCount           int
	Extensions                []string
	DetectedSeasons           []int
	DetectedEpisodes          []SeasonEpisodeFacts
	ExtraKinds                []PackageFileKind
	SingleFileFolder          bool
}

PackageFacts contains source-layout facts derived without filesystem I/O. Status remains partial until the caller supplies a complete all-file list.

type PackageFileKind added in v0.3.0

type PackageFileKind string

PackageFileKind classifies a known package entry without applying tracker-specific policy.

const (
	PackageFileKindMedia            PackageFileKind = "media"
	PackageFileKindArchive          PackageFileKind = "archive"
	PackageFileKindExternalSubtitle PackageFileKind = "external_subtitle"
	PackageFileKindSample           PackageFileKind = "sample"
	PackageFileKindProof            PackageFileKind = "proof"
	PackageFileKindNFO              PackageFileKind = "nfo"
	PackageFileKindChecksum         PackageFileKind = "checksum"
	PackageFileKindImage            PackageFileKind = "image"
	PackageFileKindText             PackageFileKind = "text"
	PackageFileKindExecutable       PackageFileKind = "executable"
	PackageFileKindOther            PackageFileKind = "other"
)

type PlaylistInfo

type PlaylistInfo struct {
	ID       string         `json:"id"`
	DiscID   string         `json:"discId"`
	DiscName string         `json:"discName"`
	File     string         `json:"file"`
	Duration float64        `json:"duration"`
	Items    []PlaylistItem `json:"items"`
	Score    float64        `json:"score"`
	Edition  string         `json:"edition"`
}

PlaylistInfo represents a discovered playlist with an opaque backend ID. DiscID scopes duplicate filenames; File and DiscName are display evidence only.

type PlaylistInstruction added in v0.3.0

type PlaylistInstruction struct {
	Set      bool
	Selected []string
	UseAll   bool
}

PlaylistInstruction preserves tri-state playlist selection: Set=false means no instruction, while Set=true with an empty selection is an explicit clear.

type PlaylistItem

type PlaylistItem struct {
	File string `json:"file"`
	Size int64  `json:"size"`
}

PlaylistItem represents a single file reference within a playlist.

type PlaylistSelection

type PlaylistSelection struct {
	SourcePath        string
	SourceFingerprint string
	SelectedPlaylists []string
	UseAll            bool
	UpdatedAt         time.Time `ts_type:"string"`
}

type PlaylistSelectionRequiredError added in v0.3.0

type PlaylistSelectionRequiredError struct {
	// SourcePath identifies the requested local Blu-ray source.
	SourcePath string
	// Candidates contains the discovered playlists available for selection.
	Candidates []PlaylistInfo
}

PlaylistSelectionRequiredError reports a BDMV preparation without a usable direct or remembered playlist selection.

func (*PlaylistSelectionRequiredError) Error added in v0.3.0

Error returns the stable playlist-selection-required message.

type PreflightReleaseWorkflowTrackersRequest added in v0.3.0

type PreflightReleaseWorkflowTrackersRequest struct {
	ReleaseWorkflowCommandContext
	InputFingerprint WorkflowFingerprint   `json:"inputFingerprint,omitempty"`
	Interaction      InteractionMode       `json:"interaction,omitempty"`
	ExecutionMode    WorkflowExecutionMode `json:"executionMode,omitempty"`
}

PreflightReleaseWorkflowTrackersRequest runs live readiness checks.

func (PreflightReleaseWorkflowTrackersRequest) Validate added in v0.3.0

Validate verifies exact revision authority.

type PreparationCompatibility added in v0.3.0

type PreparationCompatibility struct {
	SourceFingerprint          string
	FactInstructionFingerprint string
	PolicyFingerprint          string
	ContractVersion            string
}

PreparationCompatibility records the four exact keys that permit reuse of a prepared-release generation.

type PreparationControls added in v0.3.0

type PreparationControls struct {
	// CaptureHDRMetadata requests one-shot native collection, including a scan when text reports are cached.
	CaptureHDRMetadata bool `json:"CaptureHDRMetadata,omitempty"`
	// Interaction determines whether preparation may request manual input.
	Interaction InteractionMode
	// ConfirmBDMVRescan permits replacing a partial cached Blu-ray analysis.
	ConfirmBDMVRescan bool
	// ForceRecheck forwards an explicit torrent-client hash recheck choice.
	ForceRecheck *bool
}

PreparationControls contains one-shot permissions and presentation choices. These values never participate in preparation compatibility.

type PreparationDescription

type PreparationDescription struct {
	GroupKey           string
	Trackers           []string
	RawDescription     string
	RawDescriptionHTML string
	Description        string
	DescriptionHTML    string
	ImagePreviews      map[string]string
	HasOverride        bool
	ImageHost          ImageHostFeedback
}

type PreparationDiagnostic added in v0.3.0

type PreparationDiagnostic struct {
	Code       string
	Severity   DiagnosticSeverity
	Message    string
	Candidates []ExternalIdentityCandidate
}

PreparationDiagnostic is non-canonical evidence or warning returned beside a prepared release.

type PreparationIntent added in v0.3.0

type PreparationIntent string

PreparationIntent describes why preparation was requested. It may influence reuse/progress decisions but never the canonical fact set.

const (
	// PreparationIntentPreview prepares a release for metadata preview.
	PreparationIntentPreview PreparationIntent = "preview"
	// PreparationIntentDuplicateCheck prepares a release for duplicate checking.
	PreparationIntentDuplicateCheck PreparationIntent = "duplicate_check"
	// PreparationIntentMedia prepares a release for media work.
	PreparationIntentMedia PreparationIntent = "media"
	// PreparationIntentDescription prepares a release for description work.
	PreparationIntentDescription PreparationIntent = "description"
	// PreparationIntentDryRun prepares a release for tracker dry run.
	PreparationIntentDryRun PreparationIntent = "dry_run"
	// PreparationIntentUpload prepares a release for upload review or execution.
	PreparationIntentUpload PreparationIntent = "upload"
)

type PreparationPolicy added in v0.3.0

type PreparationPolicy struct {
	KeepFolder bool
	// KeepImages preserves tracker-sourced images while collecting metadata evidence.
	KeepImages bool
	OnlyID     bool
}

PreparationPolicy contains non-secret preparation behavior that can affect canonical fact derivation and therefore participates in compatibility.

type PreparationPreview

type PreparationPreview struct {
	SourcePath      string
	Descriptions    []PreparationDescription
	ContentFailures []TrackerContentFailure
}

type PreparationProgressPhase added in v0.3.0

type PreparationProgressPhase string

PreparationProgressPhase identifies one stable stage in canonical release preparation. It is presentation telemetry, not prepared-release evidence.

const (
	// PreparationPhaseSourceInspection validates and classifies the requested source.
	PreparationPhaseSourceInspection PreparationProgressPhase = "source_inspection"
	// PreparationPhasePreparedCache checks whether an existing generation can be reused.
	PreparationPhasePreparedCache PreparationProgressPhase = "prepared_cache"
	// PreparationPhaseSourceEvidence collects filesystem and media-source facts.
	PreparationPhaseSourceEvidence PreparationProgressPhase = "source_evidence"
	// PreparationPhaseBDInfo analyzes selected Blu-ray playlists.
	PreparationPhaseBDInfo PreparationProgressPhase = "bdinfo"
	// PreparationPhaseClientDiscovery searches configured torrent clients.
	PreparationPhaseClientDiscovery PreparationProgressPhase = "client_discovery"
	// PreparationPhaseTrackerEvidence collects source metadata from trackers.
	PreparationPhaseTrackerEvidence PreparationProgressPhase = "tracker_evidence"
	// PreparationPhaseMediaInfoIdentity reads identifiers exposed by MediaInfo.
	PreparationPhaseMediaInfoIdentity PreparationProgressPhase = "mediainfo_identity"
	// PreparationPhaseArrIdentity queries configured Sonarr and Radarr services.
	PreparationPhaseArrIdentity PreparationProgressPhase = "arr_identity"
	// PreparationPhaseExternalIdentity resolves the canonical provider identity.
	PreparationPhaseExternalIdentity PreparationProgressPhase = "external_identity"
	// PreparationPhaseMediaFacts derives normalized release media facts.
	PreparationPhaseMediaFacts PreparationProgressPhase = "media_facts"
	// PreparationPhaseCanonicalIdentity finalizes canonical release identity.
	PreparationPhaseCanonicalIdentity PreparationProgressPhase = "canonical_identity"
	// PreparationPhaseGenerationCommit persists the prepared generation.
	PreparationPhaseGenerationCommit PreparationProgressPhase = "generation_commit"
	// PreparationPhasePreviewProjection builds the transport metadata preview.
	PreparationPhasePreviewProjection PreparationProgressPhase = "preview_projection"
	// PreparationPhaseResetCleanup removes reusable metadata before a forced reset.
	PreparationPhaseResetCleanup PreparationProgressPhase = "reset_cleanup"
	// PreparationPhaseCandidateSelection applies a selected Blu-ray candidate.
	PreparationPhaseCandidateSelection PreparationProgressPhase = "candidate_selection"
)

type PreparationProgressReporter added in v0.3.0

type PreparationProgressReporter func(update PreparationProgressUpdate)

PreparationProgressReporter receives advisory preparation progress.

type PreparationProgressStatus added in v0.3.0

type PreparationProgressStatus string

PreparationProgressStatus describes the latest advisory state of one stage.

const (
	// PreparationProgressRunning marks a stage that has started but is not terminal.
	PreparationProgressRunning PreparationProgressStatus = "running"
	// PreparationProgressCompleted marks a successfully completed stage.
	PreparationProgressCompleted PreparationProgressStatus = "completed"
	// PreparationProgressSkipped marks an intentional cache or policy bypass.
	PreparationProgressSkipped PreparationProgressStatus = "skipped"
	// PreparationProgressFailed marks a stage whose owning operation failed.
	PreparationProgressFailed PreparationProgressStatus = "failed"
)

type PreparationProgressUpdate added in v0.3.0

type PreparationProgressUpdate struct {
	// CorrelationID binds the update to one frontend preparation command.
	CorrelationID string `json:"correlationID"`
	// Phase identifies the stable preparation stage.
	Phase PreparationProgressPhase `json:"phase"`
	// Order is the canonical presentation order, not a completion percentage.
	Order int `json:"order"`
	// Label is the user-facing stage name.
	Label string `json:"label"`
	// Message describes the current stage transition.
	Message string `json:"message"`
	// Status is the latest advisory state for Phase.
	Status PreparationProgressStatus `json:"status"`
	// CompletedBytes is the verified local source content so far when known.
	// It is advisory progress only and never identifies a local path.
	CompletedBytes int64 `json:"completedBytes,omitempty"`
	// TotalBytes is the local source content expected for this phase when known.
	// It is advisory progress only and never identifies a local path.
	TotalBytes int64 `json:"totalBytes,omitempty"`
	// Timestamp is an RFC3339 timestamp injected by the WebUI boundary.
	Timestamp string `json:"timestamp"`
}

PreparationProgressUpdate is one frontend-safe advisory preparation event. CorrelationID and Timestamp are injected by the WebUI transport boundary.

func NewPreparationProgressUpdate added in v0.3.0

func NewPreparationProgressUpdate(
	phase PreparationProgressPhase,
	status PreparationProgressStatus,
	message string,
) PreparationProgressUpdate

NewPreparationProgressUpdate supplies the canonical order and label for a phase. Unknown phases remain renderable with a normalized fallback label.

type PrepareInput added in v0.3.0

type PrepareInput struct {
	SourcePath string
	// VerifiedSource is private evidence from one explicit open or refresh. It
	// never crosses a browser transport boundary and must not be reused there.
	VerifiedSource *VerifiedInputSource `json:"-"`
	Intent         PreparationIntent
	// ExternalFreshness controls provider-fact reuse and whether a new input
	// load may retry retained empty results. It is distinct from Force,
	// which controls complete prepared-generation reuse.
	ExternalFreshness ExternalFreshness
	Instructions      ReleaseFactInstructions
	Policy            PreparationPolicy
	// Search contains fact-producing client search choices included in compatibility.
	Search ClientSearchPolicy
	// Controls contains one-shot permissions excluded from compatibility.
	Controls PreparationControls
	// MetadataRequirements is the tracker-ID-free union of selected metadata demands.
	// It affects canonical collection but is not a reusable prepared-release fact.
	MetadataRequirements MetadataRequirementSet `json:"-"`
	Force                bool
	// RequirePrepared rejects collection when no compatible prepared generation exists.
	RequirePrepared bool
}

PrepareInput requests one canonical prepared-release generation.

func MapPreparationRequest added in v0.3.0

func MapPreparationRequest(request Request, intent PreparationIntent) (PrepareInput, error)

MapPreparationRequest maps one shared operation request to detached canonical preparation input. It performs no filesystem access or entrypoint-specific policy.

type PrepareReleaseWorkflowRequest added in v0.3.0

type PrepareReleaseWorkflowRequest struct {
	ReleaseWorkflowCommandContext
	Input PrepareInput `json:"input"`
}

PrepareReleaseWorkflowRequest prepares canonical facts for one workflow.

func (PrepareReleaseWorkflowRequest) Validate added in v0.3.0

func (r PrepareReleaseWorkflowRequest) Validate() error

Validate verifies authority and required preparation input.

type PrepareResult added in v0.3.0

type PrepareResult struct {
	// EquivalentPreviousRelease identifies the atomically checked predecessor whose
	// finalized facts and verified source identity are unchanged. It does not renew
	// workflow evidence, expiry, or approval authority.
	EquivalentPreviousRelease *ReleaseRef
	Release                   PreparedRelease
	Diagnostics               []PreparationDiagnostic
	// EffectiveInstructions and Corrections retain accepted intent outside the
	// immutable facts so workflow snapshots use the same preparation authority.
	EffectiveInstructions ReleaseFactInstructions
	Corrections           ReleaseCorrectionsSnapshot
}

PrepareResult returns one immutable release projection plus non-canonical preparation diagnostics.

func (PrepareResult) Clone added in v0.3.0

func (r PrepareResult) Clone() (PrepareResult, error)

Clone returns a detached result whose release and diagnostics can be mutated by the caller without affecting module-owned state.

type PreparedGeneration added in v0.3.0

type PreparedGeneration uint64

PreparedGeneration identifies one immutable prepared-release generation for a normalized source path.

type PreparedMediaBinding added in v0.3.2

type PreparedMediaBinding struct {
	SourcePath               string
	PreparedMediaFingerprint string
	PreparedGeneration       PreparedGeneration
	// CompatibilityKey may locate reusable media from a prior exact binding.
	// It never grants access to that binding's workflow artifacts.
	CompatibilityKey MediaCompatibilityKey
}

PreparedMediaBinding identifies repository media for one exact prepared generation.

func (PreparedMediaBinding) Equal added in v0.3.2

Equal reports exact equality across all binding components.

func (PreparedMediaBinding) Valid added in v0.3.2

func (b PreparedMediaBinding) Valid() bool

Valid reports whether every binding component is present.

type PreparedRelease added in v0.3.0

type PreparedRelease struct {
	Generation       PreparedGeneration
	Compatibility    PreparationCompatibility
	Source           SourceManifest
	SourceIdentity   SourceContentIdentity `json:"-"`
	Naming           NamingFacts
	Episode          EpisodeFacts
	Media            MediaFacts
	Disc             DiscFacts
	Identity         ExternalIdentity
	ProviderMetadata SourceScopedMetadata
	Assessments      ReleaseAssessments
	PreparedAt       time.Time `ts_type:"string"`
}

PreparedRelease is the immutable, source-scoped read model of finalized release facts. Workflow choices, diagnostics, resources, and outcomes are intentionally excluded.

func (PreparedRelease) Clone added in v0.3.0

func (r PreparedRelease) Clone() (PreparedRelease, error)

Clone returns a detached prepared-release projection.

func (PreparedRelease) MediaBinding added in v0.3.2

func (r PreparedRelease) MediaBinding() (PreparedMediaBinding, error)

MediaBinding identifies media derived from this exact prepared generation.

func (PreparedRelease) MediaCompatibilityKey added in v0.3.5

func (r PreparedRelease) MediaCompatibilityKey() (MediaCompatibilityKey, error)

MediaCompatibilityKey derives a strong reusable-media key from verified source bytes and the source selections that determine capture input. It intentionally excludes prepared generation, provider facts, naming, and tracker choices.

func (PreparedRelease) MetadataFacts added in v0.3.2

func (r PreparedRelease) MetadataFacts() EffectiveMetadata

MetadataFacts projects finalized descriptive values without mutable instructions.

func (PreparedRelease) MissingRequiredUploadFacts added in v0.4.1

func (r PreparedRelease) MissingRequiredUploadFacts() []string

MissingRequiredUploadFacts reports absent finalized facts in correction order. Provider evidence, source paths, and release names cannot fill these fields.

type PreparedReleaseDisplay added in v0.3.0

type PreparedReleaseDisplay struct {
	HDRTargets []HDRAnalysisTarget `json:"hdrTargets,omitempty"`
	// Commentary is the effective prepared value after explicit corrections.
	Commentary    bool `json:",omitempty"`
	ReleaseName   string
	Providers     []ProviderDisplay
	TrackerData   []TrackerPreview
	MediaInfoHTML string `json:",omitempty"`
}

PreparedReleaseDisplay is the canonical presentation projection for one exact prepared generation.

type PreparedReleaseRepository added in v0.3.0

type PreparedReleaseRepository interface {
	LoadPreparedRelease(ctx context.Context, sourcePath string) (PreparedRelease, error)
	CommitPreparedRelease(ctx context.Context, release PreparedRelease) error
	PurgePreparedRelease(ctx context.Context, sourcePath string) error
	LoadReleaseCorrections(context.Context, string) (ReleaseCorrectionsSnapshot, error)
	UpdateReleaseCorrections(context.Context, string, ReleaseCorrectionUpdate) (ReleaseCorrectionsSnapshot, error)
	CompareAndSwapReleaseCorrections(context.Context, string, uint64, StoredReleaseCorrectionsV1) (ReleaseCorrectionsSnapshot, error)
	// CommitPreparedReleaseWithCorrections computes compatibility from the authoritative
	// correction revision inside the generation transaction. The callback must perform
	// only local computation; its error rolls back both corrections and generation.
	// A non-nil predecessor generation must still be current before any write.
	CommitPreparedReleaseWithCorrections(context.Context, PreparedRelease, *PreparedGeneration, uint64, StoredReleaseCorrectionsV1,
		func(uint64) (PreparationCompatibility, error)) (uint64, error)
}

PreparedReleaseRepository owns whole-generation prepared facts. Commits and purges include canonical identity and source-scoped provider metadata in one transaction.

type PreviewReleaseWorkflowFrameRequest added in v0.3.0

type PreviewReleaseWorkflowFrameRequest struct {
	ReleaseWorkflowCommandContext
	// DiscID is required for multi-disc previews and optional for single-disc compatibility.
	DiscID           string  `json:"discId,omitempty"`
	TimestampSeconds float64 `json:"timestampSeconds"`
}

PreviewReleaseWorkflowFrameRequest creates a non-authoritative frame preview.

func (PreviewReleaseWorkflowFrameRequest) Validate added in v0.3.0

Validate verifies exact workflow authority and a non-negative timestamp.

type ProjectReleaseWorkflowTrackersRequest added in v0.3.0

type ProjectReleaseWorkflowTrackersRequest struct {
	ReleaseWorkflowCommandContext
	TrackerIDs    []TrackerID                                 `json:"trackerIds"`
	Instructions  map[TrackerID]TrackerProjectionInstructions `json:"instructions,omitempty"`
	ExecutionMode WorkflowExecutionMode                       `json:"executionMode,omitempty"`
}

ProjectReleaseWorkflowTrackersRequest selects and projects trackers.

func (ProjectReleaseWorkflowTrackersRequest) Validate added in v0.3.0

Validate verifies exact revision authority.

type ProjectionDupeCheckOptions added in v0.3.0

type ProjectionDupeCheckOptions struct {
	// SkipRemote limits evaluation to local/client evidence when true.
	SkipRemote bool
	// BypassBannedGroups allows debug-mode callers to bypass banned-group policy.
	BypassBannedGroups bool
}

ProjectionDupeCheckOptions controls projection-bound duplicate execution.

type ProjectionDupeService added in v0.3.0

ProjectionDupeService checks one exact tracker projection set and returns private retained evidence separately from its safe public summary.

type ProvenanceFacts added in v0.3.0

type ProvenanceFacts struct {
	Status             MetadataEvidenceStatus
	IdentitySourcePath string
	IdentityGeneration PreparedGeneration
	MetadataSourcePath string
	MetadataGeneration PreparedGeneration
	Identity           IdentityProvenanceSet
}

ProvenanceFacts records source/generation authority for identity and provider metadata consumed by validation.

type ProviderAvailabilityEvidence added in v0.3.0

type ProviderAvailabilityEvidence struct {
	// Provider identifies the provider whose matching entry was checked.
	Provider IdentityProvider
	// Status is present only for a completed availability decision.
	Status ProviderAvailabilityStatus
	// Source identifies the evidence producer or lookup contract.
	Source string
}

ProviderAvailabilityEvidence records one typed provider-entry lookup result. SourceScopedMetadata owns its exact source path and generation.

type ProviderAvailabilityStatus added in v0.3.0

type ProviderAvailabilityStatus string

ProviderAvailabilityStatus records the result of checking whether a provider has an entry for the current source. Missing evidence remains distinct from a completed lookup that found no entry.

const (
	// ProviderAvailabilityStatusAvailable means the provider returned a matching entry.
	ProviderAvailabilityStatusAvailable ProviderAvailabilityStatus = "available"
	// ProviderAvailabilityStatusNotFound means a completed lookup proved that the provider has no matching entry.
	ProviderAvailabilityStatusNotFound ProviderAvailabilityStatus = "not_found"
)

type ProviderDisplay added in v0.3.0

type ProviderDisplay struct {
	Provider         IdentityProvider
	ID               int
	DisplayID        string
	URL              string
	Provenance       IdentityProvenance
	SummaryAvailable bool
	Summary          ProviderDisplaySummary
	Details          ProviderDisplayDetails
}

ProviderDisplay is one provider-local display projection. Details contains exactly one payload matching Provider.

type ProviderDisplayDetails added in v0.3.0

type ProviderDisplayDetails struct {
	TMDB    *TMDBMetadata    `json:",omitempty"`
	IMDB    *IMDBMetadata    `json:",omitempty"`
	TVDB    *TVDBMetadata    `json:",omitempty"`
	TVmaze  *TVmazeMetadata  `json:",omitempty"`
	AniList *AniListMetadata `json:",omitempty"`
}

ProviderDisplayDetails is a closed typed provider payload union. Projection validation guarantees exactly one non-nil field matching Provider.

type ProviderDisplaySummary added in v0.3.0

type ProviderDisplaySummary struct {
	Title            string
	OriginalTitle    string
	Year             int
	Overview         string
	PosterURL        string
	BackdropURL      string
	Category         string
	Date             string
	EndDate          string
	OriginalLanguage string
	MediaType        string
	RuntimeMinutes   int
	Genres           string
	Keywords         string
	TrailerURL       string
	Rating           float64
	RatingCount      int
	Country          string
}

ProviderDisplaySummary is the normalized provider presentation shared by CLI, WebUI preview, and history.

type ProviderIDSet added in v0.3.2

type ProviderIDSet struct {
	TMDBID   int `json:"tmdbId"`
	IMDBID   int `json:"imdbId"`
	TVDBID   int `json:"tvdbId"`
	TVmazeID int `json:"tvmazeId"`
	MALID    int `json:"malId"`
}

ProviderIDSet is the resolved provider identity subset required to bind content corrections.

type PublicResourceID added in v0.3.0

type PublicResourceID string

PublicResourceID identifies an opaque public artifact without exposing a local path.

type ReadinessStatus added in v0.3.0

type ReadinessStatus string

ReadinessStatus distinguishes deterministic projection and live readiness outcomes.

const (
	// ReadinessStatusUnknown means readiness has not been assessed.
	ReadinessStatusUnknown ReadinessStatus = "unknown"
	// ReadinessStatusReady means the resource is safe for its stated next stage.
	ReadinessStatusReady ReadinessStatus = "ready"
	// ReadinessStatusBlocked means required data or action is unresolved.
	ReadinessStatusBlocked ReadinessStatus = "blocked"
	// ReadinessStatusIneligible means deterministic policy excludes the tracker.
	ReadinessStatusIneligible ReadinessStatus = "ineligible"
	// ReadinessStatusStale means freshness or a dependency fingerprint no longer matches.
	ReadinessStatusStale ReadinessStatus = "stale"
)

type ReconcileActiveInputRequest added in v0.3.5

type ReconcileActiveInputRequest struct {
	Authority      WorkflowAuthority    `json:"authority"`
	Answer         RequiredActionAnswer `json:"answer"`
	IdempotencyKey string               `json:"idempotencyKey"`
}

ReconcileActiveInputRequest resolves one required reconciliation action in the currently claimed legacy recovery slot.

func (ReconcileActiveInputRequest) Validate added in v0.3.5

func (r ReconcileActiveInputRequest) Validate() error

Validate requires an action answer for the exact workflow revision and an idempotency key. The workflow validates the answer against its required action.

type RecoverLegacyActiveInputRequest added in v0.3.5

type RecoverLegacyActiveInputRequest struct {
	WorkflowID WorkflowID `json:"workflowId"`
}

RecoverLegacyActiveInputRequest selects one owner-scoped migrated workflow that has an unresolved external effect.

func (RecoverLegacyActiveInputRequest) Validate added in v0.3.5

Validate requires the workflow selected for legacy recovery.

type ReleaseActiveInputRequest added in v0.3.5

type ReleaseActiveInputRequest struct {
	ExpectedRevision uint64 `json:"expectedRevision"`
}

ReleaseActiveInputRequest closes the caller's input only at the observed slot revision. Closing an input does not delete its release history or reusable artifacts.

type ReleaseAssessments added in v0.3.0

type ReleaseAssessments struct {
	MediaInfoUniqueID       UniqueIDStatus
	MediaInfoEncodeSettings EncodeSettingsStatus
	VideoBitrate            VideoBitrateAssessment
	Naming                  NamingAssessment
}

ReleaseAssessments contains concrete source-derived assessments. Operations decide whether these facts block work.

func (ReleaseAssessments) EncodeSettingsRequirementSatisfied added in v0.3.0

func (a ReleaseAssessments) EncodeSettingsRequirementSatisfied() bool

EncodeSettingsRequirementSatisfied reports whether the concrete assessment permits work that requires MediaInfo encode settings.

func (ReleaseAssessments) UniqueIDRequirementSatisfied added in v0.3.0

func (a ReleaseAssessments) UniqueIDRequirementSatisfied() bool

UniqueIDRequirementSatisfied reports whether the concrete assessment permits work that requires a MediaInfo unique ID.

type ReleaseCorrectionPatch added in v0.3.2

type ReleaseCorrectionPatch struct {
	Values           ReleaseCorrectionValues `json:"values"`
	ResetFields      []CorrectionFieldRef    `json:"resetFields,omitempty"`
	ConfirmFields    []CorrectionFieldRef    `json:"confirmFields,omitempty"`
	ExpectedRevision *uint64                 `json:"expectedRevision,omitempty"`
}

ReleaseCorrectionPatch merges explicit fields into saved correction intent. Nil pointers omit a field, while pointers to false, zero, empty strings, or empty slices are explicit values. ResetFields removes saved intent so preparation can derive the value again. ConfirmFields retains a content-bound value for the newly resolved identity and requires ExpectedRevision plus the current workflow confirmation action. A supplied revision also guards ordinary edits.

func (*ReleaseCorrectionPatch) UnmarshalJSON added in v0.3.2

func (p *ReleaseCorrectionPatch) UnmarshalJSON(payload []byte) error

UnmarshalJSON rejects unknown fields throughout this new patch contract.

func (ReleaseCorrectionPatch) Validate added in v0.3.2

func (p ReleaseCorrectionPatch) Validate() error

Validate checks incoming values, closed correction targets, and mutually exclusive operations.

type ReleaseCorrectionUpdate added in v0.3.2

type ReleaseCorrectionUpdate struct {
	Mode   ReleaseCorrectionUpdateMode
	Values ReleaseCorrectionValues
	Patch  *ReleaseCorrectionPatch
	// Confirmation carries workflow-validated identity evidence across acceptance
	// and preparation. It is internal authority, never a transport input.
	Confirmation *CorrectionConfirmation
}

ReleaseCorrectionUpdate is the internal persistence operation selected by an adapter.

type ReleaseCorrectionUpdateMode added in v0.3.2

type ReleaseCorrectionUpdateMode string

ReleaseCorrectionUpdateMode makes persistence intent explicit.

const (
	ReleaseCorrectionUpdateInherit  ReleaseCorrectionUpdateMode = "inherit"
	ReleaseCorrectionUpdatePatch    ReleaseCorrectionUpdateMode = "patch"
	ReleaseCorrectionUpdateReplace  ReleaseCorrectionUpdateMode = "replace"
	ReleaseCorrectionUpdateResetAll ReleaseCorrectionUpdateMode = "reset_all"
)

type ReleaseCorrectionValues added in v0.3.2

type ReleaseCorrectionValues struct {
	Identity    ExternalIDOverrides
	ReleaseName ReleaseNameOverrides
	Metadata    MetadataOverrides
}

ReleaseCorrectionValues carries the only fact-producing correction fields.

func (ReleaseCorrectionValues) Fields added in v0.3.2

Fields returns each explicit value target in deterministic field order. Callers should Validate a patch before relying on track target validity.

func (ReleaseCorrectionValues) WithoutFields added in v0.3.2

WithoutFields returns detached values with the selected explicit fields removed.

type ReleaseCorrectionsSnapshot added in v0.3.2

type ReleaseCorrectionsSnapshot struct {
	Corrections StoredReleaseCorrectionsV1 `json:"corrections"`
	Revision    uint64                     `json:"revision"`
}

ReleaseCorrectionsSnapshot combines one persisted correction payload and its row revision.

func (ReleaseCorrectionsSnapshot) Clone added in v0.3.2

Clone returns a detached correction read model.

type ReleaseFactInstructionSnapshot added in v0.3.0

type ReleaseFactInstructionSnapshot struct {
	ID                       ReleaseFactInstructionSnapshotID `json:"id"`
	WorkflowID               WorkflowID                       `json:"workflowId"`
	Revision                 WorkflowRevision                 `json:"revision"`
	Instructions             ReleaseFactInstructions          `json:"instructions"`
	CorrectionRevision       uint64                           `json:"correctionRevision,omitempty"`
	ExplicitCorrectionFields []CorrectionFieldRef             `json:"explicitCorrectionFields,omitempty"`
	Fingerprint              WorkflowFingerprint              `json:"fingerprint"`
	CreatedAt                time.Time                        `json:"createdAt" ts_type:"string"`
}

ReleaseFactInstructionSnapshot retains exact fact-producing caller intent.

func (ReleaseFactInstructionSnapshot) Clone added in v0.3.0

Clone returns a detached fact-instruction snapshot.

func (ReleaseFactInstructionSnapshot) ComputeFingerprint added in v0.3.0

func (s ReleaseFactInstructionSnapshot) ComputeFingerprint() (WorkflowFingerprint, error)

ComputeFingerprint returns the normalized fact-instruction fingerprint.

func (ReleaseFactInstructionSnapshot) Normalize added in v0.3.0

Normalize returns a detached snapshot with normalized tracker keys and source lookup.

func (ReleaseFactInstructionSnapshot) Validate added in v0.3.0

Validate verifies snapshot identity and deterministic fingerprint integrity.

func (ReleaseFactInstructionSnapshot) WithFingerprint added in v0.3.0

WithFingerprint returns a normalized snapshot with its deterministic fingerprint populated.

type ReleaseFactInstructionSnapshotID added in v0.3.0

type ReleaseFactInstructionSnapshotID string

ReleaseFactInstructionSnapshotID identifies one immutable fact-instruction snapshot.

type ReleaseFactInstructionSnapshotRef added in v0.3.0

type ReleaseFactInstructionSnapshotRef struct {
	ID       ReleaseFactInstructionSnapshotID `json:"id"`
	Revision WorkflowRevision                 `json:"revision"`
}

ReleaseFactInstructionSnapshotRef references one exact instruction snapshot revision.

type ReleaseFactInstructionUpdate added in v0.3.0

type ReleaseFactInstructionUpdate struct {
	Instructions WorkflowPatch[ReleaseFactInstructions] `json:"-"`
}

ReleaseFactInstructionUpdate replaces a complete instruction snapshot. A null instructions member resets every field to automatic; an absent member leaves it unchanged.

func (ReleaseFactInstructionUpdate) MarshalJSON added in v0.3.0

func (u ReleaseFactInstructionUpdate) MarshalJSON() ([]byte, error)

MarshalJSON preserves absent, null/reset, and explicit instruction values.

func (*ReleaseFactInstructionUpdate) UnmarshalJSON added in v0.3.0

func (u *ReleaseFactInstructionUpdate) UnmarshalJSON(payload []byte) error

UnmarshalJSON preserves whether instructions were absent, null, or explicitly supplied.

type ReleaseFactInstructions added in v0.3.0

type ReleaseFactInstructions struct {
	Identity        ExternalIDOverrides
	Category        *CanonicalCategory
	ReleaseName     ReleaseNameOverrides
	Metadata        MetadataOverrides
	SourceLookup    string
	BlurayReleaseID string
	Playlist        PlaylistInstruction
	// TrackerIDs maps normalized tracker names to caller-supplied source IDs.
	TrackerIDs map[string]string
}

ReleaseFactInstructions contains caller intent that can change finalized reusable release facts.

type ReleaseFeature added in v0.4.1

type ReleaseFeature string

ReleaseFeature identifies a prepared annotation that does not establish a cut or edition.

const (
	// ReleaseFeatureHybrid describes mixed release sources, never an editorial cut.
	ReleaseFeatureHybrid        ReleaseFeature = "hybrid"
	ReleaseFeatureRestoration   ReleaseFeature = "restoration"
	ReleaseFeatureRemaster      ReleaseFeature = "remaster"
	ReleaseFeatureTwoDiscSet    ReleaseFeature = "two_disc_set"
	ReleaseFeature4KRestoration ReleaseFeature = "4k_restoration"
	ReleaseFeature4KRemaster    ReleaseFeature = "4k_remaster"
	ReleaseFeatureExtras        ReleaseFeature = "extras"
	ReleaseFeature2D3DEdition   ReleaseFeature = "2d_3d_edition"
	ReleaseFeature3DAnaglyph    ReleaseFeature = "3d_anaglyph"
	ReleaseFeature3DFullSBS     ReleaseFeature = "3d_full_sbs"
	ReleaseFeature3DHalfOU      ReleaseFeature = "3d_half_ou"
	ReleaseFeature3DHalfSBS     ReleaseFeature = "3d_half_sbs"
)

type ReleaseInfo

type ReleaseInfo struct {
	Category     string
	Type         string
	Artist       string
	Title        string
	Subtitle     string
	Alt          string
	Year         int
	Month        int
	Day          int
	Version      string
	Source       string
	Resolution   string
	Codec        []string
	Audio        []string
	HDR          []string
	Ext          string
	Language     []string
	Site         string
	Genre        string
	Channels     string
	Collection   string
	Region       string
	Size         string
	Group        string
	Disc         string
	Season       int
	Episode      int
	Presentation []string
	Cut          []string
	Edition      []string
	Other        []string

	ReleaseFeatures []ReleaseFeature
}

ReleaseInfo carries canonical release fields to operations. Preparation also uses it privately for detached release-name parser evidence. Codec, Audio, HDR, Language, and Ext retain parser tokens for naming transformations; operations must use resolved media fields for technical facts.

func (ReleaseInfo) EditionLabel added in v0.4.0

func (r ReleaseInfo) EditionLabel() string

EditionLabel joins finalized release categories for duplicate subjects that do not carry the upload projection. It never reads a rendered release name.

type ReleaseNameComponent added in v0.3.5

type ReleaseNameComponent struct {
	Role           ReleaseNameRole
	Value          string
	AvailableValue string
	Present        bool
	Manual         bool
	Join           string
	AttachTo       []ReleaseNameRole `json:"AttachTo,omitempty"`
}

ReleaseNameComponent preserves one generated component's semantic identity, rendered value, retained finalized value, manual authority, and layout. Present controls rendering; AvailableValue retains known evidence even when presentation omits it. An empty available value is not permission to infer one. Manual protects the component from optional tracker defaults, not declared mandatory tracker authority. Join is emitted immediately before Value when the component is present; the first rendered component never receives its Join. AttachTo preserves layouts that concatenate this component to one immediately preceding semantic role. When no listed role immediately precedes it, Render uses Join instead. Empty AttachTo lists are omitted from JSON; absence means no attachment anchors.

type ReleaseNameDocument added in v0.3.5

type ReleaseNameDocument struct {
	Version    string
	Components []ReleaseNameComponent
}

ReleaseNameDocument is the canonical structured representation of one generated release-name layout. Components retain absent positions so policy projections can change presence without rediscovering name semantics.

func (*ReleaseNameDocument) Clone added in v0.3.5

Clone returns an independently mutable copy of the document.

func (*ReleaseNameDocument) Component added in v0.3.5

Component returns the component for role, if this layout contains it.

func (*ReleaseNameDocument) Render added in v0.3.5

Render renders the document's exact layout into legacy name projections.

func (*ReleaseNameDocument) Validate added in v0.3.5

func (d *ReleaseNameDocument) Validate() error

Validate checks the version, semantic roles, component uniqueness, and renderable component values without changing the document.

type ReleaseNameElementPolicy added in v0.3.0

type ReleaseNameElementPolicy struct {
	// Version identifies the element-policy contract included in projection
	// fingerprints.
	Version string
	// EpisodeTitleMode applies only to structurally generated names; exact
	// source names and explicit release-name overrides remain authoritative.
	EpisodeTitleMode EpisodeTitleMode
}

ReleaseNameElementPolicy is the versioned shared contract applied to structurally generated names before tracker-specific formatting.

func (ReleaseNameElementPolicy) Normalized added in v0.3.0

Normalized resolves shared defaults without accepting unsupported values.

type ReleaseNameOverrides

type ReleaseNameOverrides struct {
	// ThreeD sets or clears effective 3D; nil restores detection and true preserves a detected subtype.
	ThreeD     *bool
	Category   *string
	Type       *string
	Source     *string
	Resolution *string
	Tag        *string
	Service    *string
	// Repack replaces the detected release version; empty clears it and nil keeps automatic detection.
	Repack *string
	// Presentation replaces detected presentation; empty clears it and nil keeps detection.
	Presentation *string
	// ReleaseFeatures replaces detected features; an empty list clears them and nil keeps detection.
	ReleaseFeatures *[]ReleaseFeature
	Edition         *string
	Season          *string
	Episode         *string
	EpisodeTitle    *string
	// ManualYear replaces the derived year; zero explicitly clears it and nil restores automatic resolution.
	ManualYear       *int
	ManualDate       *string
	UseSeasonEpisode *bool
	NoSeason         *bool
	NoYear           *bool
	NoAKA            *bool
	NoTag            *bool
	NoEpisodeTitle   *bool
	NoDistributor    *bool
	NoEdition        *bool
	NoDub            *bool
	NoDual           *bool
	DualAudio        *bool
	Region           *string
}

func SeparateEditionOverride added in v0.4.1

func SeparateEditionOverride(value string) ReleaseNameOverrides

SeparateEditionOverride converts only fully recognized manual compounds into independent corrections. Unknown wording is returned untouched. A plain cut stays in Edition; no substring can establish an independent feature.

type ReleaseNamePresentation added in v0.3.2

type ReleaseNamePresentation struct {
	Version            string
	OmitAlternateTitle bool
	OmitYear           bool
	OmitSeasonEpisode  bool
	UseDailyDate       bool
}

ReleaseNamePresentation records finalized presentation choices for tracker-specific automatic names without carrying raw workflow overrides.

type ReleaseNameRequest

type ReleaseNameRequest struct {
	Category string
	Type     string
	// ManualType keeps an explicit type correction authoritative over inferred source signals.
	ManualType bool
	Title      string
	AltTitle   string
	Year       int
	ManualYear int
	Resolution string
	// Downscale is an explicit source marker, not inferred from output dimensions.
	Downscale    string
	Audio        string
	Service      string
	Season       string
	Episode      string
	Part         string
	Repack       string
	ThreeD       string
	Tag          string
	Source       string
	UHD          string
	HDR          string
	WebDV        bool
	Hybrid       bool
	EpisodeTitle string
	// ManualEpisodeTitle reports that EpisodeTitle came from an explicit
	// override. Both blank and nonblank manual values remain authoritative.
	ManualEpisodeTitle bool
	VideoCodec         string
	VideoEncode        string
	DiscType           string
	Region             string
	DVDSize            string
	EditionSet         string
	Cut                string
	Presentation       string
	Edition            string
	// ManualEdition keeps opaque user wording intact instead of deriving Hybrid from it.
	ManualEdition bool
	// ManualPresentation and ManualReleaseFeatures retain explicit annotations beside multi-edition sets.
	ManualPresentation    bool
	ManualReleaseFeatures bool
	// EditionDisplay replaces edition wording only in generated names, never canonical edition evidence.
	EditionDisplay string
	SearchYear     string
	DailyDate      string
	ManualDate     bool
	TMDBDateMatch  bool
	NoSeason       bool
	NoYear         bool
	NoAKA          bool
}

type ReleaseNameResult

type ReleaseNameResult struct {
	NameNoTag string
	Name      string
	CleanName string
	// GeneratedName preserves the semantic layout of this automatically generated name.
	// Nil means the current result is not structurally generated.
	GeneratedName     *ReleaseNameDocument
	GeneratedVariants GeneratedReleaseNameVariants
	MissingFields     []string
}

type ReleaseNameRole added in v0.3.5

type ReleaseNameRole string

ReleaseNameRole identifies one semantic component in a generated release name.

const (
	NameRoleTitle          ReleaseNameRole = "title"
	NameRoleAlternateTitle ReleaseNameRole = "alternate_title"
	NameRoleYear           ReleaseNameRole = "year"
	NameRoleSeason         ReleaseNameRole = "season"
	NameRoleEpisode        ReleaseNameRole = "episode"
	NameRoleEpisodeTitle   ReleaseNameRole = "episode_title"
	NameRoleDailyDate      ReleaseNameRole = "daily_date"
	NameRolePart           ReleaseNameRole = "part"
	NameRoleThreeD         ReleaseNameRole = "3d"
	NameRoleEditionSet     ReleaseNameRole = "edition_set"
	NameRoleCut            ReleaseNameRole = "cut"
	NameRolePresentation   ReleaseNameRole = "presentation"
	NameRoleEdition        ReleaseNameRole = "edition"
	// NameRoleEditionDisplay preserves display wording separately from canonical edition evidence.
	NameRoleEditionDisplay ReleaseNameRole = "edition_display"
	NameRoleHybrid         ReleaseNameRole = "hybrid"
	NameRoleRepack         ReleaseNameRole = "repack"
	NameRoleResolution     ReleaseNameRole = "resolution"
	NameRoleDownscale      ReleaseNameRole = "downscale"
	NameRoleRegion         ReleaseNameRole = "region"
	NameRoleUHD            ReleaseNameRole = "uhd"
	NameRoleSource         ReleaseNameRole = "source"
	NameRoleDVDSystem      ReleaseNameRole = "dvd_system"
	NameRoleDVDSize        ReleaseNameRole = "dvd_size"
	NameRoleService        ReleaseNameRole = "service"
	NameRoleVideoFormat    ReleaseNameRole = "video_format"
	NameRoleHDR            ReleaseNameRole = "hdr"
	NameRoleVideoCodec     ReleaseNameRole = "video_codec"
	NameRoleVideoEncode    ReleaseNameRole = "video_encode"
	NameRoleAudio          ReleaseNameRole = "audio"
	NameRoleDubbed         ReleaseNameRole = "dubbed"
	NameRoleDualAudio      ReleaseNameRole = "dual_audio"
	NameRoleLanguageMarker ReleaseNameRole = "language_marker"
	NameRoleLocale         ReleaseNameRole = "locale"
	NameRoleDistributor    ReleaseNameRole = "distributor"
	NameRoleSubtitleMarker ReleaseNameRole = "subtitle_marker"
	NameRoleGroup          ReleaseNameRole = "group"
	NameRoleOriginalGroup  ReleaseNameRole = "original_group"
)

func (ReleaseNameRole) Valid added in v0.3.5

func (role ReleaseNameRole) Valid() bool

Valid reports whether role is a supported component identity.

type ReleaseNameVariant added in v0.3.0

type ReleaseNameVariant struct {
	// NameNoTag, Name, and CleanName are the same projections exposed by
	// [ReleaseNameResult] for this structural alternative.
	NameNoTag string
	Name      string
	CleanName string
}

ReleaseNameVariant contains one internally consistent generated name form.

type ReleaseRef added in v0.3.0

type ReleaseRef struct {
	SourcePath string
	Generation PreparedGeneration
}

ReleaseRef identifies one exact prepared generation without exposing its facts or private preparation resources.

type ReleaseSelectionRepository added in v0.3.0

type ReleaseSelectionRepository interface {
	GetDescriptionOverride(ctx context.Context, path string, groupKey string) (DescriptionOverride, error)
	ListDescriptionOverridesByPath(ctx context.Context, path string) ([]DescriptionOverride, error)
	SaveDescriptionOverride(ctx context.Context, override DescriptionOverride) error
	DeleteDescriptionOverride(ctx context.Context, path string, groupKey string) error
	GetPlaylistSelection(ctx context.Context, sourcePath string) (PlaylistSelection, error)
	SavePlaylistSelection(ctx context.Context, sourcePath string, sourceFingerprint string, playlists []string, useAll bool) error
}

ReleaseSelectionRepository persists user-selected description and playlist state. Explicit empty selections are distinct from missing records.

type ReleaseSnapshot added in v0.3.0

type ReleaseSnapshot struct {
	ID                     ReleaseSnapshotID                 `json:"id"`
	WorkflowID             WorkflowID                        `json:"workflowId"`
	Revision               WorkflowRevision                  `json:"revision"`
	FactInstructions       ReleaseFactInstructionSnapshotRef `json:"factInstructions"`
	PreparationFingerprint WorkflowFingerprint               `json:"preparationFingerprint,omitempty"`
	Release                PreparedRelease                   `json:"release"`
	Display                PreparedReleaseDisplay            `json:"display"`
	Diagnostics            []PreparationDiagnostic           `json:"diagnostics,omitempty"`
	Fingerprint            WorkflowFingerprint               `json:"fingerprint"`
	CreatedAt              time.Time                         `json:"createdAt" ts_type:"string"`
}

ReleaseSnapshot exposes canonical release facts with derived display and diagnostics.

func (ReleaseSnapshot) Clone added in v0.3.0

func (s ReleaseSnapshot) Clone() (ReleaseSnapshot, error)

Clone returns a detached release snapshot.

func (ReleaseSnapshot) ComputeFingerprint added in v0.3.0

func (s ReleaseSnapshot) ComputeFingerprint() (WorkflowFingerprint, error)

ComputeFingerprint returns the deterministic release-snapshot content fingerprint.

func (ReleaseSnapshot) Validate added in v0.3.0

func (s ReleaseSnapshot) Validate() error

Validate verifies release lineage, canonical generation, and fingerprint integrity.

type ReleaseSnapshotID added in v0.3.0

type ReleaseSnapshotID string

ReleaseSnapshotID identifies one immutable prepared-release projection.

type ReleaseSnapshotRef added in v0.3.0

type ReleaseSnapshotRef struct {
	ID       ReleaseSnapshotID `json:"id"`
	Revision WorkflowRevision  `json:"revision"`
}

ReleaseSnapshotRef references one exact prepared-release snapshot revision.

type ReleaseStateRepository added in v0.3.0

type ReleaseStateRepository interface {
	GetByPath(ctx context.Context, path string) (FileMetadata, error)
	Save(ctx context.Context, metadata FileMetadata) error
	GetExternalIdentity(ctx context.Context, path string) (ExternalIdentity, error)
	SaveExternalIdentity(ctx context.Context, ids ExternalIdentity) error
	GetExternalMetadata(ctx context.Context, path string) (SourceScopedMetadata, error)
	SaveExternalMetadata(ctx context.Context, metadata SourceScopedMetadata) error
	SaveDVDMediaInfo(ctx context.Context, info DVDMediaInfo) error
	GetReleaseNameOverrides(ctx context.Context, path string) (ReleaseNameOverrides, error)
	SaveReleaseNameOverrides(ctx context.Context, path string, overrides ReleaseNameOverrides) error
}

ReleaseStateRepository persists the state used to prepare one release. Implementations preserve path validation, UTC timestamps, and ErrNotFound identity for missing optional records.

type ReleaseWorkflow added in v0.3.0

type ReleaseWorkflow struct {
	SubmissionExclusions   []SubmissionExclusion                    `json:"submissionExclusions,omitempty"`
	ID                     WorkflowID                               `json:"id"`
	Revision               WorkflowRevision                         `json:"revision"`
	FactInstructions       ReleaseFactInstructionSnapshotRef        `json:"factInstructions"`
	Release                *ReleaseSnapshotRef                      `json:"release,omitempty"`
	InputReadiness         *InputReadinessSnapshotRef               `json:"inputReadiness,omitempty"`
	TrackerCatalog         *TrackerCatalogSnapshotRef               `json:"trackerCatalog,omitempty"`
	TrackerRuntime         *TrackerRuntimeSnapshotRef               `json:"trackerRuntime,omitempty"`
	Selection              *TrackerSelectionRef                     `json:"selection,omitempty"`
	ProjectionInstructions *TrackerProjectionInstructionSnapshotRef `json:"projectionInstructions,omitempty"`
	TrackerProjections     *TrackerReleaseProjectionSetRef          `json:"trackerProjections,omitempty"`
	TrackerPreflight       *TrackerPreflightAssessmentRef           `json:"trackerPreflight,omitempty"`
	Dupes                  *DupeAssessmentRef                       `json:"dupes,omitempty"`
	TrackerApproval        *TrackerApprovalSnapshotRef              `json:"trackerApproval,omitempty"`
	Media                  *MediaArtifactSetRef                     `json:"media,omitempty"`
	HDRComparison          *HDRComparisonSourceRef                  `json:"hdrComparison,omitempty"`
	HDRAnalysisEnabled     bool                                     `json:"hdrAnalysisEnabled,omitempty"`
	HDRImages              *HDRImageSelection                       `json:"hdrImages,omitempty"`
	HDRAnalysis            *HDRAnalysisRef                          `json:"hdrAnalysis,omitempty"`
	AudioAnalysisEnabled   bool                                     `json:"audioAnalysisEnabled,omitempty"`
	AudioAnalysis          *AudioAnalysisRef                        `json:"audioAnalysis,omitempty"`
	Descriptions           *DescriptionSetRef                       `json:"descriptions,omitempty"`
	DryRun                 *UploadDryRunResultRef                   `json:"dryRun,omitempty"`
	UploadResult           *UploadResultRef                         `json:"uploadResult,omitempty"`
	Status                 WorkflowStatus                           `json:"status"`
	RequiredActions        []RequiredAction                         `json:"requiredActions,omitempty"`
	Failures               []WorkflowFailure                        `json:"failures,omitempty"`
	CreatedAt              time.Time                                `json:"createdAt" ts_type:"string"`
	UpdatedAt              time.Time                                `json:"updatedAt" ts_type:"string"`
}

ReleaseWorkflow is the revisioned aggregate of immutable stage references. AudioAnalysisEnabled may be true before a result exists; disabling clears the current AudioAnalysis reference.

func (ReleaseWorkflow) AllSelectedTrackersAlreadyUploaded added in v0.3.5

func (w ReleaseWorkflow) AllSelectedTrackersAlreadyUploaded() bool

AllSelectedTrackersAlreadyUploaded identifies a successful history-only terminal result.

func (ReleaseWorkflow) Clone added in v0.3.0

func (w ReleaseWorkflow) Clone() (ReleaseWorkflow, error)

Clone returns a detached release workflow aggregate.

func (ReleaseWorkflow) Validate added in v0.3.0

func (w ReleaseWorkflow) Validate() error

Validate verifies aggregate identity, status, and monotonic dependency lineage.

type ReleaseWorkflowCapabilities added in v0.3.0

type ReleaseWorkflowCapabilities struct {
	ApplicationVersion     string                              `json:"applicationVersion"`
	APIVersion             string                              `json:"apiVersion"`
	OwnerID                string                              `json:"ownerId"`
	Scopes                 []string                            `json:"scopes"`
	Features               ReleaseWorkflowCapabilityFeatures   `json:"features"`
	UploadOptionSchemaHash string                              `json:"uploadOptionSchemaHash"`
	Trackers               []ReleaseWorkflowCapabilityTracker  `json:"trackers"`
	TorrentClients         []ReleaseWorkflowCapabilityResource `json:"torrentClients"`
	ImageHosts             []ReleaseWorkflowCapabilityResource `json:"imageHosts"`
}

ReleaseWorkflowCapabilities describes one authenticated server's safe public integration contract. It contains no credentials or secret-bearing endpoints.

type ReleaseWorkflowCapabilityFeatures added in v0.3.0

type ReleaseWorkflowCapabilityFeatures struct {
	CompositeUpload                   bool `json:"compositeUpload"`
	TypedFeedback                     bool `json:"typedFeedback"`
	StrictEligibleTrackerContinuation bool `json:"strictEligibleTrackerContinuation"`
}

ReleaseWorkflowCapabilityFeatures are stable feature gates for API clients.

type ReleaseWorkflowCapabilityField added in v0.3.0

type ReleaseWorkflowCapabilityField struct {
	Key        string `json:"key"`
	YAMLKey    string `json:"yamlKey"`
	Activation bool   `json:"activation"`
}

ReleaseWorkflowCapabilityField describes one configurable field without its value.

type ReleaseWorkflowCapabilityResource added in v0.3.0

type ReleaseWorkflowCapabilityResource struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
	Configured  bool   `json:"configured"`
}

ReleaseWorkflowCapabilityResource is one stable configured-resource choice.

type ReleaseWorkflowCapabilityTracker added in v0.3.0

type ReleaseWorkflowCapabilityTracker struct {
	ID           TrackerID                        `json:"id"`
	DisplayName  string                           `json:"displayName"`
	Configured   bool                             `json:"configured"`
	Default      bool                             `json:"default"`
	Capabilities TrackerCapabilityDescriptor      `json:"capabilities"`
	ConfigFields []ReleaseWorkflowCapabilityField `json:"configFields,omitempty"`
}

ReleaseWorkflowCapabilityTracker is safe tracker catalog/runtime metadata.

type ReleaseWorkflowCommandContext added in v0.3.0

type ReleaseWorkflowCommandContext struct {
	WorkflowID       WorkflowID       `json:"workflowId"`
	ExpectedRevision WorkflowRevision `json:"expectedRevision"`
	IdempotencyKey   string           `json:"idempotencyKey"`
}

ReleaseWorkflowCommandContext binds one user intent to an exact workflow revision.

func (ReleaseWorkflowCommandContext) Validate added in v0.3.0

func (c ReleaseWorkflowCommandContext) Validate() error

Validate rejects commands that are not bound to exact workflow authority.

type ReleaseWorkflowContinuationRecord added in v0.3.0

type ReleaseWorkflowContinuationRecord struct {
	OwnerID    string
	WorkflowID WorkflowID
	Revision   WorkflowRevision
	Payload    []byte
	UpdatedAt  time.Time
}

ReleaseWorkflowContinuationRecord is the latest materialized continuation projection for one exact workflow revision.

type ReleaseWorkflowCurrent added in v0.3.0

type ReleaseWorkflowCurrent struct {
	Workflow               ReleaseWorkflow                       `json:"workflow"`
	FactInstructions       *ReleaseFactInstructionSnapshot       `json:"factInstructions,omitempty"`
	Release                *ReleaseSnapshot                      `json:"release,omitempty"`
	Corrections            *ReleaseCorrectionsSnapshot           `json:"corrections,omitempty"`
	InputReadiness         *InputReadinessSnapshot               `json:"inputReadiness,omitempty"`
	Catalog                *TrackerCatalogSnapshot               `json:"catalog,omitempty"`
	Runtime                *TrackerRuntimeSnapshot               `json:"runtime,omitempty"`
	Selection              *TrackerSelection                     `json:"selection,omitempty"`
	ProjectionInstructions *TrackerProjectionInstructionSnapshot `json:"projectionInstructions,omitempty"`
	Projections            *TrackerReleaseProjectionSet          `json:"projections,omitempty"`
	Preflight              *TrackerPreflightAssessment           `json:"preflight,omitempty"`
	Dupes                  *DupeAssessment                       `json:"dupes,omitempty"`
	TrackerApproval        *TrackerApprovalSnapshot              `json:"trackerApproval,omitempty"`
	Media                  *MediaArtifactSet                     `json:"media,omitempty"`
	HDRComparison          *HDRComparisonSourceRef               `json:"hdrComparison,omitempty"`
	HDRAnalysis            *HDRAnalysisResult                    `json:"hdrAnalysis,omitempty"`
	HDRPendingRequest      *HDRAnalysisInstructions              `json:"hdrPendingRequest,omitempty"`
	AudioAnalysis          *AudioAnalysisResult                  `json:"audioAnalysis,omitempty"`
	Descriptions           *DescriptionSet                       `json:"descriptions,omitempty"`
	DryRun                 *UploadDryRunResult                   `json:"dryRun,omitempty"`
	UploadResult           *UploadResult                         `json:"uploadResult,omitempty"`
	Operation              *WorkflowOperationStatus              `json:"operation,omitempty"`
	Continuation           WorkflowContinuation                  `json:"continuation"`
}

ReleaseWorkflowCurrent is the complete safe current projection returned to every workflow adapter. Private execution resources never appear here.

type ReleaseWorkflowDuplicateDisposition added in v0.3.0

type ReleaseWorkflowDuplicateDisposition string

ReleaseWorkflowDuplicateDisposition controls evidence handling.

const (
	ReleaseWorkflowDuplicateAsk    ReleaseWorkflowDuplicateDisposition = "ask"
	ReleaseWorkflowDuplicateBlock  ReleaseWorkflowDuplicateDisposition = "block"
	ReleaseWorkflowDuplicateUpload ReleaseWorkflowDuplicateDisposition = "upload"
)

type ReleaseWorkflowDurabilityRepository added in v0.3.0

type ReleaseWorkflowDurabilityRepository interface {
	AcceptReleaseWorkflowIntent(context.Context, ReleaseWorkflowIntentRecord) (ReleaseWorkflowIntentRecord, bool, error)
	SaveReleaseWorkflowContinuation(context.Context, ReleaseWorkflowContinuationRecord) error
	AppendReleaseWorkflowEvents(context.Context, string, WorkflowID, []WorkflowEvent) ([]WorkflowEvent, error)
	LoadReleaseWorkflowEvents(context.Context, string, WorkflowID, uint64, int) ([]WorkflowEvent, error)
	BeginReleaseWorkflowEffect(context.Context, ReleaseWorkflowEffectRecord) (ReleaseWorkflowEffectRecord, bool, error)
	CompleteReleaseWorkflowEffect(context.Context, WorkflowEffectStatus, ReleaseWorkflowEffectRecord) error
	MarkReleaseWorkflowOperationEffectsUnknown(context.Context, string, WorkflowID, WorkflowOperationID, time.Time) error
	// RecoverLegacyReleaseWorkflowEffects fences every pre-active-input started
	// effect for one owner-scoped workflow and returns its required manual
	// reconciliation actions. It never creates a submission fence.
	RecoverLegacyReleaseWorkflowEffects(context.Context, string, WorkflowID, time.Time) ([]ReleaseWorkflowEffectRecord, error)
	ListLegacyReleaseWorkflowRecoveryWorkflowIDs(context.Context, string) ([]WorkflowID, error)
	ResolveReleaseWorkflowEffectUnknown(context.Context, string, WorkflowID, WorkflowExternalEffectKind, string, time.Time) error
	LoadReleaseWorkflowWork(context.Context, string, WorkflowID, WorkflowOperationID) (ReleaseWorkflowWorkRecord, error)
	ClaimReleaseWorkflowWork(context.Context, ReleaseWorkflowWorkRecord) error
	RenewReleaseWorkflowWork(context.Context, ReleaseWorkflowWorkRecord) error
	CheckpointReleaseWorkflowWork(context.Context, ReleaseWorkflowWorkRecord) error
	CompleteReleaseWorkflowWork(context.Context, ReleaseWorkflowWorkRecord) error
}

ReleaseWorkflowDurabilityRepository persists accepted intent, immutable events, materialized continuation views, and fenced external attempts.

type ReleaseWorkflowEffectRecord added in v0.3.0

type ReleaseWorkflowEffectRecord struct {
	OwnerID             string
	WorkflowID          WorkflowID
	OperationID         WorkflowOperationID
	EffectID            string
	Kind                string
	ScopeID             string
	SemanticFingerprint WorkflowFingerprint
	Status              WorkflowEffectStatus
	StartedAt           time.Time
	UpdatedAt           time.Time
	CompletedAt         *time.Time
	// Submission binds tracker-submission effects to repository-wide exact
	// content exclusion. It is nil for other external effects.
	Submission *SubmissionFenceAuthority
}

ReleaseWorkflowEffectRecord fences one exact tracker, client, or image-host attempt. It contains only safe identity/fingerprint metadata.

type ReleaseWorkflowIntentRecord added in v0.3.0

type ReleaseWorkflowIntentRecord struct {
	OwnerID            string
	WorkflowID         WorkflowID
	IdempotencyKey     string
	RequestFingerprint WorkflowFingerprint
	Goal               WorkflowGoal
	IntentPayload      []byte
	AcceptedAt         time.Time
}

ReleaseWorkflowIntentRecord is one accepted Continue request. IntentPayload contains the exact application-owned request JSON and must never contain process-local execution authority.

type ReleaseWorkflowOperationRecord added in v0.3.0

type ReleaseWorkflowOperationRecord struct {
	OwnerID            string
	WorkflowID         WorkflowID
	OperationID        WorkflowOperationID
	ExpectedRevision   WorkflowRevision
	IdempotencyKey     string
	CommandFingerprint WorkflowFingerprint
	ProcessEpoch       string
	Status             WorkflowOperationStatus
	// HDRCleanupRelease binds unfinished HDR files to this operation's exact prepared generation.
	// The zero value represents no HDR allocation; this authority is private to the repository.
	HDRCleanupRelease ReleaseRef
}

ReleaseWorkflowOperationRecord binds durable pollable progress to one exact accepted workflow command without embedding progress in aggregate state.

type ReleaseWorkflowOperationRepository added in v0.3.0

type ReleaseWorkflowOperationRepository interface {
	CreateReleaseWorkflowOperation(context.Context, ReleaseWorkflowOperationRecord) (ReleaseWorkflowOperationRecord, bool, error)
	LoadReleaseWorkflowOperation(context.Context, string, WorkflowID, WorkflowOperationID) (ReleaseWorkflowOperationRecord, error)
	LoadReleaseWorkflowOperationByIdempotency(
		context.Context,
		string,
		WorkflowID,
		string,
		string,
	) (ReleaseWorkflowOperationRecord, error)
	LoadLatestReleaseWorkflowOperation(context.Context, string, WorkflowID) (ReleaseWorkflowOperationRecord, error)
	SaveReleaseWorkflowOperation(context.Context, uint64, ReleaseWorkflowOperationRecord) error
	ListActiveReleaseWorkflowOperations(context.Context) ([]ReleaseWorkflowOperationRecord, error)
	// ListInterruptedReleaseWorkflowOperationsWithIncompleteWork returns interrupted
	// operations with an existing unfinished work row for one owner and workflow.
	ListInterruptedReleaseWorkflowOperationsWithIncompleteWork(context.Context, string, WorkflowID) ([]ReleaseWorkflowOperationRecord, error)
	DeleteTerminalReleaseWorkflowOperationsBefore(context.Context, time.Time) (int64, error)
}

ReleaseWorkflowOperationRepository persists operation lifecycle and progress independently from workflow aggregate revisions.

type ReleaseWorkflowOperationRequest added in v0.3.0

type ReleaseWorkflowOperationRequest struct {
	WorkflowID  WorkflowID          `json:"workflowId"`
	OperationID WorkflowOperationID `json:"operationId"`
}

ReleaseWorkflowOperationRequest retrieves or cancels one owner-scoped operation.

func (ReleaseWorkflowOperationRequest) Validate added in v0.3.0

Validate rejects an incomplete workflow-operation ref.

type ReleaseWorkflowPreparedReleaseMode added in v0.3.0

type ReleaseWorkflowPreparedReleaseMode string

ReleaseWorkflowPreparedReleaseMode controls whether cached prepared state may be created.

const (
	ReleaseWorkflowPreparedReleaseAllow   ReleaseWorkflowPreparedReleaseMode = "allow"
	ReleaseWorkflowPreparedReleaseRequire ReleaseWorkflowPreparedReleaseMode = "require"
)

type ReleaseWorkflowStateRecord added in v0.3.0

type ReleaseWorkflowStateRecord struct {
	OwnerID             string
	WorkflowID          WorkflowID
	Revision            WorkflowRevision
	Status              WorkflowStatus
	CreationKey         string
	CreationFingerprint WorkflowFingerprint
	Payload             []byte
	CreatedAt           time.Time
	UpdatedAt           time.Time
	// DescriptionReuse is a pending cache write coupled to a successful state
	// update. It is intentionally excluded from transport and state payload JSON.
	DescriptionReuse *ReusableDescriptionRecord `json:"-"`
}

ReleaseWorkflowStateRecord is one owner-scoped durable public workflow state. Payload is application-owned safe JSON; repository adapters must not interpret or augment it with credentials or process-local authority.

type ReleaseWorkflowStateRepository added in v0.3.0

type ReleaseWorkflowStateRepository interface {
	CreateReleaseWorkflowState(context.Context, ReleaseWorkflowStateRecord) (ReleaseWorkflowStateRecord, bool, error)
	LoadReleaseWorkflowState(context.Context, string, WorkflowID) (ReleaseWorkflowStateRecord, error)
	SaveReleaseWorkflowState(context.Context, WorkflowRevision, ReleaseWorkflowStateRecord) error
	CheckpointReleaseWorkflowResources(context.Context, ReleaseWorkflowStateRecord) error
	DeleteReleaseWorkflowState(context.Context, string, WorkflowID) error
	DeleteTerminalReleaseWorkflowStatesBefore(context.Context, time.Time) (int64, error)
}

ReleaseWorkflowStateRepository persists safe public workflow state with owner scoping, durable create idempotency, and optimistic revision updates.

type ReleaseWorkflowUploadActionIdentity added in v0.3.0

type ReleaseWorkflowUploadActionIdentity struct {
	ID               RequiredActionID `json:"id"`
	WorkflowRevision WorkflowRevision `json:"workflowRevision"`
}

ReleaseWorkflowUploadActionIdentity binds feedback to exact current action authority.

type ReleaseWorkflowUploadApproval deprecated added in v0.3.0

type ReleaseWorkflowUploadApproval struct {
	Confirmed  bool        `json:"confirmed"`
	TrackerIDs []TrackerID `json:"trackerIds,omitempty"`
}

ReleaseWorkflowUploadApproval authorizes an exact subset of the reviewed tracker operations. An omitted tracker list preserves whole-plan approval for non-CLI callers.

Deprecated: final upload approval is no longer emitted by runtime workflows.

type ReleaseWorkflowUploadClient added in v0.3.0

type ReleaseWorkflowUploadClient struct {
	NoSeed            *bool   `json:"noSeed,omitempty"`
	SkipAutoDiscovery *bool   `json:"skipAutoDiscovery,omitempty"`
	Selected          *string `json:"selected,omitempty"`
	QbitTag           *string `json:"qbitTag,omitempty"`
	QbitCategory      *string `json:"qbitCategory,omitempty"`
	ForceRecheck      *bool   `json:"forceRecheck,omitempty"`
}

ReleaseWorkflowUploadClient contains torrent-client choices.

type ReleaseWorkflowUploadClientSearch added in v0.3.0

type ReleaseWorkflowUploadClientSearch struct {
	Skip   *bool   `json:"skip,omitempty"`
	Client *string `json:"client,omitempty"`
}

ReleaseWorkflowUploadClientSearch controls fact-producing client discovery.

type ReleaseWorkflowUploadConfirmation added in v0.3.0

type ReleaseWorkflowUploadConfirmation struct {
	Confirmed bool `json:"confirmed"`
	// contains filtered or unexported fields
}

ReleaseWorkflowUploadConfirmation carries one confirmation-style decision.

func (*ReleaseWorkflowUploadConfirmation) UnmarshalJSON added in v0.3.1

func (c *ReleaseWorkflowUploadConfirmation) UnmarshalJSON(payload []byte) error

UnmarshalJSON preserves whether confirmation was omitted while keeping explicit false distinct for tracker-rule and tracker-preparation decisions.

type ReleaseWorkflowUploadDVDMenus added in v0.3.0

type ReleaseWorkflowUploadDVDMenus struct {
	Capture   *bool    `json:"capture,omitempty"`
	MaxItems  *int     `json:"maxItems,omitempty"`
	MenuPaths []string `json:"menuPaths,omitempty"`
}

ReleaseWorkflowUploadDVDMenus carries automatic and manual DVD-menu intent.

type ReleaseWorkflowUploadDescriptionOverride added in v0.3.0

type ReleaseWorkflowUploadDescriptionOverride struct {
	GroupKey string  `json:"groupKey"`
	Inline   *string `json:"inline,omitempty"`
	File     *string `json:"file,omitempty"`
	URL      *string `json:"url,omitempty"`
}

ReleaseWorkflowUploadDescriptionOverride accepts exactly one content source.

type ReleaseWorkflowUploadDescriptions added in v0.3.0

type ReleaseWorkflowUploadDescriptions struct {
	Overrides       []ReleaseWorkflowUploadDescriptionOverride `json:"overrides,omitempty"`
	TemplateVersion *string                                    `json:"templateVersion,omitempty"`
}

ReleaseWorkflowUploadDescriptions contains typed description override sources.

type ReleaseWorkflowUploadDuplicateReview added in v0.3.0

type ReleaseWorkflowUploadDuplicateReview struct {
	// StaffTokenConfirmed attests staff-token possession for an ignored decision.
	// The surrounding feedback action binds it to the current duplicate assessment.
	StaffTokenConfirmed bool         `json:"staffTokenConfirmed,omitempty"`
	TrackerID           TrackerID    `json:"trackerId,omitempty"`
	Decision            DupeDecision `json:"decision"`
}

ReleaseWorkflowUploadDuplicateReview records an accepted or ignored duplicate decision for the action tracker or an explicitly named tracker.

type ReleaseWorkflowUploadDuplicates added in v0.3.0

type ReleaseWorkflowUploadDuplicates struct {
	RemoteCheck *bool                               `json:"remoteCheck,omitempty"`
	CheckCount  *int                                `json:"checkCount,omitempty"`
	OnEvidence  ReleaseWorkflowDuplicateDisposition `json:"onEvidence,omitempty"`
	AllowUpload []TrackerID                         `json:"allowUpload,omitempty"`
}

ReleaseWorkflowUploadDuplicates controls duplicate checks and evidence defaults.

type ReleaseWorkflowUploadExecution added in v0.3.0

type ReleaseWorkflowUploadExecution struct {
	Mode            ReleaseWorkflowUploadMode          `json:"mode,omitempty"`
	PreparedRelease ReleaseWorkflowPreparedReleaseMode `json:"preparedRelease,omitempty"`
	RunLogLevel     *string                            `json:"runLogLevel,omitempty"`
}

ReleaseWorkflowUploadExecution contains top-level execution choices.

type ReleaseWorkflowUploadExternalIDs added in v0.3.0

type ReleaseWorkflowUploadExternalIDs struct {
	TMDB   *ReleaseWorkflowUploadNumericID `json:"tmdb,omitempty"`
	IMDB   *ReleaseWorkflowUploadStringID  `json:"imdb,omitempty"`
	TVDB   *ReleaseWorkflowUploadNumericID `json:"tvdb,omitempty"`
	TVmaze *ReleaseWorkflowUploadNumericID `json:"tvmaze,omitempty"`
	MAL    *ReleaseWorkflowUploadNumericID `json:"mal,omitempty"`
}

ReleaseWorkflowUploadExternalIDs contains typed provider identifiers.

type ReleaseWorkflowUploadFacts added in v0.3.0

type ReleaseWorkflowUploadFacts struct {
	ExternalIDs  ReleaseWorkflowUploadExternalIDs `json:"externalIds,omitempty"`
	ReleaseName  ReleaseWorkflowUploadReleaseName `json:"releaseName,omitempty"`
	Metadata     ReleaseWorkflowUploadMetadata    `json:"metadata,omitempty"`
	Category     *CanonicalCategory               `json:"category,omitempty"`
	SourceLookup *string                          `json:"sourceLookup,omitempty"`
	Playlist     *ReleaseWorkflowUploadPlaylist   `json:"playlist,omitempty"`
}

ReleaseWorkflowUploadFacts contains fact-producing overrides only.

type ReleaseWorkflowUploadFeedback added in v0.3.0

type ReleaseWorkflowUploadFeedback struct {
	Action         ReleaseWorkflowUploadActionIdentity   `json:"action"`
	Response       ReleaseWorkflowUploadFeedbackResponse `json:"response"`
	IdempotencyKey string                                `json:"-"`
}

ReleaseWorkflowUploadFeedback supplies one required-action response.

func (ReleaseWorkflowUploadFeedback) Validate added in v0.3.0

func (f ReleaseWorkflowUploadFeedback) Validate() error

Validate rejects stale-shaped, ambiguous, or contradictory feedback.

type ReleaseWorkflowUploadFeedbackKind added in v0.3.0

type ReleaseWorkflowUploadFeedbackKind string

ReleaseWorkflowUploadFeedbackKind discriminates one required-action response.

const (
	ReleaseWorkflowUploadFeedbackPlaylistSelection  ReleaseWorkflowUploadFeedbackKind = "playlistSelection"
	ReleaseWorkflowUploadFeedbackMetadataSelection  ReleaseWorkflowUploadFeedbackKind = "metadataSelection"
	ReleaseWorkflowUploadFeedbackRescanConfirmation ReleaseWorkflowUploadFeedbackKind = "rescanConfirmation"
	// Deprecated: tracker authentication must be resolved outside upload workflows.
	ReleaseWorkflowUploadFeedbackTrackerAuthentication ReleaseWorkflowUploadFeedbackKind = "trackerAuthentication"
	// Deprecated: tracker two-factor authentication must be resolved outside upload workflows.
	ReleaseWorkflowUploadFeedbackTwoFactor          ReleaseWorkflowUploadFeedbackKind = "twoFactor"
	ReleaseWorkflowUploadFeedbackTrackerInput       ReleaseWorkflowUploadFeedbackKind = "trackerInput"
	ReleaseWorkflowUploadFeedbackQuestionnaire      ReleaseWorkflowUploadFeedbackKind = "questionnaire"
	ReleaseWorkflowUploadFeedbackRuleAuthorization  ReleaseWorkflowUploadFeedbackKind = "ruleAuthorization"
	ReleaseWorkflowUploadFeedbackTrackerPreparation ReleaseWorkflowUploadFeedbackKind = "trackerPreparation"
	ReleaseWorkflowUploadFeedbackDuplicateReview    ReleaseWorkflowUploadFeedbackKind = "duplicateReview"
	ReleaseWorkflowUploadFeedbackTrackerApproval    ReleaseWorkflowUploadFeedbackKind = "trackerApproval"
	// Deprecated: final upload approval is no longer emitted by runtime workflows.
	ReleaseWorkflowUploadFeedbackUploadApproval ReleaseWorkflowUploadFeedbackKind = "uploadApproval"
	ReleaseWorkflowUploadFeedbackReprepare      ReleaseWorkflowUploadFeedbackKind = "reprepare"
	ReleaseWorkflowUploadFeedbackReconciliation ReleaseWorkflowUploadFeedbackKind = "reconciliation"
)

type ReleaseWorkflowUploadFeedbackResponse added in v0.3.0

type ReleaseWorkflowUploadFeedbackResponse struct {
	Kind                  ReleaseWorkflowUploadFeedbackKind           `json:"kind"`
	PlaylistSelection     *ReleaseWorkflowUploadPlaylistSelection     `json:"playlistSelection,omitempty"`
	MetadataSelection     *ReleaseWorkflowUploadMetadataSelection     `json:"metadataSelection,omitempty"`
	RescanConfirmation    *ReleaseWorkflowUploadConfirmation          `json:"rescanConfirmation,omitempty"`
	TrackerAuthentication *ReleaseWorkflowUploadTrackerAuthentication `json:"trackerAuthentication,omitempty"`
	TwoFactor             *ReleaseWorkflowUploadTwoFactor             `json:"twoFactor,omitempty"`
	TrackerInput          *ReleaseWorkflowUploadTrackerInput          `json:"trackerInput,omitempty"`
	Questionnaire         *ReleaseWorkflowUploadQuestionnaire         `json:"questionnaire,omitempty"`
	RuleAuthorization     *ReleaseWorkflowUploadConfirmation          `json:"ruleAuthorization,omitempty"`
	TrackerPreparation    *ReleaseWorkflowUploadConfirmation          `json:"trackerPreparation,omitempty"`
	DuplicateReview       *ReleaseWorkflowUploadDuplicateReview       `json:"duplicateReview,omitempty"`
	TrackerApproval       *ReleaseWorkflowUploadTrackerApproval       `json:"trackerApproval,omitempty"`
	// Deprecated: retained for v1 decoding compatibility.
	UploadApproval *ReleaseWorkflowUploadApproval       `json:"uploadApproval,omitempty"`
	Reprepare      *ReleaseWorkflowUploadReprepare      `json:"reprepare,omitempty"`
	Reconciliation *ReleaseWorkflowUploadReconciliation `json:"reconciliation,omitempty"`
}

ReleaseWorkflowUploadFeedbackResponse is a strict discriminated response object with exactly one member matching Kind.

type ReleaseWorkflowUploadImageHosting added in v0.3.0

type ReleaseWorkflowUploadImageHosting struct {
	PreferredHost *string `json:"preferredHost,omitempty"`
	SkipUpload    *bool   `json:"skipUpload,omitempty"`
}

ReleaseWorkflowUploadImageHosting contains caller-visible host choices.

type ReleaseWorkflowUploadMedia added in v0.3.0

type ReleaseWorkflowUploadMedia struct {
	Screenshots ReleaseWorkflowUploadScreenshots `json:"screenshots,omitempty"`
	DVDMenus    ReleaseWorkflowUploadDVDMenus    `json:"dvdMenus,omitempty"`
}

ReleaseWorkflowUploadMedia groups screenshot and DVD-menu choices.

type ReleaseWorkflowUploadMetadata added in v0.3.0

type ReleaseWorkflowUploadMetadata struct {
	Distributor      *string `json:"distributor,omitempty"`
	OriginalLanguage *string `json:"originalLanguage,omitempty"`
	PersonalRelease  *bool   `json:"personalRelease,omitempty"`
	Commentary       *bool   `json:"commentary,omitempty"`
	WebDV            *bool   `json:"webDv,omitempty"`
	StreamOptimized  *bool   `json:"streamOptimized,omitempty"`
	Anime            *bool   `json:"anime,omitempty"`
}

ReleaseWorkflowUploadMetadata contains presence-aware metadata overrides.

type ReleaseWorkflowUploadMetadataSelection added in v0.3.0

type ReleaseWorkflowUploadMetadataSelection struct {
	SelectedValues []string                    `json:"selectedValues,omitempty"`
	Facts          *ReleaseWorkflowUploadFacts `json:"facts,omitempty"`
}

ReleaseWorkflowUploadMetadataSelection chooses one retained metadata candidate or supplies replacement preparation facts.

type ReleaseWorkflowUploadMode added in v0.3.0

type ReleaseWorkflowUploadMode string

ReleaseWorkflowUploadMode selects tracker execution or the debug/site-check path.

const (
	ReleaseWorkflowUploadModeUpload ReleaseWorkflowUploadMode = "upload"
	ReleaseWorkflowUploadModeDebug  ReleaseWorkflowUploadMode = "debug"
)

type ReleaseWorkflowUploadNumericID added in v0.3.0

type ReleaseWorkflowUploadNumericID struct {
	Value *int `json:"value"`
}

ReleaseWorkflowUploadNumericID preserves explicit zero as an instruction.

type ReleaseWorkflowUploadPlaylist added in v0.3.0

type ReleaseWorkflowUploadPlaylist struct {
	Selected []string `json:"selected"`
	UseAll   bool     `json:"useAll,omitempty"`
}

ReleaseWorkflowUploadPlaylist preserves explicit empty selection.

type ReleaseWorkflowUploadPlaylistSelection added in v0.3.0

type ReleaseWorkflowUploadPlaylistSelection struct {
	Selected []string `json:"selected"`
	UseAll   bool     `json:"useAll,omitempty"`
}

ReleaseWorkflowUploadPlaylistSelection replaces retained playlist selection.

type ReleaseWorkflowUploadPolicy added in v0.3.0

type ReleaseWorkflowUploadPolicy struct {
	KeepFolder *bool `json:"keepFolder,omitempty"`
	KeepImages *bool `json:"keepImages,omitempty"`
	OnlyID     *bool `json:"onlyId,omitempty"`
}

ReleaseWorkflowUploadPolicy controls canonical preparation compatibility.

type ReleaseWorkflowUploadPreparation added in v0.3.0

type ReleaseWorkflowUploadPreparation struct {
	Facts         ReleaseWorkflowUploadFacts        `json:"facts,omitempty"`
	Policy        ReleaseWorkflowUploadPolicy       `json:"policy,omitempty"`
	ClientSearch  ReleaseWorkflowUploadClientSearch `json:"clientSearch,omitempty"`
	Force         bool                              `json:"force,omitempty"`
	ConfirmRescan bool                              `json:"confirmRescan,omitempty"`
}

ReleaseWorkflowUploadPreparation contains canonical preparation intent.

type ReleaseWorkflowUploadQuestionnaire added in v0.3.0

type ReleaseWorkflowUploadQuestionnaire struct {
	TrackerID TrackerID          `json:"trackerId"`
	Answers   map[string]*string `json:"answers"`
}

ReleaseWorkflowUploadQuestionnaire supplies questionnaire answers for one tracker.

type ReleaseWorkflowUploadReconciliation added in v0.3.0

type ReleaseWorkflowUploadReconciliation struct {
	Selection string `json:"selection"`
}

ReleaseWorkflowUploadReconciliation confirms that an uncertain external effect did not complete.

type ReleaseWorkflowUploadReleaseName added in v0.3.0

type ReleaseWorkflowUploadReleaseName struct {
	ThreeD           *bool   `json:"threeD,omitempty"`
	Category         *string `json:"category,omitempty"`
	Type             *string `json:"type,omitempty"`
	Source           *string `json:"source,omitempty"`
	Resolution       *string `json:"resolution,omitempty"`
	Tag              *string `json:"tag,omitempty"`
	Service          *string `json:"service,omitempty"`
	Edition          *string `json:"edition,omitempty"`
	Repack           *string `json:"repack,omitempty"`
	Season           *string `json:"season,omitempty"`
	Episode          *string `json:"episode,omitempty"`
	EpisodeTitle     *string `json:"episodeTitle,omitempty"`
	ManualYear       *int    `json:"manualYear,omitempty"`
	Daily            *string `json:"daily,omitempty"`
	UseSeasonEpisode *bool   `json:"useSeasonEpisode,omitempty"`
	NoSeason         *bool   `json:"noSeason,omitempty"`
	NoYear           *bool   `json:"noYear,omitempty"`
	NoAKA            *bool   `json:"noAka,omitempty"`
	NoTag            *bool   `json:"noTag,omitempty"`
	NoEpisodeTitle   *bool   `json:"noEpisodeTitle,omitempty"`
	NoDistributor    *bool   `json:"noDistributor,omitempty"`
	NoEdition        *bool   `json:"noEdition,omitempty"`
	NoDub            *bool   `json:"noDub,omitempty"`
	NoDual           *bool   `json:"noDual,omitempty"`
	DualAudio        *bool   `json:"dualAudio,omitempty"`
	Region           *string `json:"region,omitempty"`
}

ReleaseWorkflowUploadReleaseName contains presence-aware naming overrides.

type ReleaseWorkflowUploadReprepare added in v0.3.0

type ReleaseWorkflowUploadReprepare struct {
	Confirmed   bool                              `json:"confirmed"`
	Preparation *ReleaseWorkflowUploadPreparation `json:"preparation,omitempty"`
}

ReleaseWorkflowUploadReprepare confirms forced preparation and may replace its preparation input.

type ReleaseWorkflowUploadScreenshots added in v0.3.0

type ReleaseWorkflowUploadScreenshots struct {
	Count *int `json:"count,omitempty"`
	// CountIsDefault allows tracker policy to replace automatic capture with
	// imported references. Omitted and false retain explicit-count semantics.
	CountIsDefault         bool               `json:"countIsDefault,omitempty"`
	Frames                 []int              `json:"frames,omitempty"`
	ComparisonPaths        []string           `json:"comparisonPaths,omitempty"`
	ComparisonPrimaryIndex *int               `json:"comparisonPrimaryIndex,omitempty"`
	ArtifactIDs            []PublicResourceID `json:"artifactIds,omitempty"`
}

ReleaseWorkflowUploadScreenshots carries capture, manual, comparison, and selection intent.

type ReleaseWorkflowUploadSource added in v0.3.0

type ReleaseWorkflowUploadSource struct {
	Path string `json:"path"`
}

ReleaseWorkflowUploadSource names one server-local source.

type ReleaseWorkflowUploadStringID added in v0.3.0

type ReleaseWorkflowUploadStringID struct {
	Value *string `json:"value"`
}

ReleaseWorkflowUploadStringID preserves explicit empty string as an instruction.

type ReleaseWorkflowUploadTIKOptions added in v0.3.0

type ReleaseWorkflowUploadTIKOptions struct {
	Foreign  *bool   `json:"foreign,omitempty"`
	Opera    *bool   `json:"opera,omitempty"`
	Asian    *bool   `json:"asian,omitempty"`
	DiscType *string `json:"discType,omitempty"`
}

ReleaseWorkflowUploadTIKOptions carries TIK-specific typed options.

type ReleaseWorkflowUploadTorrent added in v0.3.0

type ReleaseWorkflowUploadTorrent struct {
	InfoHash        *string `json:"infoHash,omitempty"`
	MaxPieceSizeMiB *int    `json:"maxPieceSizeMiB,omitempty"`
	NoHash          *bool   `json:"noHash,omitempty"`
	Rehash          *bool   `json:"rehash,omitempty"`
}

ReleaseWorkflowUploadTorrent contains torrent construction choices.

type ReleaseWorkflowUploadTrackerApproval added in v0.3.0

type ReleaseWorkflowUploadTrackerApproval struct {
	Confirmed  bool        `json:"confirmed"`
	TrackerIDs []TrackerID `json:"trackerIds"`
}

ReleaseWorkflowUploadTrackerApproval authorizes an explicit post-dupe tracker subset.

type ReleaseWorkflowUploadTrackerAuthentication deprecated added in v0.3.0

type ReleaseWorkflowUploadTrackerAuthentication struct {
	TrackerID TrackerID `json:"trackerId"`
}

ReleaseWorkflowUploadTrackerAuthentication is retained for v1 decoding compatibility.

Deprecated: tracker authentication must be resolved outside upload workflows.

type ReleaseWorkflowUploadTrackerConfig added in v0.3.0

type ReleaseWorkflowUploadTrackerConfig struct {
	Anon    *bool   `json:"anon,omitempty"`
	Draft   *bool   `json:"draft,omitempty"`
	ModQ    *bool   `json:"modq,omitempty"`
	Channel *string `json:"channel,omitempty"`
}

ReleaseWorkflowUploadTrackerConfig carries optional per-upload tracker configuration.

type ReleaseWorkflowUploadTrackerInput added in v0.3.0

type ReleaseWorkflowUploadTrackerInput struct {
	TrackerID  TrackerID                              `json:"trackerId"`
	Projection ReleaseWorkflowUploadTrackerProjection `json:"projection"`
}

ReleaseWorkflowUploadTrackerInput replaces projection input for one tracker.

type ReleaseWorkflowUploadTrackerProjection added in v0.3.0

type ReleaseWorkflowUploadTrackerProjection struct {
	UploadReleaseName WorkflowPatch[string]              `json:"uploadReleaseName,omitempty"`
	AdditionalNames   map[string]*string                 `json:"additionalNames,omitempty"`
	Questionnaire     map[string]*string                 `json:"questionnaire,omitempty"`
	Config            ReleaseWorkflowUploadTrackerConfig `json:"config,omitempty"`
	Site              ReleaseWorkflowUploadTrackerSite   `json:"site,omitempty"`
}

ReleaseWorkflowUploadTrackerProjection contains transport-neutral tracker-local input.

type ReleaseWorkflowUploadTrackerSite added in v0.3.0

type ReleaseWorkflowUploadTrackerSite struct {
	TIK ReleaseWorkflowUploadTIKOptions `json:"tik,omitempty"`
}

ReleaseWorkflowUploadTrackerSite carries typed tracker-site options.

type ReleaseWorkflowUploadTrackers added in v0.3.0

type ReleaseWorkflowUploadTrackers struct {
	Include           []TrackerID                                          `json:"include,omitempty"`
	Remove            []TrackerID                                          `json:"remove,omitempty"`
	SourceIDs         map[TrackerID]string                                 `json:"sourceIds,omitempty"`
	DefaultProjection *ReleaseWorkflowUploadTrackerProjection              `json:"defaultProjection,omitempty"`
	Projection        map[TrackerID]ReleaseWorkflowUploadTrackerProjection `json:"projection,omitempty"`
}

ReleaseWorkflowUploadTrackers contains normalized tracker selection and projection intent. An empty Include list selects the server's configured default trackers.

type ReleaseWorkflowUploadTwoFactor deprecated added in v0.3.0

type ReleaseWorkflowUploadTwoFactor struct {
	TrackerID   TrackerID `json:"trackerId"`
	ChallengeID string    `json:"challengeId"`
	Code        string    `json:"code"`
}

ReleaseWorkflowUploadTwoFactor is retained for v1 decoding compatibility.

Deprecated: tracker two-factor authentication must be resolved outside upload workflows.

type ReleaseWorkflowUploadUnattended added in v0.3.0

type ReleaseWorkflowUploadUnattended struct {
	Confirm bool `json:"confirm,omitempty"`
}

ReleaseWorkflowUploadUnattended selects strict unattended when Confirm is false or retained required-action feedback when Confirm is true.

type ReleaseWorkflowWorkRecord added in v0.3.0

type ReleaseWorkflowWorkRecord struct {
	OwnerID        string
	WorkflowID     WorkflowID
	OperationID    WorkflowOperationID
	LeaseOwner     string
	LeaseExpiresAt time.Time
	Checkpoint     []byte
	UpdatedAt      time.Time
	CompletedAt    *time.Time
}

ReleaseWorkflowWorkRecord is one durable operation lease and latest checkpoint. Checkpoint payload contains only safe operation state.

type RemoveReleaseWorkflowHostedImagesRequest added in v0.3.0

type RemoveReleaseWorkflowHostedImagesRequest struct {
	ReleaseWorkflowCommandContext
	Media       MediaArtifactSetRef `json:"media"`
	ArtifactIDs []PublicResourceID  `json:"artifactIds"`
}

RemoveReleaseWorkflowHostedImagesRequest removes hosted outcomes by opaque ID.

func (RemoveReleaseWorkflowHostedImagesRequest) Validate added in v0.3.0

Validate verifies exact media and hosted artifact refs.

type RenderedDescription added in v0.3.0

type RenderedDescription struct {
	GroupKey           string              `json:"groupKey"`
	TrackerIDs         []TrackerID         `json:"trackerIds"`
	Source             string              `json:"source"`
	Rendered           string              `json:"rendered"`
	ImagePreviews      map[string]string   `json:"imagePreviews,omitempty"`
	ContentFingerprint WorkflowFingerprint `json:"contentFingerprint"`
}

RenderedDescription contains one retained description group projection.

type ReorderReleaseWorkflowMediaRequest added in v0.3.0

type ReorderReleaseWorkflowMediaRequest struct {
	ReleaseWorkflowCommandContext
	Media       MediaArtifactSetRef `json:"media"`
	ArtifactIDs []PublicResourceID  `json:"artifactIds"`
}

ReorderReleaseWorkflowMediaRequest establishes exact artifact order.

func (ReorderReleaseWorkflowMediaRequest) Validate added in v0.3.0

Validate verifies exact revision authority and ordered opaque media refs.

type ReplaceReleaseWorkflowFactsRequest added in v0.3.0

type ReplaceReleaseWorkflowFactsRequest struct {
	ReleaseWorkflowCommandContext
	Instructions ReleaseFactInstructions `json:"instructions"`
}

ReplaceReleaseWorkflowFactsRequest replaces fact instructions and invalidates dependent state.

func (ReplaceReleaseWorkflowFactsRequest) Validate added in v0.3.0

Validate verifies exact revision authority.

type RepositoryCapabilities added in v0.3.0

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

RepositoryCapabilities is an immutable set of borrowed persistence capabilities. Construct it from one adapter so production capabilities share connection, retry, transaction, and lifecycle ownership.

func NewRepositoryCapabilities added in v0.3.0

func NewRepositoryCapabilities(adapter any) (RepositoryCapabilities, error)

NewRepositoryCapabilities constructs and validates borrowed capabilities projected from one adapter.

func RepositoryCapabilitiesFrom added in v0.3.0

func RepositoryCapabilitiesFrom(adapter any) RepositoryCapabilities

RepositoryCapabilitiesFrom projects one adapter onto every repository seam. Call RepositoryCapabilities.Validate before installing the result.

func (RepositoryCapabilities) DescriptionReuse added in v0.3.5

DescriptionReuse returns the optional durable description-reuse capability.

func (RepositoryCapabilities) History added in v0.3.0

History returns the borrowed history capability.

func (RepositoryCapabilities) IsZero added in v0.3.0

func (c RepositoryCapabilities) IsZero() bool

IsZero reports whether no repository capabilities were supplied.

func (RepositoryCapabilities) Media added in v0.3.0

Media returns the borrowed media-asset capability.

func (RepositoryCapabilities) MediaReuse added in v0.3.5

MediaReuse returns the optional durable media-reuse capability.

func (RepositoryCapabilities) MetadataEvidence added in v0.4.0

MetadataEvidence returns the borrowed source-scoped lookup-evidence capability.

func (RepositoryCapabilities) Prepared added in v0.3.0

Prepared returns the borrowed whole-generation prepared-release capability.

func (RepositoryCapabilities) ReleaseState added in v0.3.0

ReleaseState returns the borrowed release-state capability.

func (RepositoryCapabilities) Selections added in v0.3.0

Selections returns the borrowed release-selection capability.

func (RepositoryCapabilities) Trackers added in v0.3.0

Trackers returns the borrowed tracker-state capability.

func (RepositoryCapabilities) Uploads added in v0.3.0

Uploads returns the borrowed upload-ledger capability.

func (RepositoryCapabilities) Validate added in v0.3.0

func (c RepositoryCapabilities) Validate() error

Validate rejects missing and typed-nil capabilities before runtime use.

func (RepositoryCapabilities) Workflows added in v0.3.0

Workflows returns the borrowed durable public workflow-state capability.

type RepositoryOwner added in v0.3.0

type RepositoryOwner interface {
	Close() error
}

RepositoryOwner owns repository lifecycle separately from borrowed capabilities. Core never closes an externally supplied owner.

type Request

type Request struct {
	SourcePath                  string
	Options                     UploadOptions
	Execution                   ExecutionOptions
	DescriptionGroups           []DescriptionBuilderGroup
	Trackers                    []string
	TrackersRemove              []string
	IgnoreDupesFor              []string
	SkipDupeCheck               bool
	SkipDupeAsActual            bool
	DoubleDupeCheck             bool
	SourceLookupURL             string
	DescriptionOverrideRaw      string
	DescriptionOverrideURL      string
	DescriptionOverrideGroup    string
	MetadataOverrides           MetadataOverrides
	TrackerConfigOverrides      TrackerConfigOverrides
	TrackerSiteOverrides        TrackerSiteOverrides
	ClientOverrides             ClientOverrides
	ImageHostOverrides          ImageHostOverrides
	ScreenshotOverrides         ScreenshotOverrides
	TorrentOverrides            TorrentOverrides
	TrackerIDOverrides          map[string]string
	ExternalIDOverrides         ExternalIDOverrides
	ReleaseNameOverrides        ReleaseNameOverrides
	TrackerQuestionnaireAnswers map[string]map[string]string // keyed by tracker, then questionnaire field key
	PlaylistInstruction         PlaylistInstruction
	ConfirmBDMVRescan           bool
}

Request carries one core operation across CLI and WebUI.

type RequiredAction added in v0.3.0

type RequiredAction struct {
	CorrectionConfirmation *CorrectionConfirmation    `json:"correctionConfirmation,omitempty"`
	ID                     RequiredActionID           `json:"id"`
	Kind                   RequiredActionKind         `json:"kind"`
	Status                 RequiredActionStatus       `json:"status"`
	WorkflowRevision       WorkflowRevision           `json:"workflowRevision"`
	TrackerID              TrackerID                  `json:"trackerId,omitempty"`
	EffectKind             WorkflowExternalEffectKind `json:"effectKind,omitempty"`
	EffectScopeID          string                     `json:"effectScopeId,omitempty"`
	Prompt                 string                     `json:"prompt"`
	Options                []RequiredActionOption     `json:"options,omitempty"`
	AllowsFreeText         bool                       `json:"allowsFreeText,omitempty"`
	CreatedAt              time.Time                  `json:"createdAt" ts_type:"string"`
	ExpiresAt              *time.Time                 `json:"expiresAt,omitempty" ts_type:"string"`
}

RequiredAction is a transport-safe backend-defined manual action.

type RequiredActionAnswer added in v0.3.0

type RequiredActionAnswer struct {
	ActionID         RequiredActionID `json:"actionId"`
	WorkflowRevision WorkflowRevision `json:"workflowRevision"`
	SelectedValues   []string         `json:"selectedValues,omitempty"`
	TextValue        *string          `json:"textValue,omitempty"`
	Confirmed        *bool            `json:"confirmed,omitempty"`
}

RequiredActionAnswer submits one action answer against an exact workflow revision.

type RequiredActionID added in v0.3.0

type RequiredActionID string

RequiredActionID identifies one typed action required to advance a workflow.

type RequiredActionKind added in v0.3.0

type RequiredActionKind string

RequiredActionKind classifies backend-defined manual work.

const (
	// RequiredActionSelectPlaylist requests a disc playlist choice.
	RequiredActionSelectPlaylist RequiredActionKind = "select_playlist"
	// RequiredActionSelectMetadata requests a metadata candidate choice.
	RequiredActionSelectMetadata RequiredActionKind = "select_metadata"
	// RequiredActionConfirmRescan requests permission for a destructive cache refresh.
	RequiredActionConfirmRescan RequiredActionKind = "confirm_rescan"
	// RequiredActionAuthenticateTracker is retained for v1 decoding compatibility.
	//
	// Deprecated: upload workflows no longer emit tracker-authentication actions.
	RequiredActionAuthenticateTracker RequiredActionKind = "authenticate_tracker"
	// RequiredActionProvideTwoFactor is retained for v1 decoding compatibility.
	//
	// Deprecated: upload workflows no longer emit tracker two-factor actions.
	RequiredActionProvideTwoFactor RequiredActionKind = "provide_two_factor"
	// RequiredActionProvideTrackerInput requests tracker-specific projection input.
	RequiredActionProvideTrackerInput RequiredActionKind = "provide_tracker_input"
	// RequiredActionAnswerQuestionnaire requests tracker questionnaire answers.
	RequiredActionAnswerQuestionnaire RequiredActionKind = "answer_questionnaire"
	// RequiredActionConfirmCorrections requests confirmation of stale saved input corrections.
	RequiredActionConfirmCorrections RequiredActionKind = "confirm_corrections"
	// RequiredActionAuthorizeRules requests acknowledgement of waivable rules.
	RequiredActionAuthorizeRules RequiredActionKind = "authorize_rules"
	// RequiredActionResolveTrackerPreparation requests a decision about one prepared tracker payload.
	RequiredActionResolveTrackerPreparation RequiredActionKind = "resolve_tracker_preparation"
	// RequiredActionReviewDuplicates requests duplicate acceptance or rejection.
	RequiredActionReviewDuplicates RequiredActionKind = "review_duplicates"
	// RequiredActionApproveTrackers requests one exact post-dupe tracker subset.
	RequiredActionApproveTrackers RequiredActionKind = "approve_trackers"
	// RequiredActionApproveUpload requests approval of the retained upload plan.
	//
	// Deprecated: upload approval is no longer emitted by runtime workflows.
	RequiredActionApproveUpload RequiredActionKind = "approve_upload"
	// RequiredActionReprepare requests a fresh generation after invalidation or restart.
	RequiredActionReprepare RequiredActionKind = "reprepare"
	// RequiredActionReconcileSubmission requests manual verification of an uncertain external submission.
	RequiredActionReconcileSubmission RequiredActionKind = "reconcile_submission"
)

type RequiredActionOption added in v0.3.0

type RequiredActionOption struct {
	Value string `json:"value"`
	Label string `json:"label"`
	// Playlist carries detached display details when the option selects a Blu-ray playlist.
	Playlist *PlaylistInfo `json:"playlist,omitempty"`
}

RequiredActionOption is one non-secret selectable action value.

type RequiredActionStatus added in v0.3.0

type RequiredActionStatus string

RequiredActionStatus records whether a typed action still needs an answer.

const (
	// RequiredActionStatusPending means no accepted answer exists.
	RequiredActionStatusPending RequiredActionStatus = "pending"
	// RequiredActionStatusResolved means an answer was accepted.
	RequiredActionStatusResolved RequiredActionStatus = "resolved"
	// RequiredActionStatusExpired means its expected workflow revision is stale.
	RequiredActionStatusExpired RequiredActionStatus = "expired"
)

type RequirementKind added in v0.3.0

type RequirementKind string

RequirementKind identifies a canonical prerequisite required by an operation.

const (
	// RequirementKindProviderID identifies a missing provider ID.
	RequirementKindProviderID RequirementKind = "provider_id"
	// RequirementKindCategory identifies a missing canonical category.
	RequirementKindCategory RequirementKind = "category"
)

type ResetReleaseWorkflowDescriptionOverrideRequest added in v0.3.0

type ResetReleaseWorkflowDescriptionOverrideRequest struct {
	ReleaseWorkflowCommandContext
	Descriptions DescriptionSetRef `json:"descriptions"`
	GroupKey     string            `json:"groupKey"`
}

ResetReleaseWorkflowDescriptionOverrideRequest resets one exact description group.

func (ResetReleaseWorkflowDescriptionOverrideRequest) Validate added in v0.3.0

Validate verifies exact description lineage and one non-empty group key.

type ResetReleaseWorkflowRequest added in v0.3.0

type ResetReleaseWorkflowRequest struct {
	ReleaseWorkflowCommandContext
	Input PrepareInput `json:"input"`
}

ResetReleaseWorkflowRequest explicitly resets fact instructions and re-prepares.

func (ResetReleaseWorkflowRequest) Validate added in v0.3.0

func (r ResetReleaseWorkflowRequest) Validate() error

Validate verifies authority and required reset source.

type ResolveReleaseWorkflowActionRequest added in v0.3.0

type ResolveReleaseWorkflowActionRequest struct {
	ReleaseWorkflowCommandContext
	Answer RequiredActionAnswer `json:"answer"`
}

ResolveReleaseWorkflowActionRequest resolves one retained required action.

func (ResolveReleaseWorkflowActionRequest) Validate added in v0.3.0

Validate verifies exact revision authority and action lineage.

type ResolvedPreparationInput added in v0.3.2

type ResolvedPreparationInput struct {
	Input             PrepareInput
	Corrections       ReleaseCorrectionsSnapshot
	SourceFingerprint string
	// ExplicitFields identifies values supplied for this preparation, whose
	// content bindings may be finalized after provider discovery.
	ExplicitFields []CorrectionFieldRef
}

ResolvedPreparationInput carries accepted source corrections between internal preparation owners. It is never accepted as a transport request.

type Result

type Result struct {
	UploadedCount int
}

Result summarizes a completed core upload run.

type RetryReleaseWorkflowClientInjectionRequest added in v0.3.0

type RetryReleaseWorkflowClientInjectionRequest struct {
	ReleaseWorkflowCommandContext
	Retry ClientInjectionRetryRef `json:"retry"`
}

RetryReleaseWorkflowClientInjectionRequest retries only failed client injection effects from an exact prior upload result.

func (RetryReleaseWorkflowClientInjectionRequest) Validate added in v0.3.0

Validate verifies exact workflow authority and explicit client-effect targets.

type RetryReleaseWorkflowImageHostRequest added in v0.3.0

type RetryReleaseWorkflowImageHostRequest struct {
	ReleaseWorkflowCommandContext
	Media       MediaArtifactSetRef `json:"media"`
	ArtifactIDs []PublicResourceID  `json:"artifactIds"`
	Host        string              `json:"host"`
}

RetryReleaseWorkflowImageHostRequest explicitly retries one prior failed host.

func (RetryReleaseWorkflowImageHostRequest) Validate added in v0.3.0

Validate verifies exact media and explicit host retry intent.

type RetryReleaseWorkflowUploadRequest added in v0.3.0

type RetryReleaseWorkflowUploadRequest struct {
	ReleaseWorkflowCommandContext
	Retry  FailedTrackerRetryRef `json:"retry"`
	NoSeed bool                  `json:"noSeed"`
}

RetryReleaseWorkflowUploadRequest retries failed trackers from an exact prior result.

func (RetryReleaseWorkflowUploadRequest) Validate added in v0.3.0

Validate verifies exact workflow authority and explicit failed-tracker targets.

type ReusableDescription added in v0.3.5

type ReusableDescription struct {
	// RendererVersion identifies the generated output format; empty records predate versioning.
	RendererVersion          string                     `json:"rendererVersion,omitempty"`
	CompatibilityFingerprint WorkflowFingerprint        `json:"compatibilityFingerprint"`
	Descriptions             []RenderedDescription      `json:"descriptions"`
	TrackerResults           []DescriptionTrackerResult `json:"trackerResults,omitempty"`
	Overrides                []DescriptionOverrideInput `json:"overrides,omitempty"`
}

ReusableDescription is the safe, source-scoped description output that can be materialized into a later workflow. It deliberately excludes runtime configuration, credentials, and generation instructions.

func (ReusableDescription) Valid added in v0.3.5

func (r ReusableDescription) Valid() bool

Valid reports whether the record contains reusable public output and explicit description text overrides. It validates fingerprints, group/tracker uniqueness, and terminal tracker outcomes; it does not sanitize text or recompute content fingerprints.

type ReusableDescriptionRecord added in v0.3.5

type ReusableDescriptionRecord struct {
	SourcePath  string
	Description ReusableDescription
}

ReusableDescriptionRecord binds safe reusable description output to its canonical source. It is an internal persistence handoff, never workflow transport state.

func (ReusableDescriptionRecord) Clone added in v0.3.5

Clone returns a detached reusable-description record.

func (ReusableDescriptionRecord) Valid added in v0.3.5

func (r ReusableDescriptionRecord) Valid() bool

Valid reports whether the record names a source and contains reusable safe description output. This checks structure, not compatibility with a later workflow.

type ReusableMediaAsset added in v0.3.5

type ReusableMediaAsset struct {
	Binding            PreparedMediaBinding
	CompatibilityKey   MediaCompatibilityKey
	CaptureFingerprint WorkflowFingerprint
	ContentSHA256      string
	Kind               MediaArtifactKind
	Image              ScreenshotImage
	// Imported identifies an image restored from tracker metadata rather than captured locally.
	Imported    bool
	Selected    bool
	Order       int
	HostedLinks []UploadedImageLink
}

ReusableMediaAsset is one private image retained for a strong source and capture compatibility claim. Its binding is the old exact generation; a caller must materialize fresh workflow artifact references before use.

func (ReusableMediaAsset) Valid added in v0.3.5

func (a ReusableMediaAsset) Valid() bool

Valid reports whether the asset is independently reusable. Legacy records without a strong source key, capture claim, or content digest are rejected.

type ReusableMediaCommit added in v0.3.5

type ReusableMediaCommit struct {
	WorkflowID WorkflowID
	MediaID    MediaArtifactSetID
	Revision   WorkflowRevision
}

ReusableMediaCommit identifies one final workflow media snapshot whose reusable associations were persisted successfully.

func (ReusableMediaCommit) Valid added in v0.3.5

func (c ReusableMediaCommit) Valid() bool

Valid reports whether the commit can identify one immutable media snapshot.

type RuleDisposition added in v0.3.0

type RuleDisposition string

RuleDisposition identifies how a failed tracker rule affects live upload.

const (
	// RuleDispositionAdvisory reports guidance without blocking live upload.
	RuleDispositionAdvisory RuleDisposition = "advisory"
	// RuleDispositionWaivable requires exact user authorization before live upload.
	RuleDispositionWaivable RuleDisposition = "waivable"
	// RuleDispositionStrict blocks live upload and cannot be authorized.
	RuleDispositionStrict RuleDisposition = "strict"
)

func NormalizeRuleDisposition added in v0.3.0

func NormalizeRuleDisposition(disposition RuleDisposition) RuleDisposition

NormalizeRuleDisposition maps legacy persisted values and fails closed for unknown values. Empty and legacy blocking results remain user-waivable; unknown non-empty values become strict.

type RuleFailure

type RuleFailure struct {
	// LanguageCorrectionTrackIDs identifies inspected tracks whose unknown
	// languages are needed by this exact predicate, including resource scope.
	LanguageCorrectionTrackIDs []string `json:"languageCorrectionTrackIds,omitempty"`
	// AudioOriginCorrectionTrackIDs identifies source-level soundtrack classification review.
	AudioOriginCorrectionTrackIDs []string `json:"audioOriginCorrectionTrackIds,omitempty"`
	// QuestionnaireInput identifies a missing or invalid tracker answer.
	// Execution remains blocked while the corrective questionnaire stays available.
	QuestionnaireInput bool `json:"questionnaireInput,omitempty"`
	// DebugBypass retains an explicit tracker eligibility bypass for non-submitting debug execution.
	DebugBypass bool `json:"debugBypass,omitempty"`
	// EvidenceFingerprint invalidates acknowledgement when supporting evidence changes.
	EvidenceFingerprint WorkflowFingerprint `json:"evidenceFingerprint,omitempty"`
	Rule                string
	Reason              string
	Disposition         RuleDisposition
	// EvidenceStatus describes the completeness of the facts supporting this
	// result; an empty value denotes a legacy result.
	EvidenceStatus MetadataEvidenceStatus `json:"evidenceStatus,omitempty"`
}

RuleFailure describes one stable tracker-rule result.

func AdvisoryRuleFailures added in v0.3.0

func AdvisoryRuleFailures(failures []RuleFailure) []RuleFailure

AdvisoryRuleFailures returns an independent slice containing only advisory results.

func BlockingRuleFailures added in v0.2.5

func BlockingRuleFailures(failures []RuleFailure) []RuleFailure

BlockingRuleFailures returns an independent slice containing only blocking results. Legacy and unrecognized dispositions are included.

type RuleSubject added in v0.3.0

type RuleSubject struct {
	MediaFileFacts             MediaFileFacts
	TitleSearchEvidence        TrackerTitleSearchEvidence
	LanguageFacts              LanguageFacts
	EffectiveMetadata          EffectiveMetadata
	ManualLanguages            ManualLanguageFacts
	HardcodedSubs              bool
	HardcodedSubtitleLanguages []string
	HardcodedSubtitleCoverage  []SubtitleLanguageCoverage
	SourcePath                 string
	VideoPath                  string
	FileList                   []string
	DiscType                   string
	Scene                      bool
	SceneNFOPath               string
	SceneRenamed               bool
	SceneRenamedReason         string
	PersonalRelease            bool
	Release                    ReleaseInfo
	ReleaseName                string
	ReleaseNameNoTag           string
	Tag                        string
	Identity                   ExternalIdentity
	ProviderMetadata           SourceScopedMetadata
	AudioLanguages             []string
	SubtitleLanguages          []string
	TVPack                     bool
	Type                       string
	Source                     string
	Container                  string
	BitDepth                   string
	VideoCodec                 string
	VideoEncode                string
	HDR                        string
	Region                     string
	WebDV                      bool
	Anime                      bool
	Assessments                ReleaseAssessments
	DescriptionOverride        string
	Disc                       DiscFacts
	MediaInfoJSONReady         bool
	MediaInfoTextReady         bool
	DVDVOBMediaInfoReady       bool
}

RuleSubject contains only stable facts used by generic and tracker-specific eligibility rules.

func NewRuleSubject added in v0.3.0

func NewRuleSubject(subject UploadSubject) RuleSubject

NewRuleSubject projects upload facts into the rule evaluator's read model.

type SaveReleaseWorkflowDescriptionOverrideRequest added in v0.3.0

type SaveReleaseWorkflowDescriptionOverrideRequest struct {
	ReleaseWorkflowCommandContext
	Override DescriptionOverrideMutation `json:"override"`
}

SaveReleaseWorkflowDescriptionOverrideRequest saves one exact description group.

func (SaveReleaseWorkflowDescriptionOverrideRequest) Validate added in v0.3.0

Validate verifies exact description lineage and one non-empty group key.

type Screenshot

type Screenshot struct {
	// Tonemapping records actual processing; empty means unknown. ContentSHA256 binds it to image bytes.
	Tonemapping              ScreenshotTonemapping `json:",omitempty"`
	ContentSHA256            string                `json:",omitempty"`
	SourcePath               string
	PreparedMediaFingerprint string
	PreparedGeneration       PreparedGeneration
	DiscID                   string
	ImagePath                string
	Timestamp                float64
	FrameNumber              int
	Width                    int
	Height                   int
	Purpose                  ScreenshotPurpose
	CapturedAt               time.Time `ts_type:"string"`
}

type ScreenshotDiscPlan added in v0.3.2

type ScreenshotDiscPlan struct {
	DiscID              string
	DiscName            string
	DurationSeconds     float64
	FrameRate           float64
	SuggestedSelections []ScreenshotSelection
}

ScreenshotDiscPlan is one ordered disc's timing and selection plan.

type ScreenshotDiscSubject added in v0.3.2

type ScreenshotDiscSubject struct {
	ID   string
	Name string
	Type string
	// Root is the private filesystem root for this disc.
	Root                  string
	VideoPath             string
	MediaInfoJSONPath     string
	SelectedBDMVPlaylists []PlaylistInfo
}

ScreenshotDiscSubject contains private capture inputs for one ordered disc.

type ScreenshotError

type ScreenshotError struct {
	DiscID  string
	Index   int
	Message string
}

type ScreenshotFinalSelection

type ScreenshotFinalSelection struct {
	SourcePath               string
	PreparedMediaFingerprint string
	PreparedGeneration       PreparedGeneration
	DiscID                   string
	ImagePath                string
	Order                    int
	Source                   string
	SelectedAt               time.Time `ts_type:"string"`
}

type ScreenshotImage

type ScreenshotImage struct {
	// Tonemapping records actual processing; empty means unknown. ContentSHA256 binds it to image bytes.
	Tonemapping   ScreenshotTonemapping `json:",omitempty"`
	ContentSHA256 string                `json:",omitempty"`
	// Format is decoded from the image bytes; empty means uninspected.
	Format           string `json:",omitempty"`
	DiscID           string
	DiscName         string
	Index            int
	TimestampSeconds float64
	Path             string
	// Purpose distinguishes preview, normal final, and disc-menu images.
	Purpose   ScreenshotPurpose
	Width     int
	Height    int
	SizeBytes int64
	// Optional upload information (populated when image has been uploaded)
	Host       string    `json:"Host,omitempty"`
	ImgURL     string    `json:"ImgURL,omitempty"`
	RawURL     string    `json:"RawURL,omitempty"`
	WebURL     string    `json:"WebURL,omitempty"`
	UploadedAt time.Time `json:"UploadedAt,omitempty" ts_type:"string"`
}

type ScreenshotLifecycleRepository added in v0.2.4

type ScreenshotLifecycleRepository interface {
	// ReplaceNormalFinalSelections replaces non-menu selections while preserving disc menus.
	ReplaceNormalFinalSelections(ctx context.Context, binding PreparedMediaBinding, selections []ScreenshotFinalSelection) error
	// AppendManualMenuScreenshots atomically appends manual menu records and selections.
	AppendManualMenuScreenshots(ctx context.Context, binding PreparedMediaBinding, screenshots []Screenshot, selections []ScreenshotFinalSelection) error
	// ReplaceDVDMenuScreenshots atomically replaces automatic captures and returns their old local paths.
	ReplaceDVDMenuScreenshots(
		ctx context.Context,
		binding PreparedMediaBinding,
		screenshots []Screenshot,
		selections []ScreenshotFinalSelection,
	) ([]string, error)
	// DeleteDiscMenuScreenshot atomically removes one manual or automatic menu
	// selection and returns the local records needed to compensate the deletion.
	DeleteDiscMenuScreenshot(ctx context.Context, binding PreparedMediaBinding, imagePath string) (DiscMenuDeleteResult, error)
	// RestoreDiscMenuScreenshot atomically restores a result returned by
	// DeleteDiscMenuScreenshot for the same exact prepared-media binding.
	RestoreDiscMenuScreenshot(ctx context.Context, binding PreparedMediaBinding, deleted DiscMenuDeleteResult) error
}

ScreenshotLifecycleRepository owns category-aware screenshot mutations that must stay atomic without expanding the general metadata repository contract.

type ScreenshotLinkedImage

type ScreenshotLinkedImage struct {
	// Tonemapping records actual processing; empty means unknown. ContentSHA256 binds it to image bytes.
	Tonemapping   ScreenshotTonemapping `json:",omitempty"`
	ContentSHA256 string                `json:",omitempty"`
	Tracker       string
	URL           string
	PreviewURL    string
	Path          string
	Host          string // Normalized host name (e.g., "imgbb", "pixhost") or domain name
}

type ScreenshotOverrides

type ScreenshotOverrides struct {
	ManualFrames           []int
	ComparisonPaths        []string
	ComparisonPrimaryIndex *int
	MenuPaths              []string
}

type ScreenshotPlan

type ScreenshotPlan struct {
	MediaBinding               PreparedMediaBinding
	SourcePath                 string
	DiscType                   string
	DurationSeconds            float64
	FrameRate                  float64
	SuggestedSelections        []ScreenshotSelection
	ExistingScreenshots        []ScreenshotImage
	ExistingTrackerScreenshots []ScreenshotImage
	FinalSelections            []ScreenshotImage
	TrackerImageLinks          []ScreenshotLinkedImage
	PreviewImages              []ScreenshotImage
	MetadataTimestamp          string
	RequiresManualFrames       bool
	Discs                      []ScreenshotDiscPlan
}

type ScreenshotPreview

type ScreenshotPreview struct {
	DiscID           string
	DiscName         string
	TimestampSeconds float64
	ImageBytes       []byte
	Width            int
	Height           int
	SizeBytes        int64
}

type ScreenshotPurpose

type ScreenshotPurpose string

ScreenshotPurpose classifies an image within preview, final-selection, and disc-menu workflows.

const (
	// ScreenshotPurposePreview identifies transient frame previews.
	ScreenshotPurposePreview ScreenshotPurpose = "preview"
	// ScreenshotPurposeFinal identifies normal final screenshot selections.
	ScreenshotPurposeFinal ScreenshotPurpose = "final"
	// ScreenshotPurposeMenu identifies manual or automatic disc-menu images.
	ScreenshotPurposeMenu ScreenshotPurpose = "menu"
	// ScreenshotPurposeAudioAnalysis keeps audio graphs out of screenshot galleries.
	ScreenshotPurposeAudioAnalysis ScreenshotPurpose = "audio_analysis"
	// ScreenshotPurposeHDRAnalysis keeps brightness plots separate from screenshots and audio graphs.
	ScreenshotPurposeHDRAnalysis ScreenshotPurpose = "hdr_analysis"

	// ScreenshotSelectionSourceMenu identifies manually imported disc-menu selections.
	ScreenshotSelectionSourceMenu = "menu"
	// ScreenshotSelectionSourceDVDMenu identifies automatically captured DVD-menu selections.
	ScreenshotSelectionSourceDVDMenu = "dvd_menu"
)

Screenshot purpose and selection-source values shared across persistence and frontend workflows.

func (ScreenshotPurpose) IsAnalysis added in v0.4.1

func (p ScreenshotPurpose) IsAnalysis() bool

IsAnalysis reports purposes that require complete upload coverage and account-bound reuse.

type ScreenshotReference added in v0.4.1

type ScreenshotReference struct {
	ID     WorkflowFingerprint
	RawURL string
	ImgURL string
	WebURL string
}

ScreenshotReference binds a prepared image to its hosted representations. ID identifies a distinct selected image without exposing its materialized path.

type ScreenshotResult

type ScreenshotResult struct {
	SourcePath     string
	Purpose        ScreenshotPurpose
	Images         []ScreenshotImage
	Tonemapped     bool
	UsedLibplacebo bool
	Errors         []ScreenshotError
}

type ScreenshotSelection

type ScreenshotSelection struct {
	// DiscID is required when the prepared source contains multiple discs.
	DiscID           string
	Index            int
	TimestampSeconds float64
	Frame            int
	Source           string
}

type ScreenshotService

type ScreenshotService interface {
	Plan(ctx context.Context, subject ScreenshotSubject, count int) (ScreenshotPlan, error)
	Capture(ctx context.Context, subject ScreenshotSubject, selections []ScreenshotSelection, purpose ScreenshotPurpose) (ScreenshotResult, error)
	PreviewFrame(ctx context.Context, subject ScreenshotSubject, discID string, timestampSeconds float64) (ScreenshotPreview, error)
	Delete(ctx context.Context, subject ScreenshotSubject, imagePath string) error
	SaveFinalSelections(ctx context.Context, subject ScreenshotSubject, images []ScreenshotImage) error
}

type ScreenshotSlot

type ScreenshotSlot struct {
	SourcePath               string
	PreparedMediaFingerprint string
	PreparedGeneration       PreparedGeneration
	DiscID                   string
	SlotOrder                int
	SourceKind               string
	OriginalKey              string
	OriginalURL              string
	OriginalHost             string
	ImagePath                string
	FromDescription          bool
	Tracker                  string
	SectionKind              string
	RenderInScreenshots      bool
	Variants                 []ScreenshotSlotVariant
}

type ScreenshotSlotVariant

type ScreenshotSlotVariant struct {
	SourcePath               string
	PreparedMediaFingerprint string
	PreparedGeneration       PreparedGeneration
	DiscID                   string
	SlotOrder                int
	Host                     string
	UsageScope               string
	ImagePath                string
	ImgURL                   string
	RawURL                   string
	WebURL                   string
	UploadedAt               time.Time `ts_type:"string"`
}

type ScreenshotSubject added in v0.3.0

type ScreenshotSubject struct {
	// MediaBinding owns persisted media for one exact prepared generation.
	MediaBinding PreparedMediaBinding
	SourcePath   string
	DiscID       string
	DiscName     string
	// DiscRoot is the private filesystem root used only by the selected disc capture.
	DiscRoot              string
	DiscType              string
	VideoPath             string
	MediaInfoJSONPath     string
	MediaCategory         string
	HDR                   string
	TVPack                bool
	Episode               int
	Release               ReleaseInfo
	SelectedBDMVPlaylists []PlaylistInfo
	DefaultCount          int
	ManualFrames          []int
	Discs                 []ScreenshotDiscSubject
}

ScreenshotSubject contains only source facts required to plan and manage screenshots. Workflow modules build it from an exact prepared generation.

type ScreenshotTonemapping added in v0.4.1

type ScreenshotTonemapping string

ScreenshotTonemapping records observed image processing, never capture preferences. The zero value deliberately preserves unknown legacy and imported images.

const (
	ScreenshotTonemapped    ScreenshotTonemapping = "tonemapped"
	ScreenshotNotTonemapped ScreenshotTonemapping = "not_tonemapped"
)

type SeasonEpisodeFacts added in v0.3.0

type SeasonEpisodeFacts struct {
	Season   int
	Episodes []int
}

SeasonEpisodeFacts records locally detected episode numbers for one season.

type SelectReleaseWorkflowCandidateRequest added in v0.3.0

type SelectReleaseWorkflowCandidateRequest struct {
	ReleaseWorkflowCommandContext
	ReleaseID string `json:"releaseId"`
}

SelectReleaseWorkflowCandidateRequest selects one prepared Blu-ray candidate.

func (SelectReleaseWorkflowCandidateRequest) Validate added in v0.3.0

Validate verifies candidate and revision authority.

type SelectReleaseWorkflowHDRComparisonRequest added in v0.4.1

type SelectReleaseWorkflowHDRComparisonRequest struct {
	ReleaseWorkflowCommandContext
	Release    ReleaseRef `json:"release"`
	SourcePath string     `json:"sourcePath"`
}

SelectReleaseWorkflowHDRComparisonRequest selects a server-local file for source B. Selection belongs to the current prepared release and does not replace the primary input.

func (SelectReleaseWorkflowHDRComparisonRequest) Validate added in v0.4.1

Validate checks command authority fields and path bounds; source inspection is deferred to the workflow.

type ServiceSet

type ServiceSet struct {
	// Metadata is an internal preparation collector override. Core validates the
	// private contract before use; no mutable preparation type is exported here.
	Metadata   any
	Trackers   TrackerService
	Torrents   TorrentService
	Clients    ClientService
	Filesystem FilesystemService
	Dupes      ProjectionDupeService
	// TrackerAuth validates tracker readiness at the shared upload-preflight boundary.
	TrackerAuth TrackerAuthService
	Screenshots ScreenshotService
	// DVDMenus handles automatic capture and persisted disc-menu lifecycle operations.
	DVDMenus DVDMenuService
	Images   ImageHostingService
}

type SetReleaseWorkflowAudioAnalysisEnabledRequest added in v0.3.5

type SetReleaseWorkflowAudioAnalysisEnabledRequest struct {
	ReleaseWorkflowCommandContext
	Enabled bool `json:"enabled"`
}

SetReleaseWorkflowAudioAnalysisEnabledRequest changes durable analysis intent without starting decode work. Disabling clears the current analysis reference.

func (SetReleaseWorkflowAudioAnalysisEnabledRequest) Validate added in v0.3.5

Validate verifies exact revision authority.

type SetReleaseWorkflowHDRAnalysisEnabledRequest added in v0.4.1

type SetReleaseWorkflowHDRAnalysisEnabledRequest struct {
	ReleaseWorkflowCommandContext
	Enabled     bool               `json:"enabled"`
	ArtifactIDs []PublicResourceID `json:"artifactIds,omitempty"`
}

func (SetReleaseWorkflowHDRAnalysisEnabledRequest) Validate added in v0.4.1

type SetReleaseWorkflowMediaSelectionRequest added in v0.3.0

type SetReleaseWorkflowMediaSelectionRequest struct {
	ReleaseWorkflowCommandContext
	Media       MediaArtifactSetRef `json:"media"`
	ArtifactIDs []PublicResourceID  `json:"artifactIds"`
	Selected    bool                `json:"selected"`
}

SetReleaseWorkflowMediaSelectionRequest changes opaque artifact selection.

func (SetReleaseWorkflowMediaSelectionRequest) Validate added in v0.3.0

Validate verifies revision authority and opaque media refs.

type SourceClassification added in v0.3.0

type SourceClassification struct {
	DiscType  string
	DiscCount int
	Container string
	MediaType string
}

SourceClassification records finalized source structure without exposing preparation-resource paths.

type SourceContentIdentity added in v0.3.5

type SourceContentIdentity struct {
	Version             string               `json:"version"`
	Digest              string               `json:"digest"`
	ManifestFingerprint string               `json:"manifestFingerprint"`
	Files               []VerifiedSourceFile `json:"files"`
}

SourceContentIdentity identifies a canonical source path, inventory layout, and bounded initial-file samples. It is private prepared-input evidence, not complete local-byte verification; PreparedRelease excludes it from transport JSON.

type SourceEntryType added in v0.3.0

type SourceEntryType string

SourceEntryType classifies one normalized source-manifest entry.

const (
	// SourceEntryTypeUnknown marks an entry whose type could not be classified.
	SourceEntryTypeUnknown SourceEntryType = "unknown"
	// SourceEntryTypeFile marks a regular file.
	SourceEntryTypeFile SourceEntryType = "file"
	// SourceEntryTypeDirectory marks a directory.
	SourceEntryTypeDirectory SourceEntryType = "directory"
	// SourceEntryTypePlaylist marks a resolved disc playlist.
	SourceEntryTypePlaylist SourceEntryType = "playlist"
)

type SourceManifest added in v0.3.0

type SourceManifest struct {
	SourcePath        string
	Size              int64
	Entries           []SourceManifestEntry
	SelectedPlaylists []PlaylistInfo
	Classification    SourceClassification
}

SourceManifest is the finalized source inventory and measurement set for one prepared release.

type SourceManifestEntry added in v0.3.0

type SourceManifestEntry struct {
	Path       string
	Type       SourceEntryType
	Size       int64
	ModifiedAt time.Time `ts_type:"string"`
	Disc       string
	DiscID     string
	Playlist   string
}

SourceManifestEntry is one stable inventory item used by preparation and source fingerprinting.

type SourceScopedMetadata added in v0.3.0

type SourceScopedMetadata struct {
	// ImportedScreenshotEvidence is a receipt snapshot, not a local image asset.
	ImportedScreenshotEvidence *ImportedScreenshotEvidence `json:",omitempty"`
	SourcePath                 string
	Generation                 PreparedGeneration
	TMDB                       *TMDBMetadata
	IMDB                       *IMDBMetadata
	TVDB                       *TVDBMetadata
	TVmaze                     *TVmazeMetadata
	AniList                    *AniListMetadata
	Bluray                     *BlurayMetadata
	ProviderAvailability       []ProviderAvailabilityEvidence
	UpdatedAt                  time.Time `ts_type:"string"`
}

SourceScopedMetadata stores optional provider enrichment for one source and prepared generation.

func (SourceScopedMetadata) IsCurrentFor added in v0.3.0

func (m SourceScopedMetadata) IsCurrentFor(sourcePath string, identity ExternalIdentity) bool

IsCurrentFor reports whether provider metadata belongs to the current source and prepared generation. Blank source scopes preserve legacy metadata, but explicit source mismatches and generation mismatches are rejected.

type StaffUploadToken added in v0.4.1

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

StaffUploadToken is an operation-local credential, not upload authority. It is deliberately excluded from JSON and formatted diagnostics.

func NewStaffUploadToken added in v0.4.1

func NewStaffUploadToken(value string) StaffUploadToken

NewStaffUploadToken accepts a backend-supplied staff credential without persisting it or claiming that a tracker has authorized an exception.

func (StaffUploadToken) GoString added in v0.4.1

func (StaffUploadToken) GoString() string

func (StaffUploadToken) MarshalJSON added in v0.4.1

func (StaffUploadToken) MarshalJSON() ([]byte, error)

func (StaffUploadToken) Secret added in v0.4.1

func (t StaffUploadToken) Secret() string

Secret is for a tracker's eventual protocol-specific authorization exchange. Callers must never copy the result into logs, errors, review or torrent data.

func (StaffUploadToken) String added in v0.4.1

func (StaffUploadToken) String() string

type StageStatus added in v0.3.0

type StageStatus string

StageStatus is the lifecycle status shared by immutable workflow stage snapshots.

const (
	// StageStatusPending means dependencies are incomplete.
	StageStatusPending StageStatus = "pending"
	// StageStatusQueued means an accepted operation is waiting to run.
	StageStatusQueued StageStatus = "queued"
	// StageStatusReady means the snapshot is valid for its next consumer.
	StageStatusReady StageStatus = "ready"
	// StageStatusBlocked means typed caller action is required.
	StageStatusBlocked StageStatus = "blocked"
	// StageStatusStale means a dependency changed or freshness expired.
	StageStatusStale StageStatus = "stale"
	// StageStatusFailed means the stage reached a retained failure.
	StageStatusFailed StageStatus = "failed"
	// StageStatusPartial means terminal work produced both successes and failures.
	StageStatusPartial StageStatus = "partial"
	// StageStatusSkipped means backend policy determined the stage was unnecessary.
	StageStatusSkipped StageStatus = "skipped"
	// StageStatusRunning means an asynchronous operation is active.
	StageStatusRunning StageStatus = "running"
	// StageStatusCompleted means a non-execution stage completed successfully.
	StageStatusCompleted StageStatus = "completed"
	// StageStatusExecuted means a retained upload plan was consumed.
	StageStatusExecuted StageStatus = "executed"
	// StageStatusInterrupted means a process restart interrupted in-flight work.
	StageStatusInterrupted StageStatus = "interrupted"
	// StageStatusCanceled means the owner canceled an accepted operation.
	StageStatusCanceled StageStatus = "canceled"
	// StageStatusUnavailable means private restart-sensitive resources no longer exist.
	StageStatusUnavailable StageStatus = "unavailable"
)

func NativeHDRAggregate added in v0.4.1

func NativeHDRAggregate(targets []HDRAnalysisTargetResult) StageStatus

NativeHDRAggregate folds settled target statuses. The first canceled or interrupted target wins; otherwise all completed yields completed, any completed or partial yields partial, and no successful targets yields failed.

type StaleContentCorrectionsError added in v0.3.2

type StaleContentCorrectionsError struct {
	Corrections    ReleaseCorrectionsSnapshot
	CurrentBinding ContentBinding
}

StaleContentCorrectionsError asks the workflow to confirm individual saved values after provider discovery establishes a different content identity.

func (*StaleContentCorrectionsError) Error added in v0.3.2

func (*StaleContentCorrectionsError) Unwrap added in v0.3.2

func (e *StaleContentCorrectionsError) Unwrap() error

type StoredReleaseCorrectionsV1 added in v0.3.2

type StoredReleaseCorrectionsV1 struct {
	Version            uint                               `json:"version"`
	Identity           ExternalIDOverrides                `json:"identity"`
	ReleaseName        ReleaseNameOverrides               `json:"releaseName"`
	Metadata           MetadataOverrides                  `json:"metadata"`
	SourceFingerprint  string                             `json:"sourceFingerprint,omitempty"`
	ContentBindings    map[CorrectionField]ContentBinding `json:"contentBindings,omitempty"`
	StaleContentFields []CorrectionField                  `json:"staleContentFields,omitempty"`
	// IdentityResetFields keeps Auto authoritative over legacy persisted identity pins.
	IdentityResetFields []CorrectionField `json:"identityResetFields,omitempty"`
}

StoredReleaseCorrectionsV1 is the persisted v1 correction payload. Its revision belongs to the containing row and is exposed by ReleaseCorrectionsSnapshot.

func ApplyReleaseCorrectionUpdate added in v0.3.2

func ApplyReleaseCorrectionUpdate(snapshot ReleaseCorrectionsSnapshot, update ReleaseCorrectionUpdate) (StoredReleaseCorrectionsV1, error)

ApplyReleaseCorrectionUpdate performs deterministic merge and reset logic. Persistence owns compare-and-swap, revision increments, and content freshness.

type SubmissionContentFile added in v0.3.5

type SubmissionContentFile struct {
	RelativePath string `json:"relativePath,omitempty"`
	Size         int64  `json:"size"`
	SHA256       string `json:"sampleSha256"`
}

SubmissionContentFile is one path-free entry in a submitted-inventory identity. SHA256 is private bounded source-sample evidence; RelativePath is omitted for single-file identities because the filename is not part of their submission authority.

type SubmissionContentIdentity added in v0.3.5

type SubmissionContentIdentity struct {
	Version string                  `json:"version"`
	Digest  string                  `json:"digest"`
	Scope   SubmissionContentScope  `json:"scope"`
	Files   []SubmissionContentFile `json:"files"`
}

SubmissionContentIdentity identifies the selected local inventory and its private bounded source samples. It excludes source roots and tracker-specific metainfo and does not prove full-file byte equality.

func NewSubmissionContentIdentity added in v0.3.5

func NewSubmissionContentIdentity(
	scope SubmissionContentScope,
	files []SubmissionContentFile,
) (SubmissionContentIdentity, error)

NewSubmissionContentIdentity canonicalizes sampled submitted files and derives their versioned SHA-256 identity without modifying files. Single-file scope drops the filename; other scopes normalize and sort relative paths. Empty inventories, unsupported scopes, invalid sizes or sample digests, escaping paths, and duplicate normalized paths return a zero identity and an error.

type SubmissionContentScope added in v0.3.5

type SubmissionContentScope string

SubmissionContentScope identifies the canonical content shape supplied to torrent creation and tracker submission.

const (
	// SubmissionContentScopeSingleFile identifies one submitted file.
	SubmissionContentScopeSingleFile SubmissionContentScope = "single_file"
	// SubmissionContentScopeFileSet identifies an ordered multi-file submission.
	SubmissionContentScopeFileSet SubmissionContentScope = "file_set"
	// SubmissionContentScopeFullDisc identifies an entire resolved disc inventory.
	SubmissionContentScopeFullDisc SubmissionContentScope = "full_disc"
)

type SubmissionExclusion added in v0.3.5

type SubmissionExclusion struct {
	TrackerID   TrackerID `json:"trackerId"`
	Reason      string    `json:"reason"`
	ConfirmedAt time.Time `json:"confirmedAt"`
}

SubmissionExclusion is safe confirmed-upload evidence for tracker selection. It deliberately omits the private content identity and source path.

type SubmissionFenceAuthority added in v0.3.5

type SubmissionFenceAuthority struct {
	ContentIdentity SubmissionContentIdentity
	TrackerSite     string
	CoordinatorID   string
	Fence           uint64
}

SubmissionFenceAuthority identifies one globally fenced tracker submission. CoordinatorID and Fence bind admission and completion to the active input lease that prepared the exact submitted content.

func (SubmissionFenceAuthority) Validate added in v0.3.5

func (a SubmissionFenceAuthority) Validate() error

Validate verifies that the fence has canonical content identity and a secret-free, normalized tracker-site key supplied by tracker registration.

func (SubmissionFenceAuthority) ValidateSubmission added in v0.3.5

func (a SubmissionFenceAuthority) ValidateSubmission() error

ValidateSubmission verifies the content/site portion that tracker planning supplies before the workflow reporter binds its active-input lease token.

type SubmissionFenceRecord added in v0.3.5

type SubmissionFenceRecord struct {
	ContentIdentity SubmissionContentIdentity
	TrackerSite     string
	OwnerID         string
	WorkflowID      WorkflowID
	OperationID     WorkflowOperationID
	EffectID        string
	Status          WorkflowEffectStatus
	StartedAt       time.Time
	UpdatedAt       time.Time
	ConfirmedAt     *time.Time
}

SubmissionFenceRecord is the minimal durable authority retained after display history is purged. It is not a browser-facing history record.

type SubmissionFenceRepository added in v0.3.5

type SubmissionFenceRepository interface {
	LoadSubmissionFence(context.Context, SubmissionContentIdentity, string) (SubmissionFenceRecord, error)
}

SubmissionFenceRepository provides safe global exclusion lookups. Callers only use terminal success to exclude a tracker; started and unknown outcomes remain reconciliation fences.

type SubtitleCoverage added in v0.4.0

type SubtitleCoverage string

SubtitleCoverage records explicitly supplied dialogue coverage; empty retains an unqualified language without guessing full or forced coverage.

const (
	SubtitleCoverageUnspecified SubtitleCoverage = ""
	SubtitleCoverageFull        SubtitleCoverage = "full"
	SubtitleCoverageForced      SubtitleCoverage = "forced"
)

type SubtitleLanguageCoverage added in v0.4.0

type SubtitleLanguageCoverage struct {
	Language string
	Coverage SubtitleCoverage
}

SubtitleLanguageCoverage preserves coverage without changing base-language lists.

type TIKOverrides

type TIKOverrides struct {
	Foreign  *bool
	Opera    *bool
	Asian    *bool
	DiscType *string
}

TIKOverrides carries TIK-specific upload flags selected outside static config.

type TMDBCompany

type TMDBCompany struct {
	ID            int
	Name          string
	LogoPath      string
	OriginCountry string
}

type TMDBCountry

type TMDBCountry struct {
	ISO3166 string
	Name    string
}

type TMDBLocalizedData added in v0.2.0

type TMDBLocalizedData struct {
	Title           string
	Overview        string
	EpisodeTitle    string
	EpisodeOverview string
	TrailerURL      string
	Genres          string
	ContentRating   string
	Poster          string
}

func ExtractTrackerLocalizedPTBR added in v0.3.0

func ExtractTrackerLocalizedPTBR(subject UploadSubject) TMDBLocalizedData

ExtractTrackerLocalizedPTBR returns pt-BR provider data from a tracker-owned operation subject.

type TMDBMetadata

type TMDBMetadata struct {
	TMDBID              int
	IMDBID              int
	TVDBID              int
	Category            string
	Title               string
	OriginalTitle       string
	Year                int
	ReleaseDate         string
	FirstAirDate        string
	LastAirDate         string
	OriginCountry       []string
	OriginalLanguage    string
	Overview            string
	Poster              string
	TMDBPosterPath      string
	LogoLookupAttempted bool
	Backdrop            string
	TMDBType            string
	Runtime             int
	Genres              string
	GenreIDs            string
	Creators            []string
	Directors           []string
	Cast                []string
	MALID               int
	Anime               bool
	Demographic         string
	RetrievedAKA        string
	Keywords            string
	// LocalizedTitles maps lowercase language codes and optional regional tags
	// such as "de" or "pt-BR" to TMDB translation titles. Nil values marshal as
	// an empty JSON object for WebUI callers.
	LocalizedTitles     map[string]string
	YouTube             string
	Certification       string
	ProductionCompanies []TMDBCompany
	ProductionCountries []TMDBCountry
	Networks            []TMDBNetwork
	IMDbMismatch        bool
	MismatchedIMDbID    int
	Localized           map[string]TMDBLocalizedData
}

TMDBMetadata is the shared TMDB metadata snapshot returned to CLI and WebUI callers during upload preparation and review.

func (TMDBMetadata) MarshalJSON added in v0.2.0

func (m TMDBMetadata) MarshalJSON() ([]byte, error)

MarshalJSON preserves the shared TMDBMetadata shape while emitting LocalizedTitles as an object instead of null.

type TMDBNetwork

type TMDBNetwork struct {
	ID            int
	Name          string
	LogoPath      string
	OriginCountry string
}

type TVDBEpisodeMetadata added in v0.2.4

type TVDBEpisodeMetadata struct {
	ID                     int
	SeasonNumber           int
	EpisodeNumber          int
	EpisodeName            string
	EpisodeNameEnglish     string
	EpisodeOverview        string
	EpisodeOverviewEnglish string
	// EpisodeAired is the TVDB air date string used in tracker descriptions.
	EpisodeAired string
	// EpisodeImage is the TVDB episode image URL when the API returned one.
	EpisodeImage string
}

TVDBEpisodeMetadata stores one TVDB episode entry for tracker payloads that need single-episode or season-pack episode descriptions.

type TVDBMetadata

type TVDBMetadata struct {
	TVDBID          int
	Name            string
	NameEnglish     string
	Overview        string
	OverviewEnglish string
	FirstAired      string
	Year            int
	// YearFromAlias reports whether Year is naming-eligible for TV release names.
	YearFromAlias bool
	// YearSource identifies the TVDB source used for Year, such as first_aired, translation_name, translation_alias, extended_alias, or slug.
	YearSource string
	// YearConfidence is "high" for explicit TVDB title/alias years and "low" for guarded slug-derived naming years.
	YearConfidence                 string
	NameDisambiguation             TVDBNameDisambiguation
	Type                           string
	Status                         string
	Network                        string
	OriginalCountry                string
	OriginalLanguage               string
	HasEnglish                     bool
	Genres                         string
	Poster                         string
	PosterThumbnail                string
	PosterThumbnailLookupAttempted bool
	Aliases                        []string
	EpisodeSeason                  int
	// EpisodeSeasonKnown retains provider presence for selected text; false cannot prove season zero.
	EpisodeSeasonKnown     bool
	EpisodeNumber          int
	EpisodeName            string
	EpisodeNameEnglish     string
	EpisodeOverview        string
	EpisodeOverviewEnglish string
	EpisodeAired           string
	// EpisodeImage is the selected episode image URL when the API returned one.
	EpisodeImage string
	// Episodes contains fetched TVDB episode entries, usually the season needed
	// by a season-pack upload.
	Episodes []TVDBEpisodeMetadata
}

TVDBMetadata stores TVDB series metadata plus the selected episode and any episode list fetched for the selected season.

type TVDBNameDisambiguation added in v0.3.0

type TVDBNameDisambiguation struct {
	// CanonicalName is the selected English series name used for comparison.
	CanonicalName string
	// SeriesYear is the selected series year used for same-year comparison.
	SeriesYear int
	// Locale is the normalized country token emitted only when IncludeLocale
	// is true.
	Locale string
	// SameNameSeries counts distinct other TVDB IDs with the same normalized
	// English primary name or alias.
	SameNameSeries int
	// SameNameAndYearSeries counts SameNameSeries entries with a matching known
	// year.
	SameNameAndYearSeries int
	// IncludeYear and IncludeLocale are the prepared naming decisions consumed
	// by tracker policies without further provider I/O.
	IncludeYear   bool
	IncludeLocale bool
	// Status records whether the general-name search evidence is complete,
	// partial, unavailable, or contradictory.
	Status MetadataEvidenceStatus
	// Source identifies the versioned disambiguation algorithm.
	Source string
}

TVDBNameDisambiguation records provider evidence used to decide whether a TV series name needs its TVDB year and country locale.

type TVmazeMetadata

type TVmazeMetadata struct {
	TVmazeID                int
	Name                    string
	Premiered               string
	Ended                   string
	Summary                 string
	Status                  string
	Type                    string
	Language                string
	Genres                  string
	Runtime                 int
	AverageRuntime          int
	Rating                  float64
	Weight                  int
	OfficialSite            string
	Country                 string
	Network                 string
	NetworkCountry          string
	WebChannel              string
	WebCountry              string
	Poster                  string
	PosterMedium            string
	Backdrop                string
	BackdropMedium          string
	BackdropLookupAttempted bool
	IMDBID                  int
	TVDBID                  int
}

type TagOverride

type TagOverride struct {
	Type            string
	Source          string
	Template        string
	PersonalRelease bool
}

type TestRuntimeInfo added in v0.3.2

type TestRuntimeInfo struct {
	ImageUploadLimit           int                  `json:"imageUploadLimit"`
	Mode                       string               `json:"mode"`
	RunID                      string               `json:"runId"`
	TrackerSubmissionAllowed   bool                 `json:"trackerSubmissionAllowed"`
	ClientMutationAllowed      bool                 `json:"clientMutationAllowed"`
	ImageUploadsRequireJournal bool                 `json:"imageUploadsRequireJournal"`
	TrackerSubmission          LiveTestEffectCounts `json:"trackerSubmission"`
	ClientMutation             LiveTestEffectCounts `json:"clientMutation"`
}

TestRuntimeInfo is the secret-free live-testing capability and effect receipt.

type TorrentMatch

type TorrentMatch struct {
	Hash              string
	Name              string
	SavePath          string
	ContentPath       string
	Size              int64
	Category          string
	Seeders           int64
	Tracker           string
	HasWorkingTracker bool
	Comment           string
	TrackerURLsRaw    []string
	TrackerURLs       []TrackerMatch
	HasTracker        bool
}

type TorrentOverrides

type TorrentOverrides struct {
	InfoHash        *string
	MaxPieceSizeMiB *int
	NoHash          *bool
	Rehash          *bool
}

type TorrentResult

type TorrentResult struct {
	Path      string
	InfoHash  string
	URL       string
	Tracker   string
	CrossSeed bool
	// RehashedTrackers lists selected trackers whose preparation required the
	// created base torrent and should be scheduled after reusable uploads.
	RehashedTrackers []string
	// SkippedTrackers lists selected trackers omitted by SkipIfRehashTrackers.
	// Path can be empty when every selected tracker was skipped.
	SkippedTrackers []string
}

TorrentResult carries a torrent artifact reference and tracker context between creation, upload, and client-injection services.

type TorrentService

type TorrentService interface {
	Create(ctx context.Context, subject TorrentSubject) (TorrentResult, error)
}

type TorrentSubject added in v0.3.0

type TorrentSubject struct {
	SourcePath string
	SourceSize int64
	FileList   []string
	DiscType   string
	// ClientTorrentPath is reusable metainfo selected by client discovery.
	ClientTorrentPath string
	// ClientTorrentInfoHash is the infohash captured with ClientTorrentPath.
	ClientTorrentInfoHash string
	// ClientTorrentDataVerified permits skipping piece verification only for
	// ClientTorrentPath when its current infohash still matches complete,
	// source-path-bound client evidence.
	ClientTorrentDataVerified bool
	Trackers                  []string
	// SkipIfRehashTrackers lists selected tracker names to omit when their
	// torrent policy would otherwise require regeneration. Names are case-insensitive.
	SkipIfRehashTrackers []string
	TorrentOverrides     TorrentOverrides
}

TorrentSubject contains only facts and instructions required to create or validate a torrent artifact for one prepared source.

type TrackAudioOrigin added in v0.4.1

type TrackAudioOrigin string

TrackAudioOrigin distinguishes original programme content from a confirmed dub. Empty means no explicit source-level classification has been established.

const (
	TrackAudioOriginal   TrackAudioOrigin = "original"
	TrackAudioDubbed     TrackAudioOrigin = "dubbed"
	TrackAudioUnresolved TrackAudioOrigin = "unresolved"
)

type TrackAudioOriginCorrection added in v0.4.1

type TrackAudioOriginCorrection struct {
	TrackID             string           `json:"trackId"`
	Origin              TrackAudioOrigin `json:"origin"`
	ManifestFingerprint string           `json:"manifestFingerprint"`
}

TrackAudioOriginCorrection classifies one inspected soundtrack independently from its language list, using the same source-manifest binding as track languages.

type TrackLanguageCorrection added in v0.3.2

type TrackLanguageCorrection struct {
	TrackID             string   `json:"trackId"`
	Languages           []string `json:"languages"`
	ManifestFingerprint string   `json:"manifestFingerprint"`
}

TrackLanguageCorrection replaces the languages for one inspected track. ManifestFingerprint binds the correction to the exact scan that supplied TrackID; callers must not reuse a correction after that scan changes.

type TrackerApproval added in v0.3.0

type TrackerApproval struct {
	ActionID         RequiredActionID    `json:"actionId"`
	Dupes            DupeAssessmentRef   `json:"dupes"`
	InputFingerprint WorkflowFingerprint `json:"inputFingerprint"`
	TrackerIDs       []TrackerID         `json:"trackerIds"`
}

TrackerApproval binds one explicit non-empty tracker subset to exact post-dupe evidence.

type TrackerApprovalSnapshot added in v0.3.0

type TrackerApprovalSnapshot struct {
	ID                  TrackerApprovalSnapshotID      `json:"id"`
	WorkflowID          WorkflowID                     `json:"workflowId"`
	Revision            WorkflowRevision               `json:"revision"`
	Release             ReleaseSnapshotRef             `json:"release"`
	Selection           TrackerSelectionRef            `json:"selection"`
	ProjectionSet       TrackerReleaseProjectionSetRef `json:"projectionSet"`
	Preflight           TrackerPreflightAssessmentRef  `json:"preflight"`
	Dupes               DupeAssessmentRef              `json:"dupes"`
	CandidateTrackerIDs []TrackerID                    `json:"candidateTrackerIds"`
	ApprovedTrackerIDs  []TrackerID                    `json:"approvedTrackerIds"`
	InputFingerprint    WorkflowFingerprint            `json:"inputFingerprint"`
	CreatedAt           time.Time                      `json:"createdAt" ts_type:"string"`
}

TrackerApprovalSnapshot is durable exact tracker authority for gated workflows.

func (TrackerApprovalSnapshot) Clone added in v0.3.0

Clone returns a detached tracker-approval snapshot.

func (TrackerApprovalSnapshot) Validate added in v0.3.0

func (s TrackerApprovalSnapshot) Validate() error

Validate verifies exact post-dupe lineage and explicit candidate/approved sets.

type TrackerApprovalSnapshotID added in v0.3.0

type TrackerApprovalSnapshotID string

TrackerApprovalSnapshotID identifies one immutable post-dupe tracker approval.

type TrackerApprovalSnapshotRef added in v0.3.0

type TrackerApprovalSnapshotRef struct {
	ID       TrackerApprovalSnapshotID `json:"id"`
	Revision WorkflowRevision          `json:"revision"`
}

TrackerApprovalSnapshotRef references one exact post-dupe tracker approval.

type TrackerArtifactRequirements added in v0.3.0

type TrackerArtifactRequirements struct {
	// ScreenshotCount is the minimum number of selected normal screenshots.
	ScreenshotCount int `json:"screenshotCount"`
	// DVDMenuCount is a tracker-declared minimum, not an automatic-capture cap.
	DVDMenuCount      int      `json:"dvdMenuCount"`
	MediaInfo         bool     `json:"mediaInfo"`
	BDInfo            bool     `json:"bdInfo"`
	NFO               bool     `json:"nfo"`
	Description       bool     `json:"description"`
	ImageHosting      bool     `json:"imageHosting"`
	AllowedImageHosts []string `json:"allowedImageHosts,omitempty"`
	Torrent           bool     `json:"torrent"`
}

TrackerArtifactRequirements are backend-owned tracker artifact requirements.

type TrackerAuthCapability added in v0.2.1

type TrackerAuthCapability struct {
	// TrackerID is the normalized tracker code used in WebUI requests.
	TrackerID   string `json:"trackerID"`
	DisplayName string `json:"displayName"`
	// AuthKind is a compact capability label such as "cookies", "credential_login", or "api_key_cookies_login".
	AuthKind           string `json:"authKind"`
	SupportsCookieFile bool   `json:"supportsCookieFile"`
	SupportsLogin      bool   `json:"supportsLogin"`
	SupportsAutoLogin  bool   `json:"supportsAutoLogin"`
	SupportsTOTP       bool   `json:"supportsTOTP"`
	SupportsManual2FA  bool   `json:"supportsManual2FA"`
	// SupportsRemoteValidation reports whether Check Auth can execute a tracker-owned remote resolver.
	SupportsRemoteValidation bool     `json:"supportsRemoteValidation"`
	RequiresAPIKey           bool     `json:"requiresAPIKey"`
	RequiresPasskey          bool     `json:"requiresPasskey"`
	Notes                    []string `json:"notes"`
}

TrackerAuthCapability describes the auth operations the UI can offer for one tracker.

type TrackerAuthLoginRequest added in v0.2.1

type TrackerAuthLoginRequest struct {
	// Code is a one-time 2FA code for adapters that accept it during login.
	Code string `json:"code"`
}

TrackerAuthLoginRequest carries optional login data for tracker auth flows.

type TrackerAuthService added in v0.2.5

type TrackerAuthService interface {
	// Capabilities returns the configured trackers whose auth workflows the
	// service can classify.
	Capabilities(ctx context.Context) ([]TrackerAuthCapability, error)
	// ValidateMany returns one status per tracker in input order. An error means
	// the batch has no usable status result.
	ValidateMany(ctx context.Context, trackerIDs []string) ([]TrackerAuthStatus, error)
}

TrackerAuthService exposes the batch auth operations needed by shared upload preflight. Interactive auth changes remain outside release workflows.

type TrackerAuthStatus added in v0.2.1

type TrackerAuthStatus struct {
	TrackerID   string `json:"trackerID"`
	DisplayName string `json:"displayName"`
	// State is one of the tracker auth state strings returned by the backend, such as "configured", "has_cookies", or "login_required".
	State       string `json:"state"`
	CookieCount int    `json:"cookieCount"`
	// LastCheckedAt is an RFC3339 UTC timestamp generated when the status is evaluated.
	LastCheckedAt string `json:"lastCheckedAt"`
	// LastError contains redacted failure detail when a local or remote auth check failed; consumers should display it with Message when distinct.
	LastError        string `json:"lastError"`
	EncryptedStorage bool   `json:"encryptedStorage"`
	Needs2FA         bool   `json:"needs2FA"`
	// ChallengeID is an opaque manual-2FA continuation token; it is empty unless Needs2FA is true.
	ChallengeID string `json:"challengeID"`
	// Message contains the stable user-facing status summary or next step.
	Message string `json:"message"`
}

TrackerAuthStatus reports the current local tracker auth state after a status, import, login, validation, 2FA, or delete action.

WebUI routes and TypeScript consumers must expose the same JSON fields so status summaries, remediation messages, and Promise-visible errors stay in parity across browser entrypoints.

type TrackerBlockReason

type TrackerBlockReason string
const (
	TrackerBlockReasonDupe  TrackerBlockReason = "dupe"
	TrackerBlockReasonClaim TrackerBlockReason = "claim"
	TrackerBlockReasonAudio TrackerBlockReason = "audio"
)

type TrackerCapabilityDescriptor added in v0.3.0

type TrackerCapabilityDescriptor struct {
	DuplicateSearch        bool `json:"duplicateSearch"`
	Rules                  bool `json:"rules"`
	Metadata               bool `json:"metadata"`
	LocalizedMetadata      bool `json:"localizedMetadata"`
	TrackerData            bool `json:"trackerData"`
	Claims                 bool `json:"claims"`
	Authentication         bool `json:"authentication"`
	StaticBannedGroups     bool `json:"staticBannedGroups"`
	DynamicBannedGroups    bool `json:"dynamicBannedGroups"`
	ScreenshotRequirement  bool `json:"screenshotRequirement"`
	Description            bool `json:"description"`
	ImageHosting           bool `json:"imageHosting"`
	TorrentPersonalization bool `json:"torrentPersonalization"`
}

TrackerCapabilityDescriptor contains only safe declarative tracker capabilities.

type TrackerCatalog added in v0.3.0

type TrackerCatalog struct {
	Entries     []TrackerCatalogEntry `json:"entries"`
	Unsupported []string              `json:"unsupported"`
}

TrackerCatalog is the complete settings manifest for supported trackers and the names of preserved inert entries that no implementation owns.

type TrackerCatalogDescriptor added in v0.3.0

type TrackerCatalogDescriptor struct {
	TrackerID           TrackerID                   `json:"trackerId"`
	DisplayName         string                      `json:"displayName"`
	Aliases             []string                    `json:"aliases,omitempty"`
	Family              string                      `json:"family"`
	BaseURL             string                      `json:"baseUrl"`
	UploadContentMode   string                      `json:"uploadContentMode"`
	DescriptionGroup    string                      `json:"descriptionGroup,omitempty"`
	MetadataLocale      string                      `json:"metadataLocale,omitempty"`
	ProjectorVersion    string                      `json:"projectorVersion"`
	PolicyFingerprint   WorkflowFingerprint         `json:"policyFingerprint"`
	Capabilities        TrackerCapabilityDescriptor `json:"capabilities"`
	ConfigurationFields []TrackerCatalogField       `json:"configurationFields,omitempty"`
}

TrackerCatalogDescriptor separates stable identity from mutable presentation data.

type TrackerCatalogEntry added in v0.3.0

type TrackerCatalogEntry struct {
	Name              string                `json:"name"`
	Family            string                `json:"family"`
	BaseURL           string                `json:"baseURL"`
	UploadContentMode string                `json:"uploadContentMode"`
	Fields            []TrackerCatalogField `json:"fields"`
	Configured        bool                  `json:"configured"`
	Default           bool                  `json:"default"`
}

TrackerCatalogEntry combines tracker implementation identity with its config schema.

type TrackerCatalogField added in v0.3.0

type TrackerCatalogField struct {
	Key        string `json:"key"`
	YAMLKey    string `json:"yamlKey"`
	Default    any    `json:"default"`
	Activation bool   `json:"activation"`
}

TrackerCatalogField describes one ordered tracker setting without exposing its current value.

type TrackerCatalogSnapshot added in v0.3.0

type TrackerCatalogSnapshot struct {
	ID             TrackerCatalogSnapshotID   `json:"id"`
	Revision       WorkflowRevision           `json:"revision"`
	CatalogVersion string                     `json:"catalogVersion"`
	Trackers       []TrackerCatalogDescriptor `json:"trackers"`
	Fingerprint    WorkflowFingerprint        `json:"fingerprint"`
	CreatedAt      time.Time                  `json:"createdAt" ts_type:"string"`
}

TrackerCatalogSnapshot is an immutable supported-tracker catalog.

func (TrackerCatalogSnapshot) Clone added in v0.3.0

Clone returns a detached tracker catalog snapshot.

func (TrackerCatalogSnapshot) ComputeFingerprint added in v0.3.0

func (s TrackerCatalogSnapshot) ComputeFingerprint() (WorkflowFingerprint, error)

ComputeFingerprint returns the normalized catalog fingerprint.

func (TrackerCatalogSnapshot) Normalize added in v0.3.0

Normalize returns a deterministic catalog ordered by stable tracker ID.

func (TrackerCatalogSnapshot) ResolveTrackerID added in v0.3.0

func (s TrackerCatalogSnapshot) ResolveTrackerID(value string) (TrackerID, bool)

ResolveTrackerID resolves a stable ID or explicit alias from this catalog.

func (TrackerCatalogSnapshot) Validate added in v0.3.0

func (s TrackerCatalogSnapshot) Validate() error

Validate verifies catalog identity, stable IDs, aliases, and fingerprints.

func (TrackerCatalogSnapshot) WithFingerprint added in v0.3.0

func (s TrackerCatalogSnapshot) WithFingerprint() (TrackerCatalogSnapshot, error)

WithFingerprint returns a normalized catalog with its fingerprint populated.

type TrackerCatalogSnapshotID added in v0.3.0

type TrackerCatalogSnapshotID string

TrackerCatalogSnapshotID identifies one immutable tracker catalog.

type TrackerCatalogSnapshotRef added in v0.3.0

type TrackerCatalogSnapshotRef struct {
	ID       TrackerCatalogSnapshotID `json:"id"`
	Revision WorkflowRevision         `json:"revision"`
}

TrackerCatalogSnapshotRef references one exact tracker catalog revision.

type TrackerConfigOverrides

type TrackerConfigOverrides struct {
	Anon    *bool
	Draft   *bool
	ModQ    *bool
	Channel *string
}

TrackerConfigOverrides supplies optional per-request tracker setting overrides.

type TrackerContentFailure added in v0.3.0

type TrackerContentFailure struct {
	Tracker string                    `json:"tracker"`
	Code    TrackerContentFailureCode `json:"code"`
	Message string                    `json:"message"`
}

TrackerContentFailure is sanitized tracker-scoped evidence that a required shared upload-content object failed before its adapter could run.

type TrackerContentFailureCode added in v0.3.0

type TrackerContentFailureCode string

TrackerContentFailureCode identifies one sanitized shared-content failure.

const (
	TrackerContentFailureScreenshotPreparation  TrackerContentFailureCode = "screenshot_preparation_failed"
	TrackerContentFailureDescriptionPreparation TrackerContentFailureCode = "description_preparation_failed"
	TrackerContentFailureImageHostUnavailable   TrackerContentFailureCode = "image_host_unavailable"
)

type TrackerDerivedFlag added in v0.3.0

type TrackerDerivedFlag struct {
	Key   string `json:"key"`
	Value bool   `json:"value"`
}

TrackerDerivedFlag is one non-secret finalized upload flag.

type TrackerDryRunDebugSection added in v0.2.4

type TrackerDryRunDebugSection struct {
	Title    string
	Endpoint string
	Payload  map[string]string
	Files    []TrackerDryRunFile
}

TrackerDryRunDebugSection describes one named diagnostic payload inside a dry-run preview. Payload and files use the same redaction and path-display rules as the top-level dry-run entry.

type TrackerDryRunDiagnostics added in v0.3.0

type TrackerDryRunDiagnostics struct {
	Duplicate DupeCheckResult
}

TrackerDryRunDiagnostics describes live-upload findings without changing dry-run payload readiness.

type TrackerDryRunEntry

type TrackerDryRunEntry struct {
	Tracker string
	Status  string
	Message string
	// Banned reports whether the normalized release group matched this tracker
	// during dry-run or review evaluation. It is diagnostic state and does not
	// mean the dry-run payload builder was skipped.
	Banned bool
	// BannedReason explains the matched banned group when Banned is true.
	BannedReason string
	// BannedCheckError carries a redacted banned-group refresh or cache error
	// for dry-run diagnostics when the banned state could not be determined.
	BannedCheckError        string
	ReleaseName             string
	OriginalReleaseName     string
	UploadReleaseName       string
	ReleaseNameChanged      bool
	ReleaseNameChangeReason string
	DescriptionGroup        string
	Description             string
	Endpoint                string
	EditionFeatures         []TrackerEditionFeature
	Payload                 map[string]string
	Files                   []TrackerDryRunFile
	// DebugSections carries optional staged diagnostics for trackers whose dry-run
	// preview needs to show more than one request or derived payload.
	DebugSections []TrackerDryRunDebugSection
	Questionnaire *TrackerQuestionnaire
	// RequiredActions lists preparation results requiring confirmation before upload execution.
	RequiredActions []RequiredAction
	ImageHost       ImageHostFeedback
	ContentFailure  *TrackerContentFailure
	Diagnostics     TrackerDryRunDiagnostics
}

type TrackerDryRunFile

type TrackerDryRunFile struct {
	Field   string
	Path    string
	Present bool
}

type TrackerDryRunReport added in v0.3.0

type TrackerDryRunReport struct {
	Questionnaire       []TrackerQuestionnaireRequirement `json:"questionnaire,omitempty"`
	TrackerID           TrackerID                         `json:"trackerId"`
	DisplayName         string                            `json:"displayName"`
	UploadReleaseName   string                            `json:"uploadReleaseName"`
	Status              StageStatus                       `json:"status"`
	Endpoint            string                            `json:"endpoint,omitempty"`
	Fields              []UploadPlanField                 `json:"fields,omitempty"`
	Files               []UploadPlanFile                  `json:"files,omitempty"`
	PreparedOperationID PublicResourceID                  `json:"preparedOperationId,omitempty"`
	TorrentArtifactID   PublicResourceID                  `json:"torrentArtifactId,omitempty"`
	TorrentFingerprint  WorkflowFingerprint               `json:"torrentFingerprint,omitempty"`
	SemanticFingerprint WorkflowFingerprint               `json:"semanticFingerprint"`
	ClientInjection     ClientInjectionOutcome            `json:"clientInjection"`
	Warnings            []string                          `json:"warnings,omitempty"`
	Failures            []WorkflowFailure                 `json:"failures,omitempty"`
	EditionFeatures     []TrackerEditionFeature           `json:"editionFeatures,omitempty"`
}

TrackerDryRunReport is one safe tracker-scoped dry-run outcome.

type TrackerDupeAssessment added in v0.3.0

type TrackerDupeAssessment struct {
	// Questionnaire contains candidate-bound questions from this exact assessment.
	Questionnaire []TrackerQuestionnaireRequirement `json:"questionnaire,omitempty"`
	// RequiresStaffToken blocks overrides until the owner explicitly attests possession.
	RequiresStaffToken bool `json:"requiresStaffToken,omitempty"`
	// StaffTokenConfirmed retains attestation for this projection; reprojecting clears it.
	// It records possession only, never the token contents.
	StaffTokenConfirmed   bool                     `json:"staffTokenConfirmed,omitempty"`
	TrackerID             TrackerID                `json:"trackerId"`
	UploadReleaseName     string                   `json:"uploadReleaseName"`
	ProjectionFingerprint WorkflowFingerprint      `json:"projectionFingerprint"`
	CriteriaFingerprint   WorkflowFingerprint      `json:"criteriaFingerprint"`
	Criteria              TrackerDuplicateCriteria `json:"criteria"`
	// TargetFingerprint binds the assessment to the proposed duplicate target.
	TargetFingerprint WorkflowFingerprint `json:"targetFingerprint"`
	// SearchFingerprint binds the assessment to the normalized search request.
	SearchFingerprint WorkflowFingerprint `json:"searchFingerprint"`
	// PolicyID identifies the duplicate policy that produced this result.
	PolicyID string `json:"policyId"`
	// PolicyFingerprint binds the assessment to the policy inputs.
	PolicyFingerprint WorkflowFingerprint `json:"policyFingerprint"`
	// EvidenceFingerprint identifies the retained search/evaluation evidence.
	EvidenceFingerprint WorkflowFingerprint `json:"evidenceFingerprint,omitempty"`
	// Search records safe completion and warning state for the tracker search.
	Search  DupeSearchEvidence    `json:"search"`
	Matches []DupeMatchProjection `json:"matches,omitempty"`
	// ReviewReasons describe target-level policy risks bound to this assessment.
	ReviewReasons   []DupeReason      `json:"reviewReasons,omitempty"`
	Decision        DupeDecision      `json:"decision"`
	Status          StageStatus       `json:"status"`
	RequiredActions []RequiredAction  `json:"requiredActions,omitempty"`
	Failures        []WorkflowFailure `json:"failures,omitempty"`
	CheckedAt       time.Time         `json:"checkedAt" ts_type:"string"`
	FreshUntil      time.Time         `json:"freshUntil" ts_type:"string"`
}

TrackerDupeAssessment is one retained projection-bound duplicate result.

type TrackerDuplicateCriteria added in v0.3.0

type TrackerDuplicateCriteria struct {
	Name        string               `json:"name,omitempty"`
	ProviderIDs []TrackerProviderID  `json:"providerIds,omitempty"`
	Category    TrackerTaxonomyValue `json:"category"`
	Type        TrackerTaxonomyValue `json:"type"`
	Resolution  TrackerTaxonomyValue `json:"resolution"`
	Source      TrackerTaxonomyValue `json:"source"`
	Container   TrackerTaxonomyValue `json:"container"`
	Codecs      []string             `json:"codecs,omitempty"`
	Season      int                  `json:"season,omitempty"`
	Episode     int                  `json:"episode,omitempty"`
	Date        string               `json:"date,omitempty"`
}

TrackerDuplicateCriteria is the sanitized semantic duplicate-query projection.

type TrackerDuplicateTarget added in v0.3.0

type TrackerDuplicateTarget struct {
	Evidence    DupeReleaseEvidence      `json:"evidence"`
	Comparisons []DupeComparisonEvidence `json:"comparisons,omitempty"`

	// TrackerSlot is opaque native slot evidence resolved from this prepared generation.
	TrackerSlot   string   `json:"trackerSlot,omitempty"`
	Names         []string `json:"names,omitempty"`
	Category      string   `json:"category,omitempty"`
	Type          string   `json:"type,omitempty"`
	Source        string   `json:"source,omitempty"`
	Provider      string   `json:"provider,omitempty"`
	ReleaseOrigin string   `json:"releaseOrigin,omitempty"`
	Resolution    string   `json:"resolution,omitempty"`
	Container     string   `json:"container,omitempty"`
	VideoCodec    string   `json:"videoCodec,omitempty"`
	VideoEncode   string   `json:"videoEncode,omitempty"`
	HDR           HDRFacts `json:"hdr"`
	Edition       string   `json:"edition,omitempty"`
	Region        string   `json:"region,omitempty"`
	ThreeD        string   `json:"threeD,omitempty"`
	Group         string   `json:"group,omitempty"`
	Repack        string   `json:"repack,omitempty"`
	Season        int      `json:"season,omitempty"`
	Episode       int      `json:"episode,omitempty"`
	Date          string   `json:"date,omitempty"`
	Pack          bool     `json:"pack"`
	SizeBytes     int64    `json:"sizeBytes,omitempty"`
	FileNames     []string `json:"fileNames,omitempty"`

	// ReleaseFeatures retain non-edition annotations without changing edition comparisons.
	ReleaseFeatures []ReleaseFeature `json:"releaseFeatures,omitempty"`
}

TrackerDuplicateTarget is the projection-bound proposed release used only for local duplicate policy evaluation.

type TrackerEditionFeature added in v0.4.1

type TrackerEditionFeature struct {
	Label    string `json:"label"`
	Category string `json:"category"`
	Selected bool   `json:"selected"`
	Evidence string `json:"evidence,omitempty"`
}

TrackerEditionFeature is a tracker-owned review option derived from prepared facts. Evidence is a safe, human-readable explanation; these options are not editable inputs.

type TrackerID added in v0.3.0

type TrackerID string

TrackerID is the stable tracker identity used by workflow contracts.

type TrackerLaneOutcome added in v0.3.0

type TrackerLaneOutcome struct {
	TrackerID   TrackerID           `json:"trackerId"`
	DisplayName string              `json:"displayName,omitempty"`
	Goal        WorkflowGoal        `json:"goal,omitempty"`
	Lifecycle   OperationLifecycle  `json:"lifecycle"`
	Disposition WorkflowDisposition `json:"disposition"`
	// UploadEligibility reports the retained downstream decision for this
	// tracker, so adapters never derive it from duplicate or media evidence.
	UploadEligibility UploadEligibility `json:"uploadEligibility,omitempty"`
	// UploadSkipReason explains a skipped eligibility and is empty otherwise.
	UploadSkipReason UploadSkipReason `json:"uploadSkipReason,omitempty"`
	// UploadSkipDetail is the retained backend message behind a skip, when the
	// reason alone would be too generic to act on.
	UploadSkipDetail string            `json:"uploadSkipDetail,omitempty"`
	Refs             WorkflowExactRefs `json:"refs"`
	RequiredActions  []RequiredAction  `json:"requiredActions,omitempty"`
	Failures         []WorkflowFailure `json:"failures,omitempty"`
	Retryable        bool              `json:"retryable"`
}

TrackerLaneOutcome is the canonical current result for one selected tracker.

type TrackerMatch

type TrackerMatch struct {
	ID        string
	TrackerID string
}

type TrackerMetadata

type TrackerMetadata struct {
	// ImportedScreenshotEvidence is collection-only. Source-cache persistence
	// must not retain it; canonical preparation captures the selected receipt.
	ImportedScreenshotEvidence *ImportedScreenshotEvidence `json:"-"`
	SourcePath                 string
	Tracker                    string
	TrackerID                  string
	TorrentURL                 string
	InfoHash                   string
	TMDBID                     int
	IMDBID                     int
	TVDBID                     int
	MALID                      int
	// Category is site-reported movie/TV evidence consumed only by canonical
	// external-identity resolution; unsupported values are ignored.
	Category      Category
	Description   string
	ImageURLs     []string
	ImagePreviews map[string]string
	Filename      string
	Matched       bool
	UpdatedAt     time.Time `ts_type:"string"`
}

type TrackerPolicyDecision added in v0.3.0

type TrackerPolicyDecision struct {
	Code     string `json:"code"`
	Decision string `json:"decision"`
	Blocking bool   `json:"blocking"`
	Message  string `json:"message,omitempty"`
	// NamingRole identifies the component affected by a naming policy outcome,
	// or "name" when an opaque whole name was rebuilt.
	NamingRole string `json:"namingRole,omitempty"`
	// NamingRuleID identifies the tracker naming rule that produced the outcome.
	NamingRuleID string `json:"namingRuleId,omitempty"`
	// Disposition is the backend-owned execution effect of a failed rule.
	Disposition RuleDisposition `json:"disposition,omitempty"`
	// EvidenceStatus states how completely the backend could evaluate the rule.
	EvidenceStatus MetadataEvidenceStatus `json:"evidenceStatus,omitempty"`
}

TrackerPolicyDecision is one deterministic tracker policy outcome.

type TrackerPreflightAssessment added in v0.3.0

type TrackerPreflightAssessment struct {
	ID               TrackerPreflightAssessmentID   `json:"id"`
	WorkflowID       WorkflowID                     `json:"workflowId"`
	Revision         WorkflowRevision               `json:"revision"`
	ProjectionSet    TrackerReleaseProjectionSetRef `json:"projectionSet"`
	Runtime          TrackerRuntimeSnapshotRef      `json:"runtime"`
	ExecutionMode    WorkflowExecutionMode          `json:"executionMode,omitempty"`
	InputFingerprint WorkflowFingerprint            `json:"inputFingerprint"`
	Results          []TrackerPreflightResult       `json:"results"`
	Status           StageStatus                    `json:"status"`
	CreatedAt        time.Time                      `json:"createdAt" ts_type:"string"`
	ExpiresAt        time.Time                      `json:"expiresAt" ts_type:"string"`
}

TrackerPreflightAssessment retains live evidence for one projection revision.

func (TrackerPreflightAssessment) Clone added in v0.3.0

Clone returns a detached tracker preflight assessment.

func (TrackerPreflightAssessment) Validate added in v0.3.0

func (s TrackerPreflightAssessment) Validate() error

Validate verifies projection lineage, freshness, and unique per-tracker results.

type TrackerPreflightAssessmentID added in v0.3.0

type TrackerPreflightAssessmentID string

TrackerPreflightAssessmentID identifies one immutable live preflight assessment.

type TrackerPreflightAssessmentRef added in v0.3.0

type TrackerPreflightAssessmentRef struct {
	ID       TrackerPreflightAssessmentID `json:"id"`
	Revision WorkflowRevision             `json:"revision"`
}

TrackerPreflightAssessmentRef references one exact preflight assessment revision.

type TrackerPreflightResult added in v0.3.0

type TrackerPreflightResult struct {
	TrackerID             TrackerID             `json:"trackerId"`
	State                 TrackerPreflightState `json:"state"`
	AuthReady             bool                  `json:"authReady"`
	ClaimsReady           bool                  `json:"claimsReady"`
	BannedGroupsReady     bool                  `json:"bannedGroupsReady"`
	RemoteMetadataReady   bool                  `json:"remoteMetadataReady"`
	ConfigFingerprint     WorkflowFingerprint   `json:"configFingerprint"`
	ProjectionFingerprint WorkflowFingerprint   `json:"projectionFingerprint"`
	RequiredActions       []RequiredAction      `json:"requiredActions,omitempty"`
	Failures              []WorkflowFailure     `json:"failures,omitempty"`
	AssessedAt            time.Time             `json:"assessedAt" ts_type:"string"`
	FreshUntil            time.Time             `json:"freshUntil" ts_type:"string"`
}

TrackerPreflightResult is one sanitized tracker live-readiness result.

type TrackerPreflightState added in v0.3.0

type TrackerPreflightState string

TrackerPreflightState identifies one time-sensitive tracker prerequisite.

const (
	// TrackerPreflightStateReady means all required live checks passed.
	TrackerPreflightStateReady TrackerPreflightState = "ready"
	// TrackerPreflightStateActionRequired means the owner must resolve an action.
	TrackerPreflightStateActionRequired TrackerPreflightState = "action_required"
	// TrackerPreflightStateRetryable means a transient check may be retried.
	TrackerPreflightStateRetryable TrackerPreflightState = "retryable"
	// TrackerPreflightStateFailed means a non-retryable prerequisite failed.
	TrackerPreflightStateFailed TrackerPreflightState = "failed"
	// TrackerPreflightStateExpired means retained live evidence is no longer fresh.
	TrackerPreflightStateExpired TrackerPreflightState = "expired"
)

type TrackerPreview

type TrackerPreview struct {
	Tracker         string
	TrackerID       string
	TorrentURL      string
	InfoHash        string
	TMDBID          int
	IMDBID          int
	TVDBID          int
	MALID           int
	Category        string
	Description     string
	DescriptionHTML string
	ImageURLs       []string
	ImagePreviews   map[string]string
	Filename        string
	Matched         bool
	UpdatedAt       string
}

type TrackerProjectionInstructionSnapshot added in v0.3.0

type TrackerProjectionInstructionSnapshot struct {
	ID           TrackerProjectionInstructionSnapshotID      `json:"id"`
	WorkflowID   WorkflowID                                  `json:"workflowId"`
	Revision     WorkflowRevision                            `json:"revision"`
	Instructions map[TrackerID]TrackerProjectionInstructions `json:"instructions"`
	Fingerprint  WorkflowFingerprint                         `json:"fingerprint"`
	CreatedAt    time.Time                                   `json:"createdAt" ts_type:"string"`
}

TrackerProjectionInstructionSnapshot retains tracker-local projection instructions.

func (TrackerProjectionInstructionSnapshot) Clone added in v0.3.0

Clone returns detached tracker projection instructions.

func (TrackerProjectionInstructionSnapshot) ComputeFingerprint added in v0.3.0

ComputeFingerprint returns the normalized tracker-projection instruction fingerprint.

func (TrackerProjectionInstructionSnapshot) Normalize added in v0.3.0

Normalize returns detached projection instructions keyed by normalized stable tracker ID. Blank IDs are omitted; IDs that collide after normalization return an error.

func (TrackerProjectionInstructionSnapshot) Validate added in v0.3.0

Validate verifies projection-instruction identity and fingerprint integrity.

func (TrackerProjectionInstructionSnapshot) WithFingerprint added in v0.3.0

WithFingerprint returns normalized projection instructions with their fingerprint populated.

type TrackerProjectionInstructionSnapshotID added in v0.3.0

type TrackerProjectionInstructionSnapshotID string

TrackerProjectionInstructionSnapshotID identifies tracker-scoped projection instructions.

type TrackerProjectionInstructionSnapshotRef added in v0.3.0

type TrackerProjectionInstructionSnapshotRef struct {
	ID       TrackerProjectionInstructionSnapshotID `json:"id"`
	Revision WorkflowRevision                       `json:"revision"`
}

TrackerProjectionInstructionSnapshotRef references exact tracker projection instructions.

type TrackerProjectionInstructions added in v0.3.0

type TrackerProjectionInstructions struct {
	UploadReleaseName WorkflowPatch[string] `json:"-"`
	// ConfirmedNameFingerprint binds a no-edit release-name confirmation to the
	// generated naming result without turning it into an upload-name override.
	// The server issues it after a valid review action; public input may only
	// retain an already-issued marker, never create confirmation authority.
	ConfirmedNameFingerprint WorkflowFingerprint `json:"confirmedNameFingerprint,omitempty"`
	// ScreenshotCount overrides the global fallback; zero disables that fallback.
	// Tracker ImageCount remains a minimum unless permitted imported references
	// replace an automatic count.
	ScreenshotCount *int `json:"screenshotCount,omitempty"`
	// ScreenshotCountIsDefault permits tracker policy to replace this automatic
	// count with imported references. Omitted and false keep the count explicit.
	ScreenshotCountIsDefault bool                   `json:"screenshotCountIsDefault,omitempty"`
	AdditionalNames          map[string]*string     `json:"additionalNames,omitempty"`
	Questionnaire            map[string]*string     `json:"questionnaire,omitempty"`
	TrackerConfig            TrackerConfigOverrides `json:"trackerConfig,omitempty"`
	TrackerSite              TrackerSiteOverrides   `json:"trackerSite,omitempty"`
}

TrackerProjectionInstructions contains optional tracker-local caller intent. Nil values use automatic resolution; pointed-to empty strings explicitly clear their field.

func (TrackerProjectionInstructions) MarshalJSON added in v0.3.0

func (i TrackerProjectionInstructions) MarshalJSON() ([]byte, error)

MarshalJSON preserves tracker projection instruction absence, null/reset, explicit empty names, and screenshot counts.

func (*TrackerProjectionInstructions) UnmarshalJSON added in v0.3.0

func (i *TrackerProjectionInstructions) UnmarshalJSON(payload []byte) error

UnmarshalJSON preserves tracker projection instruction field presence.

type TrackerProviderID added in v0.3.0

type TrackerProviderID struct {
	Provider string `json:"provider"`
	Value    string `json:"value"`
}

TrackerProviderID is one non-secret provider or tracker identifier used by a projection.

type TrackerQuestionnaire

type TrackerQuestionnaire struct {
	Tracker string
	Fields  []TrackerQuestionnaireField
}

type TrackerQuestionnaireField

type TrackerQuestionnaireField struct {
	// HDRGradeComparison requests conditional guidance beside the HDR analysis controls.
	HDRGradeComparison bool `json:"HDRGradeComparison,omitempty"`
	// NeedsReview requests correction even when a previous answer is nonempty or optional.
	NeedsReview bool `json:"NeedsReview,omitempty"`
	Key         string
	Label       string
	Kind        string
	Options     []string
	Value       string
	Placeholder string
	Help        string
	Required    bool
}

type TrackerQuestionnaireRequirement added in v0.3.0

type TrackerQuestionnaireRequirement struct {
	// HDRGradeComparison requests conditional guidance beside the HDR analysis controls.
	HDRGradeComparison bool `json:"hdrGradeComparison,omitempty"`
	// NeedsReview requests correction without making an optional value mandatory.
	NeedsReview bool `json:"needsReview,omitempty"`
	// Kind identifies the renderer; multiselect values use comma-separated option labels.
	Kind string `json:"kind,omitempty"`
	// Value is the current answer or display default for this field; QuestionnaireAnswers owns exact answer intent.
	Value    string   `json:"value,omitempty"`
	Help     string   `json:"help,omitempty"`
	Key      string   `json:"key"`
	Label    string   `json:"label"`
	Required bool     `json:"required"`
	Options  []string `json:"options,omitempty"`
}

TrackerQuestionnaireRequirement describes one non-secret tracker input requirement.

type TrackerReleaseName added in v0.3.0

type TrackerReleaseName struct {
	Role  TrackerReleaseNameRole `json:"role"`
	Value string                 `json:"value"`
}

TrackerReleaseName is one typed non-principal name-bearing value.

type TrackerReleaseNameRole added in v0.3.0

type TrackerReleaseNameRole string

TrackerReleaseNameRole describes an additional tracker name-bearing field.

const (
	// TrackerReleaseNameRoleAlternate is an alternate public display name.
	TrackerReleaseNameRoleAlternate TrackerReleaseNameRole = "alternate"
	// TrackerReleaseNameRoleScene is a tracker-native scene-name field.
	TrackerReleaseNameRoleScene TrackerReleaseNameRole = "scene"
	// TrackerReleaseNameRoleGroupTitle is a tracker group or edition title.
	TrackerReleaseNameRoleGroupTitle TrackerReleaseNameRole = "group_title"
	// TrackerReleaseNameRoleSearch is a duplicate-search-specific semantic name.
	TrackerReleaseNameRoleSearch TrackerReleaseNameRole = "search"
)

type TrackerReleaseProjection added in v0.3.0

type TrackerReleaseProjection struct {
	// TitleSearchEvidence retains tracker-scoped, generation-bound rule evidence.
	TitleSearchEvidence *TrackerTitleSearchEvidence `json:"titleSearchEvidence,omitempty"`
	// QuestionnaireAnswers owns exact tracker-scoped answers after projection instructions.
	// An empty object clears prior answers; nil identifies a legacy projection without this authority.
	QuestionnaireAnswers map[string]string        `json:"questionnaireAnswers,omitzero"`
	TrackerID            TrackerID                `json:"trackerId"`
	DisplayName          string                   `json:"displayName"`
	CanonicalReleaseName string                   `json:"canonicalReleaseName"`
	UploadReleaseName    string                   `json:"uploadReleaseName"`
	EditionFeatures      []TrackerEditionFeature  `json:"editionFeatures,omitempty"`
	AdditionalNames      []TrackerReleaseName     `json:"additionalNames,omitempty"`
	Taxonomy             TrackerTaxonomy          `json:"taxonomy"`
	ProviderIDs          []TrackerProviderID      `json:"providerIds,omitempty"`
	DuplicateCriteria    TrackerDuplicateCriteria `json:"duplicateCriteria"`
	// DuplicateTarget is the proposed release consumed by local duplicate policy.
	DuplicateTarget TrackerDuplicateTarget `json:"duplicateTarget"`
	// DuplicatePolicyID identifies the tracker policy used for duplicate evaluation.
	DuplicatePolicyID string `json:"duplicatePolicyId"`
	// DuplicatePolicyFingerprint binds the policy inputs to this projection.
	DuplicatePolicyFingerprint WorkflowFingerprint `json:"duplicatePolicyFingerprint"`
	// DuplicateTargetFingerprint binds the proposed-release fields to this projection.
	DuplicateTargetFingerprint WorkflowFingerprint `json:"duplicateTargetFingerprint"`
	// DuplicateSearchFingerprint identifies the normalized search request.
	DuplicateSearchFingerprint WorkflowFingerprint `json:"duplicateSearchFingerprint"`
	NamingPolicyID             string              `json:"namingPolicyId"`
	// NamingElementPolicyVersion identifies the shared structural policy
	// applied before the tracker-local naming policy.
	NamingElementPolicyVersion string `json:"namingElementPolicyVersion"`
	// EpisodeTitleMode records the normalized structural decision included in
	// NamingFingerprint.
	EpisodeTitleMode  EpisodeTitleMode        `json:"episodeTitleMode"`
	NamingFingerprint WorkflowFingerprint     `json:"namingFingerprint"`
	PolicyDecisions   []TrackerPolicyDecision `json:"policyDecisions,omitempty"`
	// WaivableRuleFingerprint identifies the normalized, tracker-local current set
	// of waivable failures. It is empty when no waiver is required.
	WaivableRuleFingerprint WorkflowFingerprint `json:"waivableRuleFingerprint,omitempty"`
	// RuleAuthorizationFingerprint records exact user authorization and is valid
	// only while it matches WaivableRuleFingerprint.
	RuleAuthorizationFingerprint WorkflowFingerprint               `json:"ruleAuthorizationFingerprint,omitempty"`
	Artifacts                    TrackerArtifactRequirements       `json:"artifacts"`
	DescriptionGroup             string                            `json:"descriptionGroup,omitempty"`
	MetadataLocale               string                            `json:"metadataLocale,omitempty"`
	Questionnaire                []TrackerQuestionnaireRequirement `json:"questionnaire,omitempty"`
	DerivedFlags                 []TrackerDerivedFlag              `json:"derivedFlags,omitempty"`
	InputFingerprint             WorkflowFingerprint               `json:"inputFingerprint"`
	CatalogFingerprint           WorkflowFingerprint               `json:"catalogFingerprint"`
	ConfigFingerprint            WorkflowFingerprint               `json:"configFingerprint"`
	ProjectorFingerprint         WorkflowFingerprint               `json:"projectorFingerprint"`
	CriteriaFingerprint          WorkflowFingerprint               `json:"criteriaFingerprint"`
	PreparedResourceFingerprint  WorkflowFingerprint               `json:"preparedResourceFingerprint,omitempty"`
	Readiness                    ReadinessStatus                   `json:"readiness"`
	DupeReady                    bool                              `json:"dupeReady"`
	UploadReady                  bool                              `json:"uploadReady"`
	RequiredActions              []RequiredAction                  `json:"requiredActions,omitempty"`
	Failures                     []WorkflowFailure                 `json:"failures,omitempty"`
}

TrackerReleaseProjection is one exact tracker-local interpretation of a release.

type TrackerReleaseProjectionSet added in v0.3.0

type TrackerReleaseProjectionSet struct {
	ID                TrackerReleaseProjectionSetID            `json:"id"`
	WorkflowID        WorkflowID                               `json:"workflowId"`
	Revision          WorkflowRevision                         `json:"revision"`
	Release           ReleaseSnapshotRef                       `json:"release"`
	ReleaseRef        ReleaseRef                               `json:"releaseRef"`
	Catalog           TrackerCatalogSnapshotRef                `json:"catalog"`
	Runtime           TrackerRuntimeSnapshotRef                `json:"runtime"`
	Selection         TrackerSelectionRef                      `json:"selection"`
	Instructions      *TrackerProjectionInstructionSnapshotRef `json:"instructions,omitempty"`
	Preflight         *TrackerPreflightAssessmentRef           `json:"preflight,omitempty"`
	ExecutionMode     WorkflowExecutionMode                    `json:"executionMode,omitempty"`
	InputFingerprint  WorkflowFingerprint                      `json:"inputFingerprint"`
	PolicyFingerprint WorkflowFingerprint                      `json:"policyFingerprint"`
	Projections       []TrackerReleaseProjection               `json:"projections"`
	Status            StageStatus                              `json:"status"`
	RequiredActions   []RequiredAction                         `json:"requiredActions,omitempty"`
	Failures          []WorkflowFailure                        `json:"failures,omitempty"`
	CreatedAt         time.Time                                `json:"createdAt" ts_type:"string"`
}

TrackerReleaseProjectionSet is an immutable projection for every selected tracker.

func (TrackerReleaseProjectionSet) Clone added in v0.3.0

Clone returns a detached tracker projection set.

func (TrackerReleaseProjectionSet) Validate added in v0.3.0

func (s TrackerReleaseProjectionSet) Validate() error

Validate verifies exact-generation projection lineage and readiness invariants.

type TrackerReleaseProjectionSetID added in v0.3.0

type TrackerReleaseProjectionSetID string

TrackerReleaseProjectionSetID identifies one immutable set of tracker projections.

type TrackerReleaseProjectionSetRef added in v0.3.0

type TrackerReleaseProjectionSetRef struct {
	ID       TrackerReleaseProjectionSetID `json:"id"`
	Revision WorkflowRevision              `json:"revision"`
}

TrackerReleaseProjectionSetRef references one exact tracker projection-set revision.

type TrackerRuleFailure

type TrackerRuleFailure struct {
	SourcePath string
	Tracker    string
	Rule       string
	Reason     string
	// Disposition is normalized from legacy severity values during migration/readback.
	Disposition RuleDisposition
	// Authorized records whether the exact waivable result was accepted for the stored operation.
	Authorized bool
	CreatedAt  time.Time `ts_type:"string"`
}

type TrackerRuntimeEntry added in v0.3.0

type TrackerRuntimeEntry struct {
	TrackerID            TrackerID           `json:"trackerId"`
	Configured           bool                `json:"configured"`
	Default              bool                `json:"default"`
	ConfigurationVersion string              `json:"configurationVersion"`
	ConfigFingerprint    WorkflowFingerprint `json:"configFingerprint"`
}

TrackerRuntimeEntry is safe effective runtime state without secret values.

type TrackerRuntimeSnapshot added in v0.3.0

type TrackerRuntimeSnapshot struct {
	ID                TrackerRuntimeSnapshotID  `json:"id"`
	Revision          WorkflowRevision          `json:"revision"`
	Catalog           TrackerCatalogSnapshotRef `json:"catalog"`
	RuntimeGeneration string                    `json:"runtimeGeneration"`
	Trackers          []TrackerRuntimeEntry     `json:"trackers"`
	Fingerprint       WorkflowFingerprint       `json:"fingerprint"`
	CreatedAt         time.Time                 `json:"createdAt" ts_type:"string"`
}

TrackerRuntimeSnapshot is one immutable safe runtime/configuration projection.

func (TrackerRuntimeSnapshot) Clone added in v0.3.0

Clone returns a detached tracker runtime snapshot.

func (TrackerRuntimeSnapshot) ComputeFingerprint added in v0.3.0

func (s TrackerRuntimeSnapshot) ComputeFingerprint() (WorkflowFingerprint, error)

ComputeFingerprint returns the normalized safe runtime fingerprint.

func (TrackerRuntimeSnapshot) Normalize added in v0.3.0

Normalize returns runtime entries ordered by normalized stable tracker ID.

func (TrackerRuntimeSnapshot) Validate added in v0.3.0

func (s TrackerRuntimeSnapshot) Validate() error

Validate verifies runtime lineage, unique trackers, and fingerprints.

func (TrackerRuntimeSnapshot) WithFingerprint added in v0.3.0

func (s TrackerRuntimeSnapshot) WithFingerprint() (TrackerRuntimeSnapshot, error)

WithFingerprint returns a normalized runtime snapshot with its fingerprint populated.

type TrackerRuntimeSnapshotID added in v0.3.0

type TrackerRuntimeSnapshotID string

TrackerRuntimeSnapshotID identifies one immutable safe runtime snapshot.

type TrackerRuntimeSnapshotRef added in v0.3.0

type TrackerRuntimeSnapshotRef struct {
	ID       TrackerRuntimeSnapshotID `json:"id"`
	Revision WorkflowRevision         `json:"revision"`
}

TrackerRuntimeSnapshotRef references one exact tracker runtime revision.

type TrackerSelection added in v0.3.0

type TrackerSelection struct {
	ID          TrackerSelectionID        `json:"id"`
	WorkflowID  WorkflowID                `json:"workflowId"`
	Revision    WorkflowRevision          `json:"revision"`
	Catalog     TrackerCatalogSnapshotRef `json:"catalog"`
	Runtime     TrackerRuntimeSnapshotRef `json:"runtime"`
	TrackerIDs  []TrackerID               `json:"trackerIds"`
	Fingerprint WorkflowFingerprint       `json:"fingerprint"`
	CreatedAt   time.Time                 `json:"createdAt" ts_type:"string"`
}

TrackerSelection is one immutable ordered tracker choice for a workflow.

func (TrackerSelection) Clone added in v0.3.0

Clone returns a detached tracker selection.

func (TrackerSelection) ComputeFingerprint added in v0.3.0

func (s TrackerSelection) ComputeFingerprint() (WorkflowFingerprint, error)

ComputeFingerprint returns the ordered tracker-selection fingerprint.

func (TrackerSelection) Normalize added in v0.3.0

func (s TrackerSelection) Normalize() (TrackerSelection, error)

Normalize returns an ordered selection with normalized, deduplicated stable IDs.

func (TrackerSelection) Validate added in v0.3.0

func (s TrackerSelection) Validate() error

Validate verifies selection lineage, unique trackers, and fingerprint integrity.

func (TrackerSelection) WithFingerprint added in v0.3.0

func (s TrackerSelection) WithFingerprint() (TrackerSelection, error)

WithFingerprint returns a normalized selection with its fingerprint populated.

type TrackerSelectionID added in v0.3.0

type TrackerSelectionID string

TrackerSelectionID identifies one immutable ordered tracker selection.

type TrackerSelectionRef added in v0.3.0

type TrackerSelectionRef struct {
	ID       TrackerSelectionID `json:"id"`
	Revision WorkflowRevision   `json:"revision"`
}

TrackerSelectionRef references one exact tracker selection revision.

type TrackerService

type TrackerService interface {
	Upload(ctx context.Context, subject UploadSubject) (UploadSummary, error)
	BuildPreparation(ctx context.Context, subject DescriptionSubject, trackers []string) (PreparationPreview, error)
	BuildUploadDryRun(ctx context.Context, subject UploadSubject, trackers []string) ([]TrackerDryRunEntry, error)
}

type TrackerSiteOverrides

type TrackerSiteOverrides struct {
	TIK TIKOverrides
}

TrackerSiteOverrides groups tracker-specific site override payloads.

type TrackerStateRepository added in v0.3.0

type TrackerStateRepository interface {
	SaveTrackerRuleFailures(ctx context.Context, sourcePath string, tracker string, failures []TrackerRuleFailure) error
	ListTrackerRuleFailuresByPath(ctx context.Context, path string) ([]TrackerRuleFailure, error)
	GetTrackerTimestamp(ctx context.Context, tracker string) (time.Time, error)
	SaveTrackerTimestamp(ctx context.Context, timestamp TrackerTimestamp) error
	SaveTrackerMetadata(ctx context.Context, metadata TrackerMetadata) error
	ListTrackerMetadataByPath(ctx context.Context, path string) ([]TrackerMetadata, error)
}

TrackerStateRepository persists tracker-derived metadata, refresh times, and atomic replacement of rule-failure sets.

type TrackerTaxonomy added in v0.3.0

type TrackerTaxonomy struct {
	Category   TrackerTaxonomyValue `json:"category"`
	Type       TrackerTaxonomyValue `json:"type"`
	Resolution TrackerTaxonomyValue `json:"resolution"`
	Source     TrackerTaxonomyValue `json:"source"`
	Container  TrackerTaxonomyValue `json:"container"`
	Codec      TrackerTaxonomyValue `json:"codec"`
}

TrackerTaxonomy contains finalized tracker-native classification values.

type TrackerTaxonomyValue added in v0.3.0

type TrackerTaxonomyValue struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

TrackerTaxonomyValue is one tracker-native taxonomy ID and display label.

type TrackerTimestamp

type TrackerTimestamp struct {
	Tracker   string
	UpdatedAt time.Time `ts_type:"string"`
}

type TrackerTitleSearchEvidence added in v0.4.1

type TrackerTitleSearchEvidence struct {
	Status                        MetadataEvidenceStatus `json:"status"`
	TitleFingerprint              WorkflowFingerprint    `json:"titleFingerprint"`
	ResultFingerprint             WorkflowFingerprint    `json:"resultFingerprint"`
	ConfigFingerprint             WorkflowFingerprint    `json:"configFingerprint"`
	PolicyID                      string                 `json:"policyId"`
	SubtitleInspectedTorrentCount int                    `json:"subtitleInspectedTorrentCount"`
	EnglishSubtitleTorrentCount   int                    `json:"englishSubtitleTorrentCount"`
	TorrentCount                  int                    `json:"torrentCount"`
	FreshUntil                    time.Time              `json:"freshUntil" ts_type:"string"`
	CheckedAt                     time.Time              `json:"checkedAt" ts_type:"string"`
}

TrackerTitleSearchEvidence records a complete-title lookup without exposing private tracker rows or download links. It grants no upload authority.

func (TrackerTitleSearchEvidence) Current added in v0.4.1

func (e TrackerTitleSearchEvidence) Current(identity ExternalIdentity) bool

Current reports whether complete lookup evidence belongs to the supplied prepared work. The owner must also check policy, configuration and freshness.

func (TrackerTitleSearchEvidence) HasEnglishSubtitleTorrent added in v0.4.1

func (e TrackerTitleSearchEvidence) HasEnglishSubtitleTorrent(identity ExternalIdentity) bool

HasEnglishSubtitleTorrent requires a positively inspected subtitle match for this prepared work.

func (TrackerTitleSearchEvidence) HasOtherTorrent added in v0.4.1

func (e TrackerTitleSearchEvidence) HasOtherTorrent(identity ExternalIdentity) bool

HasOtherTorrent proves a positive title match even when pagination did not finish. Incomplete searches can never prove absence. Owners still validate configuration, policy and freshness before retaining the evidence.

func (TrackerTitleSearchEvidence) NoEnglishSubtitleTorrent added in v0.4.1

func (e TrackerTitleSearchEvidence) NoEnglishSubtitleTorrent(identity ExternalIdentity) bool

NoEnglishSubtitleTorrent requires complete inspection of every title-wide result.

type TrackerValidationSubject added in v0.3.0

type TrackerValidationSubject struct {
	// ImportedScreenshotEvidence contains only exact-generation accepted references.
	ImportedScreenshotEvidence *ImportedScreenshotEvidence `json:",omitempty"`
	// FinalizedUploadName is the resolved tracker-local name, separate from canonical naming facts.
	FinalizedUploadName        string
	VideoEncoder               string
	TitleSearchEvidence        TrackerTitleSearchEvidence
	LanguageFacts              LanguageFacts
	Tracker                    string
	EffectiveMetadata          EffectiveMetadata
	ManualLanguages            ManualLanguageFacts
	HardcodedSubs              bool
	HardcodedSubtitleLanguages []string
	HardcodedSubtitleCoverage  []SubtitleLanguageCoverage
	SourcePath                 string
	VideoPath                  string
	FileList                   []string
	SourceSize                 int64
	DiscType                   string
	Scene                      bool
	SceneNFOReady              bool
	SceneRenamed               bool
	SceneRenamedReason         string
	PersonalRelease            bool
	Release                    ReleaseInfo
	ReleaseName                string
	ReleaseNameNoTag           string
	Tag                        string
	Identity                   ExternalIdentity
	ProviderMetadata           SourceScopedMetadata
	AudioLanguages             []string
	SubtitleLanguages          []string
	SeasonInt                  int
	EpisodeInt                 int
	MultipleEpisodes           bool
	SeasonStr                  string
	EpisodeStr                 string
	TVPack                     bool
	DailyEpisodeDate           string
	AnimeKnown                 bool
	Anime                      bool
	EpisodeTitle               string
	EpisodeOverview            string
	Disc                       DiscFacts
	Type                       string
	Source                     string
	Container                  string
	Audio                      string
	Channels                   string
	HasCommentary              bool
	Is3D                       string
	BitDepth                   string
	VideoCodec                 string
	VideoEncode                string
	HasEncodeSettings          bool
	HDRFacts                   HDRFacts
	HDR                        string
	UHD                        string
	Distributor                string
	Region                     string
	ReleaseFeatures            []ReleaseFeature
	// EditionDisplay preserves previously rendered automatic annotation wording for display only.
	// Never use it for edition identity, validation mappings, or duplicate comparison.
	EditionDisplay         []EditionDisplayPart
	EditionSet             string
	Cut                    string
	Presentation           string
	Edition                string
	Repack                 string
	WebDV                  bool
	Service                string
	ServiceLongName        string
	StreamOptimized        int
	Assessments            ReleaseAssessments
	QuestionnaireAnswers   map[string]string
	TrackerConfigOverrides TrackerConfigOverrides
	TrackerSiteOverrides   TrackerSiteOverrides
	ReleaseNameOverrides   ReleaseNameOverrides
	// DescriptionOverride is the description selected for Tracker.
	DescriptionOverride string
	// DescriptionGroupsFinal distinguishes pending description work from final
	// evidence that required manual content is absent.
	DescriptionGroupsFinal      bool
	MediaInfoJSONReady          bool
	MediaInfoTextReady          bool
	DVDVOBMediaInfoReady        bool
	BDInfoReady                 bool
	PreparedResourceFingerprint string
	PackageFacts                PackageFacts
	MediaFileFacts              MediaFileFacts
	AssetFacts                  AssetFacts
	AvailabilityFacts           AvailabilityFacts
	ProvenanceFacts             ProvenanceFacts
}

TrackerValidationSubject contains only immutable canonical facts, projected tracker answers, and prepared-resource readiness used by side-effect-free pre-duplicate validation.

func NewTrackerValidationSubject added in v0.3.0

func NewTrackerValidationSubject(subject UploadSubject, tracker string) TrackerValidationSubject

NewTrackerValidationSubject projects an upload subject into the detached pre-duplicate validation contract for one tracker.

func NewTrackerValidationSubjectFromRuleSubject added in v0.3.0

func NewTrackerValidationSubjectFromRuleSubject(subject RuleSubject, tracker string) TrackerValidationSubject

NewTrackerValidationSubjectFromRuleSubject preserves the legacy generic-rule entry point while routing custom checks through the validation contract.

func (TrackerValidationSubject) EditionLabel added in v0.4.0

func (s TrackerValidationSubject) EditionLabel() string

EditionLabel returns the same finalized label used by upload payloads, so preflight validation evaluates the exact cut, edition, and presentation facts.

type UniqueIDStatus added in v0.3.0

type UniqueIDStatus string

UniqueIDStatus records the concrete MediaInfo unique-ID assessment.

const (
	// UniqueIDStatusUnknown means preparation has not established the fact.
	UniqueIDStatusUnknown UniqueIDStatus = "unknown"
	// UniqueIDStatusNotApplicable means the source does not require this evidence.
	UniqueIDStatusNotApplicable UniqueIDStatus = "not_applicable"
	// UniqueIDStatusPresent means required unique-ID evidence is present.
	UniqueIDStatusPresent UniqueIDStatus = "present"
	// UniqueIDStatusMissing means required unique-ID evidence is absent.
	UniqueIDStatusMissing UniqueIDStatus = "missing"
)

type UnsupportedCorrectionVersionError added in v0.3.2

type UnsupportedCorrectionVersionError struct{ Version uint }

UnsupportedCorrectionVersionError reports a payload that this binary cannot mutate.

func (*UnsupportedCorrectionVersionError) Error added in v0.3.2

func (*UnsupportedCorrectionVersionError) Unwrap added in v0.3.2

type UploadApproval deprecated added in v0.3.0

type UploadApproval struct {
	ActionID         RequiredActionID      `json:"actionId"`
	DryRun           UploadDryRunResultRef `json:"dryRun"`
	InputFingerprint WorkflowFingerprint   `json:"inputFingerprint"`
}

UploadApproval binds submission permission to one exact reviewed dry run.

Deprecated: final upload approval is no longer required by runtime workflows.

type UploadDryRunResult added in v0.3.0

type UploadDryRunResult struct {
	ID               UploadDryRunResultID           `json:"id"`
	WorkflowID       WorkflowID                     `json:"workflowId"`
	Revision         WorkflowRevision               `json:"revision"`
	ProjectionSet    TrackerReleaseProjectionSetRef `json:"projectionSet"`
	Dupes            DupeAssessmentRef              `json:"dupes"`
	TrackerApproval  *TrackerApprovalSnapshotRef    `json:"trackerApproval,omitempty"`
	Media            MediaArtifactSetRef            `json:"media"`
	Descriptions     DescriptionSetRef              `json:"descriptions"`
	InputFingerprint WorkflowFingerprint            `json:"inputFingerprint"`
	NoSeed           bool                           `json:"noSeed"`
	TrackerIDs       []TrackerID                    `json:"trackerIds"`
	Reports          []TrackerDryRunReport          `json:"reports"`
	SucceededCount   int                            `json:"succeededCount"`
	FailedCount      int                            `json:"failedCount"`
	SkippedCount     int                            `json:"skippedCount"`
	Status           StageStatus                    `json:"status"`
	CreatedAt        time.Time                      `json:"createdAt" ts_type:"string"`
}

UploadDryRunResult retains one report per applicable tracker.

func (UploadDryRunResult) Clone added in v0.3.0

Clone returns a detached direct dry-run result.

func (UploadDryRunResult) Validate added in v0.3.0

func (s UploadDryRunResult) Validate() error

Validate verifies exact dry-run lineage and safe terminal tracker reports.

type UploadDryRunResultID added in v0.3.0

type UploadDryRunResultID string

UploadDryRunResultID identifies one immutable direct dry-run result.

type UploadDryRunResultRef added in v0.3.0

type UploadDryRunResultRef struct {
	ID       UploadDryRunResultID `json:"id"`
	Revision WorkflowRevision     `json:"revision"`
}

UploadDryRunResultRef references one exact dry-run result.

type UploadEligibility added in v0.3.5

type UploadEligibility string

UploadEligibility reports whether retained evidence keeps one tracker in the downstream media, description, and upload set.

const (
	// UploadEligibilityUnknown means retained evidence cannot decide yet.
	UploadEligibilityUnknown UploadEligibility = "unknown"
	// UploadEligibilityEligible means retained evidence keeps the tracker.
	UploadEligibilityEligible UploadEligibility = "eligible"
	// UploadEligibilitySkipped means retained evidence excludes the tracker.
	UploadEligibilitySkipped UploadEligibility = "skipped"
)

type UploadImageHostAttemptResult added in v0.3.0

type UploadImageHostAttemptResult struct {
	Host       string
	UsageScope string
	Trackers   []string
	Fallback   bool
	Links      []UploadedImageLink
	Failure    *UploadImageHostFailure
}

UploadImageHostAttemptResult retains one exact scheduled host/scope attempt, including failures later recovered by fallback.

type UploadImageHostFailure

type UploadImageHostFailure struct {
	Host       string
	UsageScope string
	Trackers   []string
	Message    string
}

UploadImageHostFailure describes a single host-level image upload failure returned in UploadImagesResult when one or more target hosts fail. Host is the failed image host name. UsageScope is the upload scope targeted for that host. Trackers lists trackers blocked by this host failure. Message contains the host failure reason.

type UploadImagesResult

type UploadImagesResult struct {
	Links       []UploadedImageLink
	Failures    []UploadImageHostFailure
	FailedHosts []string
	Attempts    []UploadImageHostAttemptResult
}

UploadImagesResult aggregates image upload outcomes across target hosts. Links contains successfully uploaded image links and is populated when one or more host uploads succeed. Failures contains terminal host-level failures that still block one or more trackers after fallback attempts. FailedHosts contains every host whose attempt failed, including failures recovered by a fallback, so later workflow stages can avoid retrying them.

type UploadLedgerRepository added in v0.3.0

type UploadLedgerRepository interface {
	ListUploadHistoryByPath(ctx context.Context, sourcePath string) ([]UploadRecord, error)
	CreateUploadRecord(ctx context.Context, record UploadRecord) error
	UpdateLatestUploadRecordStatus(ctx context.Context, sourcePath string, tracker string, status string) error
}

UploadLedgerRepository owns upload-attempt creation, latest-record status transitions, and canonical newest-first history queries.

type UploadOptions

type UploadOptions struct {
	RunLogLevel     string
	Screens         int
	NoSeed          bool
	SkipAutoTorrent bool
	OnlyID          bool
	KeepFolder      bool
	KeepImages      bool
	// CaptureDVDMenus requests automatic menu capture for DVD inputs before review or upload.
	CaptureDVDMenus bool
	// HDRComparisonSelection binds an explicitly selected comparison source to HDR analysis.
	HDRComparisonSelection *HDRComparisonSelection
	// HDRAnalysis requests local HDR analysis before upload.
	HDRAnalysis *HDRAnalysisRequest
	// AudioAnalysis requests local waveform/spectrogram and amplitude statistics generation before any upload side effects.
	AudioAnalysis bool
	// AudioTracks is primary, all, or a comma-separated list of one-based audio ordinals.
	AudioTracks string
	// AudioImages is both, waveform, or spectrogram.
	AudioImages     string
	InteractionMode InteractionMode
}

UploadOptions contains per-run preparation and upload choices. The invoked operation, rather than a mode flag, determines whether trackers are submitted.

type UploadPlan added in v0.3.0

type UploadPlan struct {
	ID               UploadPlanID                   `json:"id"`
	WorkflowID       WorkflowID                     `json:"workflowId"`
	Revision         WorkflowRevision               `json:"revision"`
	Release          ReleaseSnapshotRef             `json:"release"`
	ReleaseRef       ReleaseRef                     `json:"releaseRef"`
	ProjectionSet    TrackerReleaseProjectionSetRef `json:"projectionSet"`
	Dupes            DupeAssessmentRef              `json:"dupes"`
	TrackerApproval  *TrackerApprovalSnapshotRef    `json:"trackerApproval,omitempty"`
	Media            *MediaArtifactSetRef           `json:"media,omitempty"`
	Descriptions     *DescriptionSetRef             `json:"descriptions,omitempty"`
	InputFingerprint WorkflowFingerprint            `json:"inputFingerprint"`
	Trackers         []UploadPlanTracker            `json:"trackers"`
	Status           StageStatus                    `json:"status"`
	SingleUse        bool                           `json:"singleUse"`
	CreatedAt        time.Time                      `json:"createdAt" ts_type:"string"`
	ExpiresAt        time.Time                      `json:"expiresAt" ts_type:"string"`
}

UploadPlan is a safe projection of exact retained private prepared operations.

func (UploadPlan) Clone added in v0.3.0

func (s UploadPlan) Clone() (UploadPlan, error)

Clone returns a detached upload-plan projection.

func (UploadPlan) Validate added in v0.3.0

func (s UploadPlan) Validate() error

Validate verifies exact reviewed dependencies and single-use expiry semantics.

type UploadPlanField added in v0.3.0

type UploadPlanField struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

UploadPlanField is one ordered sanitized request field from a retained operation.

type UploadPlanFile added in v0.3.0

type UploadPlanFile struct {
	Field   string `json:"field"`
	Present bool   `json:"present"`
}

UploadPlanFile reports file attachment presence without exposing local paths.

type UploadPlanID added in v0.3.0

type UploadPlanID string

UploadPlanID identifies one retained upload plan's safe public projection.

type UploadPlanTracker added in v0.3.0

type UploadPlanTracker struct {
	Questionnaire          []TrackerQuestionnaireRequirement `json:"questionnaire,omitempty"`
	TrackerID              TrackerID                         `json:"trackerId"`
	DisplayName            string                            `json:"displayName"`
	UploadReleaseName      string                            `json:"uploadReleaseName"`
	Taxonomy               TrackerTaxonomy                   `json:"taxonomy"`
	DescriptionGroup       string                            `json:"descriptionGroup,omitempty"`
	Endpoint               string                            `json:"endpoint,omitempty"`
	Fields                 []UploadPlanField                 `json:"fields,omitempty"`
	Files                  []UploadPlanFile                  `json:"files,omitempty"`
	Eligible               bool                              `json:"eligible"`
	Status                 StageStatus                       `json:"status,omitempty"`
	ClientInjectionStatus  StageStatus                       `json:"clientInjectionStatus,omitempty"`
	ClientInjectionMessage string                            `json:"clientInjectionMessage,omitempty"`
	Warnings               []string                          `json:"warnings,omitempty"`
	RequiredActions        []RequiredAction                  `json:"requiredActions,omitempty"`
	Failures               []WorkflowFailure                 `json:"failures,omitempty"`
	PreparedOperationID    PublicResourceID                  `json:"preparedOperationId,omitempty"`
	TorrentArtifactID      PublicResourceID                  `json:"torrentArtifactId,omitempty"`
	TorrentFingerprint     WorkflowFingerprint               `json:"torrentFingerprint,omitempty"`
	ClientFailureCode      OperationFailureCode              `json:"clientFailureCode,omitempty"`
	SemanticFingerprint    WorkflowFingerprint               `json:"semanticFingerprint"`
	EditionFeatures        []TrackerEditionFeature           `json:"editionFeatures,omitempty"`
}

UploadPlanTracker is the sanitized semantic projection of one retained prepared operation.

type UploadProgressReporter

type UploadProgressReporter func(update UploadProgressUpdate)

UploadProgressReporter receives synchronous progress notifications from an upload context.

type UploadProgressUpdate

type UploadProgressUpdate struct {
	// SourcePath is the host filesystem release path.
	SourcePath string `json:"sourcePath"`
	// Tracker identifies the tracker when the task is tracker-specific.
	Tracker string `json:"tracker"`
	// Task is the stable progress operation identifier.
	Task string `json:"task"`
	// Status is the stable lifecycle state for Task.
	Status string `json:"status"`
	// Message contains sanitized user-facing progress detail.
	Message string `json:"message"`
	// CompletedPieces is the number of torrent pieces hashed so far.
	CompletedPieces int `json:"completedPieces"`
	// TotalPieces is the total number of torrent pieces to hash.
	TotalPieces int `json:"totalPieces"`
	// Percent is integer completion percentage from 0 through 100.
	Percent int `json:"percent"`
	// HashRateMiB is the current hashing throughput in MiB per second.
	HashRateMiB float64 `json:"hashRateMiB"`
	// Timestamp is the event time serialized by the producer.
	Timestamp string `json:"timestamp"`
}

UploadProgressUpdate describes one source- and tracker-scoped upload progress event.

type UploadRecord

type UploadRecord struct {
	Tracker    string
	Status     string
	CreatedAt  time.Time `ts_type:"string"`
	SourcePath string
}

type UploadReleaseWorkflowImagesRequest added in v0.3.0

type UploadReleaseWorkflowImagesRequest struct {
	ReleaseWorkflowCommandContext
	Media       MediaArtifactSetRef `json:"media"`
	ArtifactIDs []PublicResourceID  `json:"artifactIds,omitempty"`
	Host        string              `json:"host,omitempty"`
}

UploadReleaseWorkflowImagesRequest hosts selected artifacts for exact media lineage.

func (UploadReleaseWorkflowImagesRequest) Validate added in v0.3.0

Validate verifies exact media and optional compatibility add-host intent. Empty artifact IDs mean every currently selected local artifact. Empty host means backend-derived required host planning.

type UploadReleaseWorkflowRequest added in v0.3.0

type UploadReleaseWorkflowRequest struct {
	ReleaseWorkflowCommandContext
	NoSeed     bool        `json:"noSeed"`
	TrackerIDs []TrackerID `json:"trackerIds,omitempty"`
}

UploadReleaseWorkflowRequest directly prepares and executes eligible trackers.

func (UploadReleaseWorkflowRequest) Validate added in v0.3.0

func (r UploadReleaseWorkflowRequest) Validate() error

Validate verifies exact workflow authority.

type UploadResult added in v0.3.0

type UploadResult struct {
	ID               UploadResultID                 `json:"id"`
	WorkflowID       WorkflowID                     `json:"workflowId"`
	Revision         WorkflowRevision               `json:"revision"`
	ProjectionSet    TrackerReleaseProjectionSetRef `json:"projectionSet"`
	Dupes            DupeAssessmentRef              `json:"dupes"`
	TrackerApproval  *TrackerApprovalSnapshotRef    `json:"trackerApproval,omitempty"`
	Media            MediaArtifactSetRef            `json:"media"`
	Descriptions     DescriptionSetRef              `json:"descriptions"`
	InputFingerprint WorkflowFingerprint            `json:"inputFingerprint"`
	Results          []UploadTrackerResult          `json:"results"`
	Status           StageStatus                    `json:"status"`
	CreatedAt        time.Time                      `json:"createdAt" ts_type:"string"`
}

UploadResult retains terminal tracker outcomes bound to exact workflow inputs.

func (UploadResult) Clone added in v0.3.0

func (s UploadResult) Clone() (UploadResult, error)

Clone returns a detached upload result.

func (UploadResult) Validate added in v0.3.0

func (s UploadResult) Validate() error

Validate verifies upload-result lineage and terminal tracker outcomes.

type UploadResultID added in v0.3.0

type UploadResultID string

UploadResultID identifies one immutable upload execution result.

type UploadResultRef added in v0.3.0

type UploadResultRef struct {
	ID       UploadResultID   `json:"id"`
	Revision WorkflowRevision `json:"revision"`
}

UploadResultRef references one exact upload-result revision.

type UploadSkipReason added in v0.3.5

type UploadSkipReason string

UploadSkipReason is the backend-owned structured cause for excluding one tracker from downstream work. Adapters render it without matching messages.

const (
	// UploadSkipReasonNotReady means the projection is not upload ready.
	UploadSkipReasonNotReady UploadSkipReason = "not_ready"
	// UploadSkipReasonDuplicateFound means retained duplicate evidence blocks
	// upload and the owner has not accepted the risk.
	UploadSkipReasonDuplicateFound UploadSkipReason = "duplicate_found"
	// UploadSkipReasonDuplicateCheckFailed means the duplicate search failed.
	UploadSkipReasonDuplicateCheckFailed UploadSkipReason = "duplicate_check_failed"
	// UploadSkipReasonTrackerNotApprovedInGate means a post-dupe approval gate
	// left the tracker out of the approved set. WebUI stage controls never
	// produce this reason.
	UploadSkipReasonTrackerNotApprovedInGate UploadSkipReason = "tracker_not_approved_in_gate"
	// UploadSkipReasonImageHostingFailed means required image hosting failed.
	UploadSkipReasonImageHostingFailed UploadSkipReason = "image_hosting_failed"
	// UploadSkipReasonDescriptionSkipped means the retained description outcome
	// skipped the tracker.
	UploadSkipReasonDescriptionSkipped UploadSkipReason = "description_skipped"
	// UploadSkipReasonDescriptionFailed means the tracker requires a
	// description and the retained outcome is missing or did not complete, so
	// the upload plan blocks the tracker.
	UploadSkipReasonDescriptionFailed UploadSkipReason = "description_failed"
	// UploadSkipReasonUploadPreparationFailed means the retained dry-run report
	// did not produce a ready tracker operation.
	UploadSkipReasonUploadPreparationFailed UploadSkipReason = "upload_preparation_failed"
	// UploadSkipReasonUploadPreparationSkipped means the retained dry-run report
	// skipped the tracker, for example when its torrent would require rehashing.
	UploadSkipReasonUploadPreparationSkipped UploadSkipReason = "upload_preparation_skipped"
)

type UploadSubject added in v0.3.0

type UploadSubject struct {
	// SuppressImportedScreenshotReferences is operation-owned selection policy, never canonical metadata.
	SuppressImportedScreenshotReferences map[string]bool `json:"-"`

	// TrackerDuplicateReviewCandidates is server-owned, fresh assessment context for comparison questions.
	// It is never populated from public upload input or canonical prepared facts.
	TrackerDuplicateReviewCandidates map[string][]DupeMatchProjection `json:"-"`

	// TrackerHDRArtifacts retains server-owned selected image associations from the exact description snapshot.
	TrackerHDRArtifacts map[string][]HDRArtifactEvidence `json:"-"`

	VideoEncoder               string
	MediaFileFacts             MediaFileFacts
	StaffUploadTokens          map[string]StaffUploadToken `json:"-"`
	TrackerTitleSearchEvidence map[string]TrackerTitleSearchEvidence
	LanguageFacts              LanguageFacts
	// SourceIdentity is private verified source evidence used to derive exact
	// submission and media reuse identities. It must not enter transport JSON.
	SourceIdentity SourceContentIdentity `json:"-"`
	// SourceManifest retains the verified local state for final consumption checks.
	SourceManifest SourceManifest `json:"-"`
	// SubmissionContentIdentity is finalized from the exact torrent inclusion
	// scope and freshly verified local bytes before tracker submission.
	SubmissionContentIdentity  SubmissionContentIdentity `json:"-"`
	EffectiveMetadata          EffectiveMetadata
	ManualLanguages            ManualLanguageFacts
	HardcodedSubs              bool
	HardcodedSubtitleLanguages []string
	HardcodedSubtitleCoverage  []SubtitleLanguageCoverage
	MediaBinding               PreparedMediaBinding
	SourcePath                 string
	Paths                      []string
	DiscType                   string
	VideoPath                  string
	FileList                   []string
	SourceSize                 int64
	MediaInfoJSONPath          string
	MediaInfoTextPath          string
	DVDVOBMediaInfoText        string
	Scene                      bool
	SceneName                  string
	SceneNFOPath               string
	SceneRenamed               bool
	SceneRenamedReason         string
	DescriptionGroups          []DescriptionBuilderGroup
	// DescriptionGroupsFinal distinguishes retained description output from
	// pre-description subjects whose content may still be generated.
	DescriptionGroupsFinal bool
	Trackers               []string
	Options                UploadOptions
	TrackersRemove         []string
	MatchedTrackers        []string
	Tag                    string
	Release                ReleaseInfo
	DescriptionOverride    string
	TrackerConfigOverrides TrackerConfigOverrides
	TrackerSiteOverrides   TrackerSiteOverrides
	ImageHostOverrides     ImageHostOverrides
	DescriptionTemplate    string
	PersonalRelease        bool
	// PersonalReleaseOverride retains an explicit per-upload choice so tracker
	// group defaults can distinguish Auto from an explicit true or false value.
	PersonalReleaseOverride *bool
	InfoHash                string
	TrackerIDs              map[string]string
	TrackerData             []TrackerMetadata
	CrossSeedTorrents       []UploadedTorrent
	ClientTorrentPath       string
	// ClientTorrentDataVerified reports that ClientTorrentPath and InfoHash came
	// from a complete client record bound to the prepared source path.
	ClientTorrentDataVerified bool
	TorrentPath               string
	ArrReleaseGroup           string
	ReleaseNameOverrides      ReleaseNameOverrides
	NamePresentation          ReleaseNamePresentation
	// GeneratedName is the exact prepared generation's structured automatic name.
	GeneratedName               *ReleaseNameDocument
	TrackerQuestionnaireAnswers map[string]map[string]string
	SeasonInt                   int
	EpisodeInt                  int
	MultipleEpisodes            bool
	SeasonStr                   string
	EpisodeStr                  string
	TVDBAiredDate               string
	TVDBAirsTime                string
	TVDBAirsTimezone            string
	TVPack                      bool
	DailyEpisodeDate            string
	AnimeKnown                  bool
	Anime                       bool
	EpisodeTitle                string
	EpisodeOverview             string
	SelectedBDMVPlaylists       []PlaylistInfo
	Identity                    ExternalIdentity
	ProviderMetadata            SourceScopedMetadata
	Disc                        DiscFacts
	Discs                       []DiscEvidenceResource
	AudioLanguages              []string
	SubtitleLanguages           []string
	Container                   string
	Audio                       string
	Channels                    string
	HasCommentary               bool
	Is3D                        string
	Source                      string
	Type                        string
	UHD                         string
	HDR                         string
	HDRFacts                    HDRFacts
	Distributor                 string
	Region                      string
	VideoCodec                  string
	VideoEncode                 string
	HasEncodeSettings           bool
	BitDepth                    string
	ReleaseFeatures             []ReleaseFeature
	// EditionDisplay preserves previously rendered automatic annotation wording for display only.
	// Never use it for edition identity, validation mappings, or duplicate comparison.
	EditionDisplay   []EditionDisplayPart
	EditionSet       string
	Cut              string
	Presentation     string
	Edition          string
	Repack           string
	WebDV            bool
	Assessments      ReleaseAssessments
	StreamOptimized  int
	Service          string
	ServiceLongName  string
	Filename         string
	ReleaseName      string
	ReleaseNameNoTag string
	ReleaseNameClean string
	// AlternateTitle is the finalized alternate from this subject's prepared naming facts.
	// It may include an "AKA " prefix.
	// Empty means no alternate was selected; NamePresentation controls omission.
	AlternateTitle string
	// GeneratedReleaseNames contains canonical structural alternatives. Empty
	// variants mean ReleaseName must remain exact.
	GeneratedReleaseNames GeneratedReleaseNameVariants
	BlockedTrackers       map[string][]TrackerBlockReason
	TrackerRuleFailures   map[string][]RuleFailure
	// RehashedTrackers identifies uploads whose selected base torrent required
	// regeneration so tracker execution can queue them after reusable artifacts.
	RehashedTrackers []string
	// ExactMedia, when non-nil, constrains description/image preparation to the
	// retained workflow-owned revision instead of repository discovery.
	ExactMedia *ExactMediaAssets
}

TrackerSubject is the tracker module's operation-owned source, resource, instruction, and prerequisite view. It excludes preparation diagnostics, resolver evidence, cache freshness, and client-search implementation state.

func (UploadSubject) CanonicalSeasonEpisode added in v0.3.0

func (s UploadSubject) CanonicalSeasonEpisode() (int, int)

CanonicalSeasonEpisode returns the provider-resolved TV season/episode used by tracker operations.

func (UploadSubject) CurrentImportedScreenshotEvidence added in v0.4.1

func (s UploadSubject) CurrentImportedScreenshotEvidence() *ImportedScreenshotEvidence

CurrentImportedScreenshotEvidence returns detached receipts only from the exact prepared source and generation. Source-level caches and legacy blank scopes cannot establish reference-only screenshot authority.

func (UploadSubject) EditionDisplayLabel added in v0.4.1

func (s UploadSubject) EditionDisplayLabel() string

EditionDisplayLabel preserves prepared edition wording for display-only payloads and naming. Validation and duplicate comparison use EditionLabel.

func (UploadSubject) EditionLabel added in v0.4.0

func (s UploadSubject) EditionLabel() string

EditionLabel returns the finalized edition wording used by tracker payloads and duplicate comparison. EditionSet only controls rendered naming; this label retains detailed categories for validation. Naming policies should use their independent components in the generated document.

func (UploadSubject) HDRArtifactEvidence added in v0.4.1

func (s UploadSubject) HDRArtifactEvidence(tracker string) []HDRArtifactEvidence

HDRArtifactEvidence returns detached selected image associations. Final editor output may reuse retained links only for the same exact selected artifacts.

func (UploadSubject) ThreeDName added in v0.4.1

func (s UploadSubject) ThreeDName() string

ThreeDName returns the subject's generic naming marker, honoring an explicit component omission without changing retained measured or subtype facts.

func (UploadSubject) ThreeDSourceName added in v0.4.1

func (s UploadSubject) ThreeDSourceName(source string) string

ThreeDSourceName avoids a duplicate or explicitly omitted marker in the known source label used by legacy renderers. Source-only Auto annotations are retained; this does not project manual Source components or change canonical facts.

func (UploadSubject) TrackerDescriptionOverride added in v0.4.1

func (s UploadSubject) TrackerDescriptionOverride(tracker string) (string, bool)

TrackerDescriptionOverride selects the editable group source and its finality before falling back to direct content, matching prepared upload selection.

type UploadSubjectInput added in v0.3.0

type UploadSubjectInput struct {
	// StaffUploadTokens are backend-only, tracker-scoped credentials; their presence grants no exception.
	StaffUploadTokens     map[string]StaffUploadToken `json:"-"`
	Release               ReleaseRef
	Trackers              []string
	IgnoreDupesFor        []string
	SkipDuplicateCheck    bool
	SkipDuplicateAsActual bool
	DoubleDuplicateCheck  bool
	QuestionnaireAnswers  map[string]map[string]string
	TrackerIDOverrides    map[string]string
	DescriptionGroups     []DescriptionBuilderGroup
	// DescriptionOverride is explicit description text supplied directly by
	// the caller, before tracker-scoped group selection.
	DescriptionOverride string
	// DescriptionGroupsFinal reports that DescriptionGroups contains retained
	// workflow output and no later description stage can add required content.
	DescriptionGroupsFinal bool
	TrackerConfigOverrides TrackerConfigOverrides
	TrackerSiteOverrides   TrackerSiteOverrides
	ClientOverrides        ClientOverrides
	ImageHostOverrides     ImageHostOverrides
	ScreenshotOverrides    ScreenshotOverrides
	TorrentOverrides       TorrentOverrides
	Options                UploadOptions
}

UploadSubjectInput contains workflow upload choices for one exact prepared generation.

type UploadSummary

type UploadSummary struct {
	Uploaded         int
	UploadedTorrents []UploadedTorrent
	// PendingPublication reports a successful submission awaiting tracker publication.
	// UploadedTorrents may still authorize client injection before publication.
	PendingPublication bool
}

UploadSummary records completed tracker submissions and any returned registered-torrent authority.

type UploadTrackerResult added in v0.3.0

type UploadTrackerResult struct {
	TrackerID              TrackerID            `json:"trackerId"`
	Status                 StageStatus          `json:"status"`
	SubmissionStatus       StageStatus          `json:"submissionStatus,omitempty"`
	ClientInjectionStatus  StageStatus          `json:"clientInjectionStatus,omitempty"`
	ClientInjectionMessage string               `json:"clientInjectionMessage,omitempty"`
	ClientFailureCode      OperationFailureCode `json:"clientFailureCode,omitempty"`
	RemoteID               string               `json:"remoteId,omitempty"`
	RemoteURL              string               `json:"remoteUrl,omitempty"`
	ClientInjected         bool                 `json:"clientInjected"`
	CrossSeeded            bool                 `json:"crossSeeded"`
	Failures               []WorkflowFailure    `json:"failures,omitempty"`
}

UploadTrackerResult is one safe immutable tracker submission outcome.

func (UploadTrackerResult) ClientInjectionRetryable added in v0.3.0

func (r UploadTrackerResult) ClientInjectionRetryable() bool

ClientInjectionRetryable reports whether retained registered-artifact authority can safely drive a client-only retry.

func (UploadTrackerResult) DerivedStatus added in v0.3.0

func (r UploadTrackerResult) DerivedStatus() StageStatus

DerivedStatus projects split submission and client outcomes onto the legacy aggregate status field.

func (UploadTrackerResult) EffectiveClientInjectionStatus added in v0.3.0

func (r UploadTrackerResult) EffectiveClientInjectionStatus() StageStatus

EffectiveClientInjectionStatus returns the explicit client-effect outcome, with compatibility inference for results retained before split outcomes.

func (UploadTrackerResult) EffectiveSubmissionStatus added in v0.3.0

func (r UploadTrackerResult) EffectiveSubmissionStatus() StageStatus

EffectiveSubmissionStatus returns the explicit tracker-submission outcome, with compatibility inference for results retained before split outcomes.

func (UploadTrackerResult) SubmissionRetryable added in v0.3.0

func (r UploadTrackerResult) SubmissionRetryable() bool

SubmissionRetryable reports whether a fresh tracker submission is safe to offer for this retained result.

type UploadedImageLink struct {
	// Tonemapping records actual processing; empty means unknown. ContentSHA256 binds it to image bytes.
	Tonemapping              ScreenshotTonemapping `json:",omitempty"`
	ContentSHA256            string                `json:",omitempty"`
	SourcePath               string
	PreparedMediaFingerprint string
	PreparedGeneration       PreparedGeneration
	DiscID                   string
	ImagePath                string
	Purpose                  ScreenshotPurpose
	Host                     string
	UsageScope               string
	// AccountScope is a private configuration fingerprint used only for durable
	// hosted-link reuse. It is never a transport field.
	AccountScope string `json:"-"`
	ImgURL       string
	RawURL       string
	WebURL       string
	SizeBytes    int64
	UploadedAt   time.Time `ts_type:"string"`
}

type UploadedTorrent

type UploadedTorrent struct {
	Tracker     string
	TorrentID   string
	DownloadURL string
	TorrentURL  string
	TorrentPath string
}

type VerifiedInputSource added in v0.3.5

type VerifiedInputSource struct {
	Manifest SourceManifest        `json:"manifest"`
	Identity SourceContentIdentity `json:"identity"`
}

VerifiedInputSource binds a canonical source manifest to its bounded source samples. It is an internal preparation handoff, never a browser transport shape.

type VerifiedSourceFile added in v0.3.5

type VerifiedSourceFile struct {
	LocalPath    string `json:"localPath"`
	RelativePath string `json:"relativePath"`
	Size         int64  `json:"size"`
	SHA256       string `json:"sampleSha256"`
}

VerifiedSourceFile records one private bounded source sample. SHA256 is the SHA-256 of the first min(Size, SourceContentIdentitySampleBytes) bytes and must never be treated as a full-file digest.

type VideoBitrateAssessment added in v0.3.0

type VideoBitrateAssessment struct {
	Status        VideoBitrateStatus
	BitsPerSecond int64
}

VideoBitrateAssessment contains the prepared video bitrate and its evidence status. BitsPerSecond is populated only when Status is Present.

type VideoBitrateStatus added in v0.3.0

type VideoBitrateStatus string

VideoBitrateStatus records whether a usable video bitrate was derived from the prepared MediaInfo facts.

const (
	VideoBitrateStatusUnknown     VideoBitrateStatus = "unknown"
	VideoBitrateStatusPresent     VideoBitrateStatus = "present"
	VideoBitrateStatusUnavailable VideoBitrateStatus = "unavailable"
	VideoBitrateStatusInvalid     VideoBitrateStatus = "invalid"
)

type VideoRateControl added in v0.4.1

type VideoRateControl string

VideoRateControl identifies a mode explicitly reported by the video encoder. The zero value includes missing, unsupported and contradictory evidence.

const (
	VideoRateControlCRF          VideoRateControl = "crf"
	VideoRateControlTwoPassVBR   VideoRateControl = "two_pass_vbr"   // #nosec G101 -- public encoder rate-control enum, not a credential.
	VideoRateControlMultiPassVBR VideoRateControl = "multi_pass_vbr" // #nosec G101 -- public encoder rate-control enum, not a credential.
	VideoRateControlABR          VideoRateControl = "abr"
	VideoRateControlCBR          VideoRateControl = "cbr"
	VideoRateControlCQP          VideoRateControl = "cqp"
)

type WorkflowAuthority added in v0.3.0

type WorkflowAuthority struct {
	WorkflowID       WorkflowID       `json:"workflowId"`
	ExpectedRevision WorkflowRevision `json:"expectedRevision"`
}

WorkflowAuthority is exact optimistic concurrency authority for Continue.

type WorkflowContinuation added in v0.3.0

type WorkflowContinuation struct {
	Lifecycle       OperationLifecycle   `json:"lifecycle"`
	Disposition     WorkflowDisposition  `json:"disposition"`
	Refs            WorkflowExactRefs    `json:"refs"`
	TrackerOutcomes []TrackerLaneOutcome `json:"trackerOutcomes,omitempty"`
	RequiredActions []RequiredAction     `json:"requiredActions,omitempty"`
	AvailableGoals  []GoalAvailability   `json:"availableGoals"`
	Events          []WorkflowEvent      `json:"events,omitempty"`
}

WorkflowContinuation is the backend-owned current transition and outcome projection.

type WorkflowDisposition added in v0.3.0

type WorkflowDisposition string

WorkflowDisposition is the reduced business outcome across viable tracker lanes.

const (
	WorkflowDispositionNone        WorkflowDisposition = "none"
	WorkflowDispositionSucceeded   WorkflowDisposition = "succeeded"
	WorkflowDispositionPartial     WorkflowDisposition = "partial"
	WorkflowDispositionFailed      WorkflowDisposition = "failed"
	WorkflowDispositionCanceled    WorkflowDisposition = "canceled"
	WorkflowDispositionNeedsAction WorkflowDisposition = "needs_action"
)

type WorkflowEffectStatus added in v0.3.0

type WorkflowEffectStatus string

WorkflowEffectStatus is the durable lifecycle of one external side effect.

const (
	WorkflowEffectStatusStarted   WorkflowEffectStatus = "started"
	WorkflowEffectStatusSucceeded WorkflowEffectStatus = "succeeded"
	WorkflowEffectStatusFailed    WorkflowEffectStatus = "failed"
	WorkflowEffectStatusUnknown   WorkflowEffectStatus = "unknown"
)

type WorkflowEvent added in v0.3.0

type WorkflowEvent struct {
	Sequence    uint64                `json:"sequence"`
	WorkflowID  WorkflowID            `json:"workflowId"`
	OperationID WorkflowOperationID   `json:"operationId,omitempty"`
	Command     string                `json:"command,omitempty"`
	Phase       string                `json:"phase,omitempty"`
	Scope       WorkflowEventScope    `json:"scope"`
	ScopeID     string                `json:"scopeId,omitempty"`
	Lifecycle   OperationLifecycle    `json:"lifecycle"`
	State       StageStatus           `json:"state"`
	Disposition WorkflowDisposition   `json:"disposition"`
	Severity    WorkflowEventSeverity `json:"severity"`
	Completed   int                   `json:"completed,omitempty"`
	Total       int                   `json:"total,omitempty"`
	FailureCode OperationFailureCode  `json:"failureCode,omitempty"`
	Recovery    OperationRecovery     `json:"recovery,omitempty"`
	Message     string                `json:"message,omitempty"`
	Timestamp   time.Time             `json:"timestamp" ts_type:"string"`
}

WorkflowEvent is one canonical redacted operation or scoped-item event.

type WorkflowEventScope added in v0.3.0

type WorkflowEventScope string

WorkflowEventScope identifies the authority represented by one safe event.

const (
	WorkflowEventScopeWorkflow WorkflowEventScope = "workflow"
	WorkflowEventScopeTracker  WorkflowEventScope = "tracker"
	WorkflowEventScopeArtifact WorkflowEventScope = "artifact"
	WorkflowEventScopeHost     WorkflowEventScope = "host"
	WorkflowEventScopeClient   WorkflowEventScope = "client"
)

type WorkflowEventSeverity added in v0.3.0

type WorkflowEventSeverity string

WorkflowEventSeverity is assigned centrally and rendered unchanged by adapters.

const (
	WorkflowEventSeverityDebug WorkflowEventSeverity = "debug"
	WorkflowEventSeverityInfo  WorkflowEventSeverity = "info"
	WorkflowEventSeverityWarn  WorkflowEventSeverity = "warn"
	WorkflowEventSeverityError WorkflowEventSeverity = "error"
)

type WorkflowExactRefs added in v0.3.0

type WorkflowExactRefs struct {
	Release         *ReleaseSnapshotRef             `json:"release,omitempty"`
	Projections     *TrackerReleaseProjectionSetRef `json:"projections,omitempty"`
	Preflight       *TrackerPreflightAssessmentRef  `json:"preflight,omitempty"`
	Dupes           *DupeAssessmentRef              `json:"dupes,omitempty"`
	TrackerApproval *TrackerApprovalSnapshotRef     `json:"trackerApproval,omitempty"`
	Media           *MediaArtifactSetRef            `json:"media,omitempty"`
	Descriptions    *DescriptionSetRef              `json:"descriptions,omitempty"`
	DryRun          *UploadDryRunResultRef          `json:"dryRun,omitempty"`
	UploadResult    *UploadResultRef                `json:"uploadResult,omitempty"`
}

WorkflowExactRefs binds a lane projection to retained immutable products.

type WorkflowExecutionMode added in v0.3.0

type WorkflowExecutionMode string

WorkflowExecutionMode controls policy-gate execution without changing dry-run or client-injection semantics.

const (
	WorkflowExecutionModeNormal WorkflowExecutionMode = "normal"
	WorkflowExecutionModeDebug  WorkflowExecutionMode = "debug"
)

func NormalizeWorkflowExecutionMode added in v0.3.0

func NormalizeWorkflowExecutionMode(mode WorkflowExecutionMode) WorkflowExecutionMode

NormalizeWorkflowExecutionMode maps the wire-compatible empty value to normal.

type WorkflowExternalEffect added in v0.3.0

type WorkflowExternalEffect struct {
	Kind                WorkflowExternalEffectKind
	ScopeID             string
	SemanticFingerprint WorkflowFingerprint
	// Submission is required for tracker submissions admitted by an active
	// input workflow. It carries the exact scoped content and site authority.
	Submission *SubmissionFenceAuthority
}

WorkflowExternalEffect identifies one exact external semantic attempt.

type WorkflowExternalEffectKind added in v0.3.0

type WorkflowExternalEffectKind string

WorkflowExternalEffectKind identifies an externally visible side effect.

const (
	WorkflowExternalEffectTrackerSubmission WorkflowExternalEffectKind = "tracker_submission"
	WorkflowExternalEffectClientInjection   WorkflowExternalEffectKind = "client_injection"
	WorkflowExternalEffectImageHosting      WorkflowExternalEffectKind = "image_hosting"
)

type WorkflowExternalEffectReceipt added in v0.3.0

type WorkflowExternalEffectReceipt struct {
	EffectID string
	// AlreadySucceeded tells the caller to reuse the prior result instead of repeating the external effect.
	AlreadySucceeded bool
}

WorkflowExternalEffectReceipt is private in-process authority to complete a previously persisted attempt_started record.

func BeginWorkflowExternalEffect added in v0.3.0

func BeginWorkflowExternalEffect(
	ctx context.Context,
	effect WorkflowExternalEffect,
) (WorkflowExternalEffectReceipt, error)

BeginWorkflowExternalEffect durably fences one external attempt when the current workflow operation installed a reporter. Invalid effect authority is rejected first. Without a reporter, effects lacking submission authority return an empty receipt; effects carrying submission authority require a reporter.

type WorkflowExternalEffectReporter added in v0.3.0

type WorkflowExternalEffectReporter interface {
	Begin(context.Context, WorkflowExternalEffect) (WorkflowExternalEffectReceipt, error)
	Complete(context.Context, WorkflowExternalEffectReceipt, bool) error
}

WorkflowExternalEffectReporter persists attempt fences around side effects.

func WorkflowExternalEffectReporterFromContext added in v0.3.5

func WorkflowExternalEffectReporterFromContext(ctx context.Context) (WorkflowExternalEffectReporter, bool)

WorkflowExternalEffectReporterFromContext returns the current operation's reporter so domain owners can add checks without replacing its durable fence.

type WorkflowFailure added in v0.3.0

type WorkflowFailure struct {
	Failure   OperationFailure `json:"failure"`
	TrackerID TrackerID        `json:"trackerId,omitempty"`
	Resource  string           `json:"resource,omitempty"`
}

WorkflowFailure binds a safe structured failure to an optional tracker/resource.

type WorkflowFingerprint added in v0.3.0

type WorkflowFingerprint string

WorkflowFingerprint is a deterministic SHA-256 fingerprint of normalized public inputs.

func CanonicalWorkflowFingerprint added in v0.3.0

func CanonicalWorkflowFingerprint(value any) (WorkflowFingerprint, error)

CanonicalWorkflowFingerprint returns a deterministic SHA-256 fingerprint of value's JSON form.

func TitleSearchIdentityFingerprint added in v0.4.1

func TitleSearchIdentityFingerprint(identity ExternalIdentity) (WorkflowFingerprint, error)

TitleSearchIdentityFingerprint binds provider work identity to one exact prepared source generation. Missing identity never proves title absence.

type WorkflowGoal added in v0.3.0

type WorkflowGoal string

WorkflowGoal is an adapter-facing desired workflow milestone.

const (
	WorkflowGoalPrepared          WorkflowGoal = "prepared"
	WorkflowGoalInputReady        WorkflowGoal = "input_ready"
	WorkflowGoalTrackersProjected WorkflowGoal = "trackers_projected"
	WorkflowGoalTrackersAssessed  WorkflowGoal = "trackers_assessed"
	WorkflowGoalDuplicatesDecided WorkflowGoal = "duplicates_decided"
	WorkflowGoalMediaReady        WorkflowGoal = "media_ready"
	WorkflowGoalDescriptionsReady WorkflowGoal = "descriptions_ready"
	WorkflowGoalUploadReviewed    WorkflowGoal = "upload_reviewed"
	WorkflowGoalDryRun            WorkflowGoal = "dry_run"
	WorkflowGoalUploaded          WorkflowGoal = "uploaded"
)

type WorkflowID added in v0.3.0

type WorkflowID string

WorkflowID identifies one retained release workflow.

type WorkflowIntent added in v0.3.0

type WorkflowIntent struct {
	FactInstructions *ReleaseFactInstructions `json:"factInstructions,omitempty"`
	CorrectionPatch  *ReleaseCorrectionPatch  `json:"correctionPatch,omitempty"`
	Preparation      *PrepareInput            `json:"preparation,omitempty"`
	Interaction      InteractionMode          `json:"interaction,omitempty"`
	ExecutionMode    WorkflowExecutionMode    `json:"executionMode,omitempty"`
	TrackerIDs       []TrackerID              `json:"trackerIds,omitempty"`
	// TrackerInputAnswers patches selected-tracker input. A null field value
	// removes its prior answer; a string is an explicit answer.
	TrackerInputAnswers    map[TrackerID]map[string]*string            `json:"trackerInputAnswers,omitempty"`
	ProjectionInstructions map[TrackerID]TrackerProjectionInstructions `json:"projectionInstructions,omitempty"`
	SkipRemoteDuplicates   bool                                        `json:"skipRemoteDuplicates,omitempty"`
	DuplicateCheckCount    uint8                                       `json:"duplicateCheckCount,omitempty"`
	DuplicateDecisions     map[TrackerID]DupeDecision                  `json:"duplicateDecisions,omitempty"`
	// StaffTokenConfirmations maps each staff-required ignored tracker to the
	// current assessment ID. Confirmations for an earlier assessment cannot authorize it.
	StaffTokenConfirmations map[TrackerID]DupeAssessmentID `json:"staffTokenConfirmations,omitempty"`
	HDRAnalysis             *HDRAnalysisRequest            `json:"hdrAnalysis,omitempty"`
	Media                   *MediaCaptureInstructions      `json:"media,omitempty"`
	MediaSelection          *WorkflowMediaSelection        `json:"mediaSelection,omitempty"`
	// SkipImageHostUpload suppresses new image-host uploads after local capture.
	// Compatible cached images remain reusable in descriptions; false enables hosting.
	SkipImageHostUpload bool                     `json:"skipImageHostUpload,omitempty"`
	Descriptions        *DescriptionInstructions `json:"descriptions,omitempty"`
	UploadTrackerIDs    []TrackerID              `json:"uploadTrackerIds,omitempty"`
	NoSeed              bool                     `json:"noSeed,omitempty"`
}

WorkflowIntent is desired workflow state. Internal stage ordering is absent by design.

type WorkflowMediaSelection added in v0.3.0

type WorkflowMediaSelection struct {
	ArtifactIDs []PublicResourceID `json:"artifactIds"`
}

WorkflowMediaSelection distinguishes default-all selection from an explicit exact selection.

type WorkflowOperationID added in v0.3.0

type WorkflowOperationID string

WorkflowOperationID identifies one pollable workflow operation.

type WorkflowOperationItem added in v0.3.0

type WorkflowOperationItem struct {
	ID        string      `json:"id"`
	Kind      string      `json:"kind"`
	Label     string      `json:"label"`
	Phase     string      `json:"phase,omitempty"`
	Status    StageStatus `json:"status"`
	Completed int         `json:"completed,omitempty"`
	Total     int         `json:"total,omitempty"`
	Message   string      `json:"message,omitempty"`
}

WorkflowOperationItem is one ordered safe progress row.

type WorkflowOperationResult added in v0.3.0

type WorkflowOperationResult struct {
	Kind             WorkflowOperationResultKind `json:"kind"`
	WorkflowRevision WorkflowRevision            `json:"workflowRevision"`
	RefID            string                      `json:"refId"`
	RefRevision      WorkflowRevision            `json:"refRevision"`
}

WorkflowOperationResult binds terminal success to one exact retained public snapshot. RefID is opaque and safe for adapter diagnostics.

type WorkflowOperationResultKind added in v0.3.0

type WorkflowOperationResultKind string

WorkflowOperationResultKind identifies the exact public result promised by a terminal workflow operation. Private execution authority is never exposed.

const (
	WorkflowOperationResultRelease         WorkflowOperationResultKind = "release"
	WorkflowOperationResultInputReadiness  WorkflowOperationResultKind = "input_readiness"
	WorkflowOperationResultProjections     WorkflowOperationResultKind = "tracker_projections"
	WorkflowOperationResultPreflight       WorkflowOperationResultKind = "tracker_preflight"
	WorkflowOperationResultDupes           WorkflowOperationResultKind = "dupes"
	WorkflowOperationResultMedia           WorkflowOperationResultKind = "media"
	WorkflowOperationResultHDRAnalysis     WorkflowOperationResultKind = "hdr_analysis"
	WorkflowOperationResultAudioAnalysis   WorkflowOperationResultKind = "audio_analysis"
	WorkflowOperationResultDescriptions    WorkflowOperationResultKind = "descriptions"
	WorkflowOperationResultDryRun          WorkflowOperationResultKind = "dry_run"
	WorkflowOperationResultUpload          WorkflowOperationResultKind = "upload_result"
	WorkflowOperationResultAlreadyUploaded WorkflowOperationResultKind = "already_uploaded"
)

type WorkflowOperationStatus added in v0.3.0

type WorkflowOperationStatus struct {
	ID             WorkflowOperationID      `json:"id"`
	WorkflowID     WorkflowID               `json:"workflowId"`
	Revision       WorkflowRevision         `json:"revision"`
	ResultRevision WorkflowRevision         `json:"resultRevision,omitempty"`
	Sequence       uint64                   `json:"sequence"`
	Command        string                   `json:"command"`
	Operation      OperationKind            `json:"operation"`
	Phase          string                   `json:"phase,omitempty"`
	Status         StageStatus              `json:"status"`
	Progress       int                      `json:"progress"`
	Completed      int                      `json:"completed"`
	Total          int                      `json:"total"`
	Message        string                   `json:"message,omitempty"`
	Items          []WorkflowOperationItem  `json:"items,omitempty"`
	Failures       []WorkflowFailure        `json:"failures,omitempty"`
	Events         []WorkflowEvent          `json:"events,omitempty"`
	Result         *WorkflowOperationResult `json:"result,omitempty"`
	StartedAt      time.Time                `json:"startedAt" ts_type:"string"`
	UpdatedAt      time.Time                `json:"updatedAt" ts_type:"string"`
	CompletedAt    *time.Time               `json:"completedAt,omitempty" ts_type:"string"`
}

WorkflowOperationStatus is the authoritative pollable operation state.

func (WorkflowOperationStatus) Clone added in v0.3.0

Clone returns a detached workflow operation status.

func (WorkflowOperationStatus) Validate added in v0.3.0

func (s WorkflowOperationStatus) Validate() error

Validate verifies operation identity, progress, and terminal timestamps.

type WorkflowPatch added in v0.3.0

type WorkflowPatch[T any] struct {
	Present bool `json:"-"`
	Reset   bool `json:"-"`
	Value   T    `json:"-"`
}

WorkflowPatch preserves JSON absence, null/reset, and explicit values including zero values. Present=false means leave unchanged; Present=true with Reset=true means return to automatic.

func (WorkflowPatch[T]) IsZero added in v0.3.0

func (p WorkflowPatch[T]) IsZero() bool

IsZero reports whether this patch was absent.

func (WorkflowPatch[T]) MarshalJSON added in v0.3.0

func (p WorkflowPatch[T]) MarshalJSON() ([]byte, error)

MarshalJSON serializes a present patch as null/reset or its explicit value.

func (*WorkflowPatch[T]) UnmarshalJSON added in v0.3.0

func (p *WorkflowPatch[T]) UnmarshalJSON(payload []byte) error

UnmarshalJSON records null separately from an explicit zero value.

type WorkflowProgressReporter added in v0.3.0

type WorkflowProgressReporter func(WorkflowProgressUpdate)

WorkflowProgressReporter receives generic workflow progress snapshots.

type WorkflowProgressUpdate added in v0.3.0

type WorkflowProgressUpdate struct {
	Phase     string
	ItemID    string
	Kind      string
	Label     string
	Status    StageStatus
	Completed int
	Total     int
	Message   string
	// ItemOnly updates the named item without advancing aggregate stage progress.
	ItemOnly bool
}

WorkflowProgressUpdate is one frontend-safe absolute stage snapshot used by workflow stages that do not have a narrower existing progress contract.

type WorkflowResourceID added in v0.3.0

type WorkflowResourceID string

WorkflowResourceID identifies one owner-scoped staged private resource.

type WorkflowResourceRef added in v0.3.0

type WorkflowResourceRef struct {
	ID          WorkflowResourceID `json:"id"`
	ContentType string             `json:"contentType,omitempty"`
	SizeBytes   int64              `json:"sizeBytes,omitempty"`
}

WorkflowResourceRef is an opaque reference to one owner-scoped staged resource.

type WorkflowRevision added in v0.3.0

type WorkflowRevision uint64

WorkflowRevision is the optimistic concurrency revision of a workflow or stage snapshot.

type WorkflowScope added in v0.3.5

type WorkflowScope struct {
	OwnerID    string
	WorkflowID WorkflowID
}

WorkflowScope identifies one owner-scoped retained workflow.

type WorkflowStatus added in v0.3.0

type WorkflowStatus string

WorkflowStatus is the aggregate lifecycle status visible to all adapters.

const (
	// WorkflowStatusDraft means the workflow can accept fact instructions.
	WorkflowStatusDraft WorkflowStatus = "draft"
	// WorkflowStatusActive means one or more workflow stages are ready or running.
	WorkflowStatusActive WorkflowStatus = "active"
	// WorkflowStatusBlocked means typed caller action is required.
	WorkflowStatusBlocked WorkflowStatus = "blocked"
	// WorkflowStatusCompleted means upload execution reached a terminal result.
	WorkflowStatusCompleted WorkflowStatus = "completed"
	// WorkflowStatusCanceled means the owner canceled the workflow.
	WorkflowStatusCanceled WorkflowStatus = "canceled"
	// WorkflowStatusFailed means a non-recoverable workflow failure is retained.
	WorkflowStatusFailed WorkflowStatus = "failed"
)

Jump to

Keyboard shortcuts

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