Skip to contents

Construct normalized context-relative structural paths from filesystem snapshot observations.

Usage

construct_structural_paths(snapshot, contexts)

Arguments

snapshot

A filesystem snapshot tibble containing at least:

  • full_path

  • rel_path

contexts

A contextual reconstruction object containing contextual roots.

Value

A tibble containing recursively expanded contextual structural paths.

The returned tibble includes:

context

Contextual ecosystem identifier.

root

Matched contextual root.

rel_path

Original storage-relative observational path.

structural_path

Context-relative normalized structural path.

explored_path

Recursively expanded structural abstraction.

Details

The function creates an intermediate structural abstraction layer between:

  • observational filesystem paths;

  • contextual semantic interpretation.

Observations are:

  • matched to contextual roots;

  • normalized into context-relative structural paths;

  • recursively expanded into hierarchical structural components.

This enables:

  • contextual filesystem diagnostics;

  • recursive structural matching;

  • contextual coverage analysis;

  • semantic refinement workflows.

For example:

"R/import/helpers.R"

expands into:

  • "R"

  • "R/import"

"tests/testthat/test-import.R"

expands into:

  • "tests"

  • "tests/testthat"

The function explicitly separates:

rel_path

Storage-relative observational filesystem path.

structural_path

Context-relative normalized structural path.

explored_path

Recursively expanded structural abstraction layer.

Examples

data("fscontextdemo_snapshot_02")

mini_context <- list(
  alpha = "D:/_packages/fscontextdemo"
)

mini_snapshot <- fscontextdemo_snapshot_02[
  c(1, 3, 5, 10),
]

structural_paths <- construct_structural_paths(
  snapshot = mini_snapshot,
  contexts = mini_context
)

structural_paths[, c("context", "structural_path", "explored_path")]
#> # A tibble: 3 × 3
#>   context structural_path                    explored_path
#>   <chr>   <chr>                              <chr>        
#> 1 alpha   .github/.gitignore                 .github      
#> 2 alpha   data/fscontextdemo_snapshot_01.rda data         
#> 3 alpha   docs/404.html                      docs