/** * 0.11.13+ — cross-brew provenance index. * * Every successful brew appends entity-level updates to * `.brewing/provenance.json`. Indexed by entity (file / symbol / route), * not by brew event, so a future brew on overlapping surface can ask * "what's the history of this surface?" with one lookup. * * 0.11.13 ships writes only — no agent reads the file yet. This * bootstraps the index so by the time 0.12.0 (reads) lands, the data * isn't empty. Schema versioned so we can iterate on shape during the * write-only window without forcing migrations on every project. */ export declare const PROVENANCE_PATH = ".brewing/provenance.json"; export declare const PROVENANCE_SCHEMA_VERSION = 1; export interface FileProvenance { first_added_by: string; modified_by: string[]; last_brew: string; last_pr: string | null; last_modified: string; halt_count: number; regression_count: number; } export interface SymbolProvenance { file: string; /** "component" | "helper" | "type" | "route" | "page" | "hook" | "other" — coarse for now. */ kind: string; added_by: string; modified_by: string[]; } export interface RouteProvenance { stories: string[]; current_file: string | null; } export interface ProvenanceIndex { schema_version: number; by_file: Record; by_symbol: Record; by_route: Record; } export interface BrewProvenanceEntry { story_id: string; pr_url: string | null; /** ISO 8601 timestamp. */ completed_at: string; /** Files the brew successfully edited (filtered by allowedPaths). */ files_touched: string[]; /** Tier-1 file regressions: tests that brew turned red after they had been green. */ regression_count: number; /** Whether brew halted (vs. clean success). */ halted: boolean; /** Optional: explicit symbol-level changes if the caller has them. Empty allowed. */ symbols_added?: Array<{ name: string; file: string; kind: string; }>; /** Optional: routes added/touched (e.g., new src/app/x/page.tsx). */ routes_added?: Array<{ path: string; file: string; }>; } /** Read the current provenance index, or return a fresh empty one. */ export declare function readProvenance(repoRoot: string): ProvenanceIndex; /** * Apply a single brew's results to the index. Returns the updated * index. Pure: doesn't write to disk; caller controls persistence. */ export declare function applyBrewEntry(index: ProvenanceIndex, entry: BrewProvenanceEntry): ProvenanceIndex; /** Write the index to disk. Creates the .brewing dir if missing. */ export declare function writeProvenance(repoRoot: string, index: ProvenanceIndex): void; /** * Convenience: read, apply, write in one call. The brew completion * path uses this; tests use the lower-level functions. */ export declare function recordBrewProvenance(repoRoot: string, entry: BrewProvenanceEntry): void; /** * 0.12.0+ — render a "prior brew history" markdown block for files * the current brew is touching. Returns empty string when there's * no history to surface. * * Inputs: * - index: the loaded provenance.json * - manifestFiles: file paths from the current story's manifest * (i.e., the files brew's tests are likely to exercise; loaded by * deriveStoryTestFiles or similar at the brew layer) * - currentStoryId: skip entries that only mention the current story * (no novel context — agent already knows about its own brew). * * The block is small by design: bounded attention is the point. We * include hot-spot files only (touched in ≥2 brews) plus files with * non-zero halt or regression counts. */ export declare function renderPriorContextBlock(index: ProvenanceIndex, manifestFiles: string[], currentStoryId: string, options?: { maxFiles?: number; }): string; //# sourceMappingURL=provenance.d.ts.map