/** * v2.15.0 follow-up — G13: impact scan service. * * Lightweight, file-glob-based impact analysis (no AST, no type * checking). For a given set of changed files, predict: * - which other files are likely affected (by path convention) * - which business flows touch them (config-driven) * - the risk level (high / medium / low) * - the "must-check" list (concrete business scenarios the user * must verify before shipping) * * Pure functions. The CLI wraps this with a `peaks impact scan` * command; `peaks impact must-check` returns the must-check list * subset. Persistence is per-invocation (no state file). */ /** A single impacted file predicted from a changed file. */ export interface ImpactedFile { /** Absolute or relative path. */ readonly path: string; /** Why this file is considered affected. */ readonly reason: string; /** Risk: high if the file is in core business paths. */ readonly risk: 'high' | 'medium' | 'low'; } /** A business flow that may be affected by the change. */ export interface AffectedFlow { /** Flow name (e.g. "用户登录", "Skill 权限校验"). */ readonly name: string; /** Why this flow is affected. */ readonly reason: string; } /** A must-check scenario the user must verify before shipping. */ export interface MustCheckItem { readonly scenario: string; readonly category: 'business' | 'ui' | 'integration' | 'data'; readonly priority: 'P0' | 'P1' | 'P2'; } /** Full scan report. */ export interface ImpactScanReport { readonly changedFiles: readonly string[]; readonly impactedFiles: readonly ImpactedFile[]; readonly affectedFlows: readonly AffectedFlow[]; readonly mustCheck: readonly MustCheckItem[]; readonly overallRisk: 'high' | 'medium' | 'low'; readonly warnings: readonly string[]; } export interface ImpactScanOptions { readonly changedFiles: readonly string[]; /** Optional business flow map: flow name → list of file globs. */ readonly businessFlows?: ReadonlyMap; } /** * Default business flow map (covers the most common B-end * archetypes; users can override via --flows in the CLI). */ export declare const DEFAULT_BUSINESS_FLOWS: ReadonlyMap; /** Simple glob matcher supporting `**` and `*`. */ export declare function matchGlob(pattern: string, path: string): boolean; /** * Run an impact scan. Pure function — no I/O. */ export declare function runImpactScan(opts: ImpactScanOptions): ImpactScanReport; /** * Extract just the must-check list from a scan report. */ export declare function mustCheckFromReport(report: ImpactScanReport): readonly MustCheckItem[];