The Symlink Tool (SLT) helps you manage a folder of
pipeline output runs without a database. Drop it into your pipeline
to:
best/ symlink that always points to
your current best run,Windows users: keep your run folders on a local drive, such as
C:. The tool makes links there, and shared network drives will not allow it. The tool checks every folder when you build it and stops with a plain message if one will not work. If your folders live on a network drive, run the tool from Linux instead. This is a fundamental Windows limitation. See the technical vignette for more details.
modeling_root <- file.path(tempdir(), "slt_demo", "modeling_root")
dir.create(modeling_root, recursive = TRUE, showWarnings = FALSE)
slt <- SLT$new(
root_list = list("modeling_root" = modeling_root)
, central_log_root = modeling_root
)The tool is now tied to modeling_root. All symlinks,
logs, and reports will live there.
‘Run’ your modeling pipeline three times and populate each run with dummy results.
Version folder names are yours to choose, with one rule: names the
tool uses for its own symlinks (shortcuts) are reserved. That means
best and latest, and anything starting with
keep_ or remove_. Any type you add (see
vignette("user_defined_symlink_types", package = "vmTools"))
reserves its name the same way.
v1 <- next_version(modeling_root, "2024_02_01")
slt$make_new_version_folder(version_name = v1)
#> [1] "2024_02_01.01"
root_v1 <- slt$return_dynamic_fields()[["VERS_PATHS"]][["modeling_root"]]
invisible(file.create(file.path(root_v1, paste0("model_", 1:5, ".csv"))))
v2 <- next_version(modeling_root, "2024_02_01")
slt$make_new_version_folder(version_name = v2)
#> [1] "2024_02_01.02"
root_v2 <- slt$return_dynamic_fields()[["VERS_PATHS"]][["modeling_root"]]
invisible(file.create(file.path(root_v2, paste0("model_", 1:5, ".csv"))))
v3 <- next_version(modeling_root, "2024_02_01")
slt$make_new_version_folder(version_name = v3)
#> [1] "2024_02_01.03"
root_v3 <- slt$return_dynamic_fields()[["VERS_PATHS"]][["modeling_root"]]
invisible(file.create(file.path(root_v3, paste0("model_", 1:5, ".csv"))))print_tree(modeling_root)
#> |-- 2024_02_01.01
#> | |-- logs
#> | | `-- log_version_history.csv
#> | |-- model_1.csv
#> | |-- model_2.csv
#> | |-- model_3.csv
#> | |-- model_4.csv
#> | `-- model_5.csv
#> |-- 2024_02_01.02
#> | |-- logs
#> | | `-- log_version_history.csv
#> | |-- model_1.csv
#> | |-- model_2.csv
#> | |-- model_3.csv
#> | |-- model_4.csv
#> | `-- model_5.csv
#> `-- 2024_02_01.03
#> |-- logs
#> | `-- log_version_history.csv
#> |-- model_1.csv
#> |-- model_2.csv
#> |-- model_3.csv
#> |-- model_4.csv
#> `-- model_5.csvTag the most recent run as latest - useful when
downstream consumers always want the newest output regardless of
validation status.
print_tree(modeling_root, level = 1)
#> |-- 2024_02_01.01
#> |-- 2024_02_01.02
#> |-- 2024_02_01.03
#> |-- latest -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.03
#> |-- log_symlinks_central.csv
#> `-- report_key_versions.csvlatest is a singleton: only one folder
can hold it at a time, and the tool auto-demotes the previous holder. It
is also mutually exclusive with best -
marking a folder latest will auto-demote it from
best, and vice versa.
After reviewing v1 results, promote it to best.
best is also a singleton - only one
folder holds it at a time.
print_tree(modeling_root, level = 1)
#> |-- 2024_02_01.01
#> |-- 2024_02_01.02
#> |-- 2024_02_01.03
#> |-- best -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.01
#> |-- latest -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.03
#> |-- log_symlinks_central.csv
#> `-- report_key_versions.csvv3 looks even better - promote it. The tool automatically demotes v1.
Because v3 currently holds latest, promoting it to
best will also auto-demote it from latest.
print_tree(modeling_root, level = 1)
#> |-- 2024_02_01.01
#> |-- 2024_02_01.02
#> |-- 2024_02_01.03
#> |-- best -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.03
#> |-- log_symlinks_central.csv
#> `-- report_key_versions.csvv1 was used in a submitted paper - flag it so it won’t be lost or accidentally cleaned up.
Unlike best, many folders can carry a keep_
symlink simultaneously.
print_tree(modeling_root, level = 1)
#> |-- 2024_02_01.01
#> |-- 2024_02_01.02
#> |-- 2024_02_01.03
#> |-- best -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.03
#> |-- keep_2024_02_01.01 -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.01
#> |-- log_symlinks_central.csv
#> `-- report_key_versions.csvv2 was an experimental dead-end. Stage it for removal, then delete.
(to_remove <- slt$roundup_remove())
#> root_name version_name dir_name
#> <char> <char> <char>
#> 1: modeling_root 2024_02_01.02 /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/remove_2024_02_01.02
#> dir_name_resolved
#> <char>
#> 1: /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.02for (ver in to_remove$version_name) {
slt$delete_version_folders(
version_name = ver
, user_entry = list(comment = "Cleaning up experimental run")
, require_user_input = FALSE
)
}
#> Deleting /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.02
#> Deleting /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/remove_2024_02_01.02Scans every symlink-marked run and shows its current status. v2 is absent - it was deleted.
data.table::fread(file.path(modeling_root, "report_key_versions.csv"))[, ..show_vars]
#> log_id timestamp version_name action comment
#> <int> <char> <char> <char> <char>
#> 1: 3 2026_11_17_223511 2024_02_01.03 promote_best Improved priors, 2024 best
#> 2: 3 2026_11_17_223511 2024_02_01.01 promote_keep Journal submission 2024Full audit trail across all runs.
path_log <- slt$return_dictionaries()[["LOG_CENTRAL"]][["path"]]
data.table::fread(path_log)[, ..show_vars]
#> log_id timestamp version_name action comment
#> <int> <char> <char> <char> <char>
#> 1: 0 2026_11_17_223510 CENTRAL_LOG create log created
#> 2: 1 2026_11_17_223510 2024_02_01.03 promote_latest Most recent run
#> 3: 2 2026_11_17_223510 2024_02_01.01 promote_best First passing run
#> 4: 3 2026_11_17_223511 2024_02_01.03 demote_latest Improved priors, 2024 best
#> 5: 4 2026_11_17_223511 2024_02_01.01 demote_best Improved priors, 2024 best
#> 6: 5 2026_11_17_223511 2024_02_01.03 promote_best Improved priors, 2024 best
#> 7: 6 2026_11_17_223511 2024_02_01.01 promote_keep Journal submission 2024
#> 8: 7 2026_11_17_223511 2024_02_01.02 promote_remove Experimental - poor convergence
#> 9: 8 2026_11_17_223511 2024_02_01.02 delete_remove_folder Cleaning up experimental runprint_tree(modeling_root, level = 1)
#> |-- 2024_02_01.01
#> |-- 2024_02_01.03
#> |-- best -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.03
#> |-- keep_2024_02_01.01 -> /tmp/Rtmp3Nhm3U/slt_demo/modeling_root/2024_02_01.01
#> |-- log_symlinks_central.csv
#> `-- report_key_versions.csvThis walkthrough covers the core workflow. The technical reference,
vignette("symlink_tool_vignette_technical", package = "vmTools"),
covers:
best
symlinks across several projects into a full ‘best
set’,To add your own symlink types, see
vignette("user_defined_symlink_types", package = "vmTools").