api

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

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 MaxLiveTestImageUploads = 500

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

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 (
	// 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")
	// 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")
)
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 CompleteWorkflowExternalEffect added in v0.3.0

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

CompleteWorkflowExternalEffect persists a known success or failure receipt.

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 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 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 IsStrictRuleFailure added in v0.3.0

func IsStrictRuleFailure(failure RuleFailure) bool

IsStrictRuleFailure reports whether a rule result can never be authorized.

func IsWaivableRuleFailure added in v0.3.0

func IsWaivableRuleFailure(failure RuleFailure) bool

IsWaivableRuleFailure reports whether exact authorization may unblock a result.

func NormalizeReleaseFactInstructionsCategory added in v0.3.2

func NormalizeReleaseFactInstructionsCategory(instructions *ReleaseFactInstructions) error

NormalizeReleaseFactInstructionsCategory normalizes both legacy category representations.

func ParseLogLevel

func ParseLogLevel(value string) (string, error)

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 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 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 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"`
	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 returned by WebUI entrypoints.

func CurrentApplicationInfo

func CurrentApplicationInfo() ApplicationInfo

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

type AssetEvidence added in v0.3.0

type AssetEvidence struct {
	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 {
	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 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
}

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       string `json:"path"`
	IsDir      bool   `json:"isDir"`
	Size       int64  `json:"size"`
	ModifiedAt string `json:"modifiedAt"`
}

type BrowseDirectoryRequest

type BrowseDirectoryRequest struct {
	Path string `json:"path"`
	Mode string `json:"mode"`
}

type BrowseDirectoryResponse

