% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audit-tap.R
\name{audit_tap}
\alias{audit_tap}
\title{Record a Pipeline Snapshot}
\usage{
audit_tap(
  .data,
  .trail,
  .label = NULL,
  .fns = NULL,
  .numeric_summary = TRUE,
  .cols_include = NULL,
  .cols_exclude = NULL
)
}
\arguments{
\item{.data}{A data.frame or tibble flowing through the pipe.}

\item{.trail}{An \code{\link[=audit_trail]{audit_trail()}} object.}

\item{.label}{Optional character label for this snapshot. If \code{NULL}, an
auto-generated label like \code{"step_1"} is used.}

\item{.fns}{Optional named list of diagnostic functions (or formula lambdas)
to run on \code{.data}. Results are stored in the snapshot.}

\item{.numeric_summary}{Logical. If \code{FALSE}, skip numeric summary
computation in the snapshot (default \code{TRUE}).}

\item{.cols_include}{Character vector of column names to include in the
snapshot schema, or \code{NULL} (the default) to include all columns. Mutually
exclusive with \code{.cols_exclude}.}

\item{.cols_exclude}{Character vector of column names to exclude from the
snapshot schema, or \code{NULL} (the default). Mutually exclusive with
\code{.cols_include}.}
}
\value{
\code{.data}, unchanged, returned invisibly. The function is a
transparent pass-through; its only effect is the side effect on \code{.trail}.
}
\description{
Transparent pipe pass-through that captures a metadata snapshot and appends
it to an audit trail. Returns \code{.data} unchanged — the function's only purpose
is its side effect on \code{.trail}.
}
\examples{
trail <- audit_trail("example")
result <- mtcars |>
  audit_tap(trail, "raw") |>
  dplyr::filter(mpg > 20) |>
  audit_tap(trail, "filtered")
print(trail)

}
\seealso{
Other audit trail:
\code{\link[=audit_diff]{audit_diff()}},
\code{\link[=audit_report]{audit_report()}},
\code{\link[=print.audit_snap]{print.audit_snap()}},
\code{\link[=tab_tap]{tab_tap()}}
}
\concept{audit trail}
