/** * File discovery + SHA computation for the extraction pipeline. * * Two kinds of walks: * - `walkProseFiles` — ADRs + additional docs, for intent extraction. * ADR files win over doc-glob files when both match. * - `walkSourceFiles` — code files by adapter extension, used to build * the symbol inventory. * * All paths in returned records are repo-relative forward-slash * (via normalizePath) so they match the shapes stored in atlas.json * and SQLite. */ import type { ContextAtlasConfig } from "../types.js"; import { type AdrFormat } from "../utils/adr-enumeration.js"; export type ProseBucket = "adr" | "doc"; export interface ProseFile { absPath: string; relPath: string; sha: string; bucket: ProseBucket; /** * File format inferred from extension. Present on ADR-bucket files * (where Scope γ' walking accepts .md + .rst); doc-bucket files are * treated as Markdown via the existing glob path. */ format?: AdrFormat; } export interface SourceFile { absPath: string; relPath: string; sha: string; } export interface ShaDiff { /** Files on disk with a different SHA from the committed baseline. */ changed: ProseFile[]; /** Files on disk matching the committed baseline; extraction can skip. */ unchanged: ProseFile[]; /** Files present on disk but absent from the committed baseline. */ added: ProseFile[]; /** * Source paths that were in the committed baseline but no longer on disk. * Their claims should be deleted and their source_shas entry removed. */ deleted: string[]; } export declare function computeFileSha(absPath: string): string; export declare function diffShas(current: readonly ProseFile[], committed: Readonly>): ShaDiff; /** * Walk prose files (ADRs + doc globs). Paths in returned records are * stored relative to the most useful base: * - If the prose file resolves UNDER `sourceRoot`: relative to * `sourceRoot` (backward compat with all existing atlases). * - If it resolves OUTSIDE `sourceRoot`: relative to the bucket's * natural base — the ADR directory for ADR-bucket files, * `configRoot` for docs-bucket files. * * `configRoot` is the resolution base for `adrs.path` and * `docs.include` glob patterns — i.e. where `.contextatlas.yml` * lives. Defaults to `sourceRoot`, preserving the common case where * config sits in the source root. See ADR-08 for the external-ADRs * architecture that motivated the separation. */ export declare function walkProseFiles(sourceRoot: string, config: Pick, configRoot?: string): ProseFile[]; /** * Walk source files for symbol-inventory construction. * * `excludePatterns` (v0.4 Step 2 / A4) is an array of minimatch * globs evaluated against repo-relative forward-slash paths. Files * matching ANY pattern are dropped from the result. Patterns are * pre-compiled once before walk for O(n_patterns) per-file check. * * Empty / omitted `excludePatterns` preserves v0.3 behavior (no * extraction-time filtering beyond `SOURCE_EXCLUDE_DIRS`). */ export declare function walkSourceFiles(repoRoot: string, extensions: readonly string[], excludePatterns?: readonly string[]): SourceFile[]; //# sourceMappingURL=file-walker.d.ts.map