
Append a row to the run-tracking baseline ledger
Source:R/lnk_baseline_append.R
lnk_baseline_append.RdRecords that a particular run (csv-sync, parity comparison, etc.) ran
against a specific upstream build. Constructs row from the
lnk_bucket_log() result + caller-supplied run_label / notes.
Stamps run_started_pdt (Pacific) and host (Sys.info()[["nodename"]])
automatically.
Usage
lnk_baseline_append(
log,
run_label,
link_schema = "n/a",
notes = "",
path = "data-raw/logs/bcfp_baselines.csv"
)Arguments
- log
A list with at minimum
model_versionanddate_completed. Optionalhead_sha(full or short). The shape returned bylnk_bucket_log()qualifies; hand-built lists also work.- run_label
A string identifying the run, e.g.
"csv-sync-20260507","provincial_default_extrabreaks".- link_schema
The persistent target schema for the run, when applicable. Defaults to
"n/a"for runs that don't write a pipeline schema (csv-sync, etc.).- notes
Free-form notes column. Useful for short-sha references or any per-run context worth recording.
- path
Path to the ledger CSV. Defaults to
data-raw/logs/bcfp_baselines.csv. Created with the canonical header if it does not yet exist.
Details
Validates ledger column shape on append: fails loud if the CSV header
doesn't match the expected cols_baseline shape (drift in the ledger
file is signaled, not silently corrupted).
bcfp_model_run_id is populated from log$model_run_id if present,
otherwise empty. The Path-2 (no DB tunnel) workflow doesn't have access
to bcfishpass.log.model_run_id; the SHA in log$model_version /
log$head_sha still uniquely identifies the upstream build.
See also
lnk_baseline_read(), lnk_bucket_log()
Other baseline:
lnk_baseline_current(),
lnk_baseline_read()
Examples
if (FALSE) { # \dontrun{
log <- lnk_bucket_log()
tmp <- withr::local_tempfile(fileext = ".csv")
lnk_baseline_append(log,
run_label = "csv-sync-20260507",
notes = paste0("auto-append; head_sha=",
substr(log$head_sha, 1, 7)),
path = tmp)
lnk_baseline_read(tmp)
} # }