type BrowseDirectoryResponse struct {
	CurrentPath string                 `json:"currentPath"`
	ParentPath  string                 `json:"parentPath"`
	Mode        string                 `json:"mode"`
	Entries     []BrowseDirectoryEntry `json:"entries"`
}

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 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
}

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"
	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"
)

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 {
	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"`
	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 {
	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
	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"`
}

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 DescriptionSet added in v0.3.0

type DescriptionSet struct {
	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 {
	EffectiveMetadata          EffectiveMetadata
	ManualLanguages            ManualLanguageFacts
	HardcodedSubs              bool
	HardcodedSubtitleLanguages []string
	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.

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
}

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 {
	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 {
	Tracker               string
	CanonicalReleaseName  string
	UploadReleaseName     string
	ProjectionFingerprint WorkflowFingerprint
	CriteriaFingerprint   WorkflowFingerprint
	ProjectionStatus      ReadinessStatus
	PolicyID              string
	PolicyFingerprint     WorkflowFingerprint
	TargetFingerprint     WorkflowFingerprint
	SearchFingerprint     WorkflowFingerprint
	Search                DupeSearchEvidence
	Evaluations           []DupeCandidateEvaluation
	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 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 {
	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
	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 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 {
	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 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 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
	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 {
	Screenshots       []ScreenshotImage
	DVDMenus          []DVDMenuCaptureImage
	ScreenshotUploads []UploadedImageLink
	DVDMenuUploads    []UploadedImageLink
}

ExactMediaAssets is one authoritative workflow-owned media revision. Screenshots and DVD menus are independent channels, as are their hosted variants.

func (*ExactMediaAssets) Clone added in v0.3.0

func (a *ExactMediaAssets) Clone() *ExactMediaAssets

Clone returns a detached exact-media bundle while preserving nil slices.

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 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
	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 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 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 HistoryCleanupSnapshot added in v0.3.0

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

HistoryCleanupSnapshot contains persisted local paths needed by Core's filesystem cleanup policy. ArtifactPaths is an isolated caller-owned slice.

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)
	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
	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 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 {
	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 {
	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 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 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 {
	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"`
	RequirementsFingerprint   WorkflowFingerprint            `json:"requirementsFingerprint"`
	Artifacts                 []MediaArtifact                `json:"artifacts"`
	HostAttempts              []HostedImageAttempt           `json:"hostAttempts,omitempty"`
	FailedHosts               []string                       `json:"failedHosts,omitempty"`
	ImageRequirementsPrepared bool                           `json:"imageRequirementsPrepared"`
	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 {
	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"`
	// 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 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 {
	AudioLanguages                       []string
	SubtitleLanguages                    []string
	TrackAudioLanguages                  []string
	TrackSubtitleLanguages               []string
	Tracks                               []MediaTrackFacts
	TrackCoverageComplete                bool
	AudioLanguagesProvenance             FactProvenance
	SubtitleLanguagesProvenance          FactProvenance
	HardcodedSubs                        bool
	HardcodedSubtitleLanguages           []string
	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
	VideoEncode                          string
	HasEncodeSettings                    bool
	BitDepth                             string
	Edition                              string
	Repack                               string
	WebDV                                bool
	StreamOptimized                      int
	Service                              string
	ServiceLongName                      string
	MediaInfoUniqueID                    string
	Anime                                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 {
	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.

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"`
	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.

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 MediaTrackFacts added in v0.3.2

type MediaTrackFacts struct {
	ID                  string
	Kind                MediaTrackKind
	ResourceID          string
	ManifestFingerprint string
	NativeID            string
	Ordinal             int
	DetectedLanguages   []string
	Languages           []string
	LanguageProvenance  FactProvenance
	Default             bool
	Commentary          bool
}

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 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"`
}

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 {
	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
	// 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
	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
	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 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
	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"
	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"
	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"
)

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 {
	// 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
	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"`
	// 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
	Intent       PreparationIntent
	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 {
	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
}

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
	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) MetadataFacts added in v0.3.2

func (r PreparedRelease) MetadataFacts() EffectiveMetadata

MetadataFacts projects finalized descriptive values without mutable instructions.

type PreparedReleaseDisplay added in v0.3.0

type PreparedReleaseDisplay struct {
	ReleaseName string
	Providers   []ProviderDisplay
	TrackerData []TrackerPreview
}

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.
	CommitPreparedReleaseWithCorrections(context.Context, PreparedRelease, 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 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 verifies 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 ReleaseInfo

type ReleaseInfo struct {
	Category   string
	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
	Season     int
	Episode    int
	Edition    []string
	Other      []string
}

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.

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 {
	Category     *string
	Type         *string
	Source       *string
	Resolution   *string
	Tag          *string
	Service      *string
	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
}

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
	Title        string
	AltTitle     string
	Year         int
	ManualYear   int
	Resolution   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
	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
	Edition            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
	GeneratedVariants GeneratedReleaseNameVariants
	MissingFields     []string
}

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 {
	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"`
	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.

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"`
	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
	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
}

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
}

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)
	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
}

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
	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 {
	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 {
	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"`
	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"`
	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"`
	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) 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) 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 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 {
	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 {
	EffectiveMetadata          EffectiveMetadata
	ManualLanguages            ManualLanguageFacts
	HardcodedSubs              bool
	HardcodedSubtitleLanguages []string
	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 {
	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 {
	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 {
	Tracker string
	URL     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"

	// 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.

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 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 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 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 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 {
	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 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"
)

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 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
	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
	Aliases                []string
	EpisodeSeason          int
	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
	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 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
	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 {
	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"`
}

TrackerDryRunReport is one safe tracker-scoped dry-run outcome.

type TrackerDupeAssessment added in v0.3.0

type TrackerDupeAssessment struct {
	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"`
	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 {
	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"`
}

TrackerDuplicateTarget is the projection-bound proposed release used only for local duplicate policy evaluation.

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"`
	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 {
	SourcePath string
	Tracker    string
	TrackerID  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
	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"`
	// 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
	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:"-"`
	// ScreenshotCount overrides the global screenshot fallback. Zero disables that fallback, while a tracker ImageCount remains a minimum.
	ScreenshotCount *int                   `json:"screenshotCount,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 {
	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 {
	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 {
	TrackerID            TrackerID                `json:"trackerId"`
	DisplayName          string                   `json:"displayName"`
	CanonicalReleaseName string                   `json:"canonicalReleaseName"`
	UploadReleaseName    string                   `json:"uploadReleaseName"`
	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 TrackerValidationSubject added in v0.3.0

type TrackerValidationSubject struct {
	Tracker                    string
	EffectiveMetadata          EffectiveMetadata
	ManualLanguages            ManualLanguageFacts
	HardcodedSubs              bool
	HardcodedSubtitleLanguages []string
	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
	SeasonStr                  string
	EpisodeStr                 string
	TVPack                     bool
	DailyEpisodeDate           string
	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
	HDR                        string
	UHD                        string
	Distributor                string
	Region                     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.

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 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
	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 {
	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"`
}

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 UploadSubject added in v0.3.0

type UploadSubject struct {
	EffectiveMetadata          EffectiveMetadata
	ManualLanguages            ManualLanguageFacts
	HardcodedSubs              bool
	HardcodedSubtitleLanguages []string
	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
	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
	TrackerQuestionnaireAnswers map[string]map[string]string
	SeasonInt                   int
	EpisodeInt                  int
	SeasonStr                   string
	EpisodeStr                  string
	TVDBAiredDate               string
	TVDBAirsTime                string
	TVDBAirsTimezone            string
	TVPack                      bool
	DailyEpisodeDate            string
	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
	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.

type UploadSubjectInput added in v0.3.0

type UploadSubjectInput struct {
	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 that a successful submission has no registered torrent until the tracker publishes it.
	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 {
	SourcePath               string
	PreparedMediaFingerprint string
	PreparedGeneration       PreparedGeneration
	DiscID                   string
	ImagePath                string
	Host                     string
	UsageScope               string
	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 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 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
}

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 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.

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.

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.

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"
	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"`
	Media                  *MediaCaptureInstructions                   `json:"media,omitempty"`
	MediaSelection         *WorkflowMediaSelection                     `json:"mediaSelection,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"
	WorkflowOperationResultDescriptions   WorkflowOperationResultKind = "descriptions"
	WorkflowOperationResultDryRun         WorkflowOperationResultKind = "dry_run"
	WorkflowOperationResultUpload         WorkflowOperationResultKind = "upload_result"
)

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
}

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 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