Skip to main content

discover_repository_root

Function discover_repository_root 

Source
pub fn discover_repository_root(
    start: &Path,
) -> Result<Option<PathBuf>, RepositoryRootDiscoveryError>
Expand description

Finds the repository root that owns repository-local knowledge contracts.

Discovery starts at start and walks ancestors. A .git directory/file or .knowledge directory wins immediately. If neither exists, the nearest AGENTS.md ancestor is used as a compatibility fallback.