Skip to contents

Copies one or more already-written unpack_call() or propose_change() results into a single output_dir, running the secret-shaped-value gate across the exact set of artifacts to be copied before writing anything. Each item is copied into its own numbered subdirectory so multiple replay projects and proposals can be handed off together (for example, to a maintainer or a coding agent) without losing their provenance.

Usage

bundle(
  ...,
  output_dir,
  on_secret = c("warn", "abort", "ignore"),
  overwrite = FALSE,
  store = NULL,
  store_label = NULL,
  store_tags = character()
)

Arguments

...

One or more insider_unpack or insider_proposal objects, or list()s of them. Each item must have a non-NULL, existing output_dir (an insider_proposal only has one when propose_change() was called with output_dir set).

output_dir

Directory to create the bundle in.

on_secret

How a flagged, sensitive-looking value or unassessed artifact is handled. The default, "warn", still writes the bundle and reports what was found (consistent with how scan_secrets() itself never blocks by default). "abort" stops before writing anything if any artifact is flagged or cannot be assessed (fails closed), so nothing is copied or overwritten. "ignore" still runs the scan and records it in bundle.md and the returned object for later review, but never warns or blocks.

overwrite

Overwrite an existing non-empty output_dir?

store

An optional insider_store handle (see insider_store()). When supplied, the returned bundle is also recorded in the store via store_save(); the resulting id is attached as its "store_id" attribute. The default, NULL, records nothing, consistent with the store's explicit, opt-in design.

store_label

An optional label passed through to store_save() when store is supplied.

store_tags

Optional character tags passed through to store_save() when store is supplied.

Value

Invisibly, an insider_bundle object containing the per-item manifest and the combined secret scan.

Examples

if (FALSE) { # \dontrun{
a <- unpack_call(stats::fivenum(1:10), output_dir = tempfile())
b <- unpack_call(stats::median(1:10), output_dir = tempfile())
bundle(a, b, output_dir = tempfile())
} # }