
Find nearest Git repository root for an observed path
find_repo_root.RdGiven a filesystem path and a set of known Git repository roots, returns the nearest (deepest) matching repository root.
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.