Skip to contents

Given a filesystem path and a set of known Git repository roots, returns the nearest (deepest) matching repository root.

Usage

find_repo_root(path, repo_roots)

Arguments

path

Character. Observed filesystem path.

repo_roots

Character vector of repository root paths.

Value

Character. Matching repository root, or NA_character_ if no repository context is detected.

Details

The function provides lightweight repository contextualisation for observed filesystem Instantiations without querying Git history or repository internals.

Repository membership provides important operational and provenance context for later analytical interpretation:

  • grouping related filesystem observations

  • identifying software development contexts

  • distinguishing overlapping project structures

  • supporting later Record Set construction

The function performs purely structural matching:

  • no Git metadata is modified

  • no commit history is analysed

  • no repository semantics are interpreted

In RiC-aligned operational terms, the repository root acts as contextual evidence that observed filesystem Instantiations may participate in a shared documentary or development environment.

When multiple repository roots match, the deepest matching root is selected.