/** * The logical evidence streams the Generate and Repair composites page over. * * Each workflow declares an ORDERED list of sections; a page packs records from * that list until the serialized envelope approaches the transport budget. The * order is part of the protocol: a cursor is a section index plus an offset, so * reordering sections would invalidate outstanding cursors (change * `harden-spec-workflow-lifecycle`, decision c9598b6f). * * Splitting the streams out of `spec-workflow.ts` keeps the section catalogue — * the thing a cursor is interpreted against — readable in one place. */ import type { RepoStructure } from '../analyzer/artifact-generator.js'; import type { DependencyGraphResult } from '../analyzer/dependency-graph.js'; import type { DomainEvidenceBundle } from '../generator/domain-evidence.js'; import type { EvidenceSection } from './evidence-stream.js'; /** * Generation stream order. * * Domain membership first: it is the smallest section and the one a host needs * to interpret every later record. Relationships last: they are the bulkiest and * the least necessary for a first draft. */ export declare const GENERATION_STREAM_SECTIONS: readonly ["domainEvidence", "signatures", "schemas", "routes", "uiComponents", "middleware", "envVars", "candidateDecisions", "overlap", "relationships"]; /** * Repair stream order: the existing spec first (the host is editing it), then * the observations that drive the edit, then the bulk context. */ export declare const REPAIR_STREAM_SECTIONS: readonly ["existingSpec", "coveredFunction", "uncoveredFunction", "staleMapping", "orphanRequirement", "structuralScope", "structuralChange", "drift", "domainEvidence", "candidateDecisions"]; /** Characters per `existingSpec` segment. Small enough that one segment always fits. */ export declare const SPEC_SEGMENT_CHARS = 4000; /** * Split spec text into ordered segments so a large existing spec pages instead * of being clipped. Segments are contiguous and concatenate back to the source. */ export declare function segmentSpecContent(content: string): Array<{ index: number; text: string; }>; export interface GenerationStreamInput { root: string; bundle: DomainEvidenceBundle; repo: RepoStructure; graph: DependencyGraphResult; /** Deterministic overlap observations against existing specs (may be empty). */ overlap: unknown[]; } /** * Build the full, UNPAGED generation stream. * * Every section is materialized so the pager can measure it; paging then selects * a contiguous window. Sections are independent, so one oversized file's * signatures never make the inventories unreachable. */ export declare function buildGenerationStream(input: GenerationStreamInput): EvidenceSection[]; export interface RepairStreamInput { specContent: string; coveredFunction: unknown[]; uncoveredFunction: unknown[]; staleMapping: unknown[]; orphanRequirement: unknown[]; structuralScope: unknown[]; structuralChange: unknown[]; drift: unknown[]; domainMembership: unknown[]; candidateDecisions: unknown[]; } /** Build the full, UNPAGED repair stream in protocol order. */ export declare function buildRepairStream(input: RepairStreamInput): EvidenceSection[]; /** * Flatten a `structural_diff` result into pageable records. * * The handler returns several parallel lists; tagging each entry with its `kind` * makes them one ordered section that can be continued mid-way, instead of an * indivisible object that either fits or does not. */ export declare function structuralChangeRecords(result: unknown): unknown[]; /** The scalar part of a structural diff: page-global, never paged. */ export declare function structuralChangeSummary(result: unknown): Record; //# sourceMappingURL=spec-workflow-stream.d.ts.map