$context Optional confirmation context: * - 'model_id' => int: user-selected existing model (must match folder/title) * - 'model_name' => string: user-provided model title * - 'folder_path' => string: user-provided folder path (must exist or be creatable) * - 'create_new' => bool: force new model even if match exists * @return int Model ID (existing or newly created) * @throws \DomainException If context conflicts with existing catalog state * @throws \InvalidArgumentException If context is malformed */ public function modelFor(string $sourcePath, ScannedFile $file, array $context = []): int; /** * Persist the user's grouping decision for replay/idempotency. * Called after successful import job creation with confirmed context. * * @param int $jobId Import job ID * @param list $decisions * @return void */ public function persistDecisions(int $jobId, array $decisions): void; /** * Recover grouping decisions for a resumed/interrupted job. * Returns model_id per source_path, or empty array if no decision was recorded. * * @param int $jobId Import job ID * @return array Map of source_path => model_id */ public function recoverDecisions(int $jobId): array; }