% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/task-governance.R
\name{assert_gp3ml_use_case}
\alias{assert_gp3ml_use_case}
\title{Assert that a task is within the permitted gp3ml scope}
\usage{
assert_gp3ml_use_case(task, data = NULL)
}
\arguments{
\item{task}{A \code{gp3ml_task} object.}

\item{data}{Optional data frame used to validate task columns.}
}
\value{
Invisibly returns \code{TRUE} when the task is permitted; otherwise, the function stops with an error.
}
\description{
Assert that a task is within the permitted gp3ml scope
}
\examples{
example_data <- data.frame(
  participant_id = rep(sprintf("P\%02d", 1:12), each = 2),
  trial_id = sprintf("T\%02d", 1:24),
  stimulus_id = rep(c("S01", "S02"), 12),
  condition = rep(c("A", "B"), 12),
  fixation_duration = 180 + seq_len(24),
  pupil_change = sin(seq_len(24) / 3),
  stringsAsFactors = FALSE
)
example_data$quality_status <- factor(
  c(
    "pass", "review", "pass", "review", "review", "pass",
    "review", "pass", "pass", "review", "review", "pass",
    "review", "pass", "review", "pass", "pass", "review",
    "pass", "review", "review", "pass", "pass", "review"
  ),
  levels = c("pass", "review")
)
task <- declare_gazepoint_task(
  data = example_data,
  outcome = "quality_status",
  purpose = "Predict predefined recording-quality review status",
  task_type = "classification",
  unit_id = "trial_id",
  participant_id = "participant_id",
  stimulus_id = "stimulus_id",
  generalization_target = "new_participants",
  positive = "review"
)
assert_gp3ml_use_case(task, example_data)
}
