/** * path-identity — canonical path identity for cross-task/cross-change writes. * * G-026 M2 (ADR-0004 #13/#16): a path's identity is * { workspace, repoBoundary: 'root'|'submodule', submoduleName?, canonicalRelative }. * Two writes to the same identity are the same write target regardless of how * the path was spelled (absolute/relative/./.., submodule-relative vs root-relative). * Unknown/unresolvable paths are `unowned` — the conservative fail-closed branch. */ /** Repository boundary in which a path lives. */ export type RepoBoundary = "root" | "submodule" | "unknown"; /** Canonical identity of a single path within the workspace. */ export interface PathIdentity { workspace: string; repoBoundary: RepoBoundary; /** Set iff repoBoundary === "submodule". */ submoduleName?: string; /** Identity of the repository (root = workspace root; submodule = its dir). */ repoRoot: string; /** Path relative to the owning repository root, always '/' separated. */ canonicalRelative: string; /** Human-readable key for registry lookups (stable across path spellings). */ key: string; } export interface SubmoduleInfo { name: string; /** Absolute path of the submodule worktree directory. */ dir: string; } /** Collect repo mapping: workspace root + registered submodules (.gitmodules .path). */ export declare function collectRepoMap(workspace: string, execSyncImpl?: (cmd: string, opts: { encoding: string; cwd: string; }) => { toString(): string; }): Promise<{ workspace: string; submodules: SubmoduleInfo[]; }>; /** Sort submodules so the longest dir prefix wins attribution (nested safe). */ export declare function sortSubmodulesByLen(submodules: SubmoduleInfo[]): SubmoduleInfo[]; /** Resolve a path (repo-relative or absolute) to a canonical identity within the workspace. */ export declare function identityForPath(p: string, repoMap: { workspace: string; submodules: SubmoduleInfo[]; }): PathIdentity; /** * Normalize a list of scope paths: trim, drop empties, preserve duplicates. * Each entry is resolved against the workspace for identity purposes. */ export declare function normalizeScopePaths(scope: string | undefined): string[];