Skip to contents

ledgr_strategy_preflight() statically inspects a function(ctx, params) strategy before execution. It classifies the strategy into ledgr's reproducibility tiers:

Usage

ledgr_strategy_preflight(strategy)

Arguments

strategy

A function with signature function(ctx, params).

Value

A ledgr_strategy_preflight object with fields tier, allowed, reason, unresolved_symbols, package_dependencies, and notes.

Details

  • tier_1: self-contained strategy logic using only explicit params, base/recommended R references, and ledgr's exported public namespace.

  • tier_2: inspectable strategy logic that also uses package-qualified calls outside the active R distribution, such as pkg::fn(), or resolved non-function closure objects that ledgr does not store as standalone replayable artifacts.

  • tier_3: strategy logic with unresolved free symbols or user helpers that ledgr cannot recover from stored run metadata.

The preflight is static analysis, not proof of semantic reproducibility. Dynamic dispatch, mutable captured environments, and dynamically constructed code remain user responsibilities.

Articles

Reproducibility model: vignette("reproducibility", package = "ledgr") system.file("doc", "reproducibility.html", package = "ledgr")

Examples

strategy <- function(ctx, params) {
  targets <- ctx$flat()
  targets
}
ledgr_strategy_preflight(strategy)
#> ledgr Strategy Preflight
#> =========================
#> 
#> Tier:    tier_1
#> Allowed: TRUE
#> Reason:  Strategy is self-contained under ledgr's static preflight rules.