Skip to contents

Validate an adaptive session directory.

Usage

validate_session_dir(session_dir)

Arguments

session_dir

Directory containing session artifacts.

Value

A metadata list containing at least schema_version, package_version, n_items, warm_start_mode, and pairing_strategy.

Details

Verifies that required session artifacts exist and that serialized logs match canonical schemas for step_log and round_log. This check is intended as a preflight for load_adaptive_session() and enforces the canonical adaptive session metadata shape. Validation is strict: known legacy fields are backfilled before checking canonical columns and types. Other added/removed/reordered columns abort validation. Saved mode/strategy metadata must agree with the authoritative state.

Examples

dir <- tempfile("pwllm-session-")
state <- adaptive_rank_start(c("a", "b", "c"), seed = 1)
save_adaptive_session(state, dir, overwrite = TRUE)
validate_session_dir(dir)
#> $schema_version
#> [1] "adaptive-session"
#> 
#> $package_version
#> [1] "1.5.1"
#> 
#> $n_items
#> [1] 3
#> 
#> $predictive_prior_digest
#> NULL
#> 
#> $warm_start_mode
#> [1] "cold"
#> 
#> $pairing_strategy
#> [1] "hybrid"
#> 
#> $replay_reservoir_digest
#> NULL
#> 
#> $replay_manifest_digest
#> NULL
#>