/** * Reuse of previously reviewed attribute descriptions from external `.polish` * folders (prior polish runs on OTHER usecases/domains). * * Matching is by `(action, pathKey)` and intentionally IGNORES usecase — the * external folder is from a different usecase, so the same `(action, path)` may * hit MULTIPLE external entries (e.g. GOLD_LOAN__confirm and PERSONAL_LOAN__confirm * both define `context.transaction_id`). Those become the list of matches. * * No dependency on draft.ts (keeps the dependency arrow draft.ts → reuse.ts clean); * fallback / sentinel literals are duplicated here intentionally. */ /** Cap on matches kept per `(action, path)` key for prompt injection. */ export declare const MAX_REUSE_MATCHES = 3; export type ReuseMatch = { /** draft.info — guaranteed non-empty, non-fallback, non-sentinel. */ info: string; /** Source usecase (for telemetry / distinctness). */ usecase: string; action: string; /** Dotted pathKey, e.g. "context.transaction_id". */ path: string; /** Absolute path of the review file the match came from (for logging). */ sourceFile: string; }; export type ReuseIndex = { /** key = `${action}::${pathKey}` → distinct matches (capped). */ byKey: Map; stats: { files: number; entries: number; kept: number; keys: number; }; }; export declare function reuseKey(action: string, pathKey: string): string; /** * Resolve a --reuse-from input to its `attributes-review` directory. * Accepts: the review dir itself, a `.polish` folder, or a polished output dir. * Returns null when none of those resolve. */ export declare function resolveReviewDir(inputPath: string): string | null; /** * Load + index all APPROVED, non-fallback reviewed descriptions across the * supplied --reuse-from paths. Never throws: unresolvable paths and malformed * files become warnings. */ export declare function loadReuseIndex(paths: string[]): { index: ReuseIndex; warnings: string[]; }; /** Matches for a dedup group's representative `(action, pathKey)`. */ export declare function lookupReuse(index: ReuseIndex | undefined, action: string, pathKey: string): ReuseMatch[]; //# sourceMappingURL=reuse.d.ts.map