Skip to contents

Reconstructs a contextual observational corpus from one or more filesystem snapshot fragments.

The function:

  1. merges observational filesystem snapshots;

  2. filters observations to selected contextual roots;

  3. enriches observations with contextual identifiers;

  4. derives lightweight structural grouping heuristics;

  5. creates a contextual Record Set projection.

The workflow is optimized for:

  • forensic reconstruction;

  • filesystem archaeology;

  • exploratory analytical workflows;

  • development environment reconstruction;

  • operational reporting.

Unlike snapshot_to_recordset_df(), this function intentionally prioritizes analytical reconstruction over preservation-oriented semantic assertions.

Usage

snapshot_to_reconstruction_context(
  snapshot_files,
  roots,
  exclude_patterns = "\\.Rcheck"
)

Arguments

snapshot_files

Character vector of .rds snapshot files created with snapshot_storage().

roots

Character vector of contextual root paths used for observational selection.

exclude_patterns

Character vector of exclusion patterns passed to subset_snapshot().

Value

A contextual observational reconstruction table enriched with:

  • contextual observational identifiers;

  • storage-aware path identifiers;

  • structural grouping heuristics;

  • lightweight contextual Record Set projections.

Core observational variables typically include:

  • storage_id;

  • person_id;

  • full_path;

  • rel_path;

  • filename;

  • extension;

  • mtime;

  • scan_time.

Contextual enrichment variables may include:

  • inst_id;

  • storage_path_id;

  • observation_id;

  • structural_group;

  • component;

  • record_set_id;

  • resource_id;

  • locator_path.

Details

Snapshot fragments are merged observationally.

Duplicate filesystem observations are intentionally preserved because the same resource may legitimately appear across:

  • multiple machines;

  • multiple storage contexts;

  • repeated scans;

  • synchronised working environments.

The resulting object remains observational and analytical.

Structural grouping heuristics are lightweight filesystem-derived operational projections and do not imply authoritative archival Record Set construction.

The function serves as the foundational reconstruction layer for:

Examples

data("fscontextdemo_snapshot_01")

tmp <- tempfile(fileext = ".rds")
saveRDS(fscontextdemo_snapshot_01, tmp)

snapshot_to_reconstruction_context(
  snapshot_files = tmp,
  roots = "D:/_packages/fscontextdemo/R"
)
#> # A tibble: 2 × 30
#>   storage_id   person_id full_path rel_path filename stem  extension type   size
#>   <chr>        <chr>     <chr>     <chr>    <chr>    <chr> <chr>     <fct> <dbl>
#> 1 fscontextde… demo_user D:/_pack… R/data-… data-fs… data… r         file    487
#> 2 fscontextde… demo_user D:/_pack… R/hello… hello_w… hell… r         file   1006
#> # ℹ 21 more variables: mtime <dttm>, ctime <dttm>, atime <dttm>,
#> #   birth_time <dttm>, depth <int>, links <dbl>, permissions <fs::perms>,
#> #   quick_sig <chr>, scan_time <dttm>, repo_root <chr>, repo_rel_path <chr>,
#> #   git_tracked <lgl>, storage_path_id <chr>, rel_root_path <chr>,
#> #   storage_full_path <chr>, observation_id <chr>, structural_group <chr>,
#> #   component <chr>, record_set_id <chr>, resource_id <chr>, locator_path <chr>