% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/write_manifest.R
\name{dfdr_write_manifest}
\alias{dfdr_write_manifest}
\title{Write a manifest file describing parameters, list metadata, and warnings}
\usage{
dfdr_write_manifest(diag, out_dir, filename = "manifest")
}
\arguments{
\item{diag}{A list as returned by \code{\link{dfdr_run_all}}.}

\item{out_dir}{Character scalar. Output directory (created if it does not exist).}

\item{filename}{Character scalar. Base filename without extension (default \code{"manifest"}).}
}
\value{
The path to the manifest file, returned invisibly. The function is called for
its side effect of writing a file to disk.
}
\description{
Writes a manifest alongside exported outputs to record key run parameters and
per-list metadata (unit, scope, q-source, export ceiling, etc.). This helps
tie diagnostic outputs to the exact inputs and settings used.
}
\details{
If \pkg{jsonlite} is available (suggested dependency), the manifest is written
as JSON (\code{*.json}); otherwise a human-readable plain text file
(\code{*.txt}) is written.
}
\examples{
library(tibble)

# Create a minimal dfdr_run_all-like object to demonstrate manifest writing
df <- tibble(
  id = c("1","2","3"),
  run = "run1",
  is_decoy = c(FALSE, TRUE, FALSE),
  score = c(10, 9, 8),
  q = c(0.01, 0.02, 0.03),
  pep = NA_real_
)
x <- as_dfdr_tbl(df, unit = "psm", scope = "global", q_source = "toy")

diag <- list(
  objects = list(toy = x),
  params = list(alpha_main = 0.01),
  warnings = character()
)

out_dir <- tempdir()
dfdr_write_manifest(diag, out_dir = out_dir, filename = "manifest_example")

}
