export interface CodeReference { file: string; function?: string; lineRange?: [number, number]; } export interface DataAccess { table: string; operation: 'read' | 'write' | 'delete'; columns?: string[]; } export interface FlowStep { order: number; action: string; codeRef?: CodeReference; dataAccess?: DataAccess; } export interface IntentFlow { id: string; name: string; description: string; actor: string; trigger: string; steps: FlowStep[]; successCriteria: string; errorPaths: string[]; codePaths: CodeReference[]; } export interface EntityField { name: string; type: string; constraints: string[]; } export interface EntityRelationship { target: string; type: 'one-to-one' | 'one-to-many' | 'many-to-many'; foreignKey?: string; } export interface DataEntity { name: string; source: string; fields: EntityField[]; relationships: EntityRelationship[]; } export interface AuthGuard { pattern: string; requiredRole?: string; mechanism: string; } export interface AuthModel { strategy: string; roles: string[]; guards: AuthGuard[]; } export interface FeatureGroup { name: string; flows: string[]; completeness: 'full' | 'partial' | 'stub'; } export type IntentGapType = 'missing-flow' | 'dead-code' | 'unguarded-route' | 'orphaned-table' | 'incomplete-flow'; export interface IntentGap { type: IntentGapType; description: string; evidence: string; gapId?: string; } export interface IntentGapSuppression { gapId: string; type: IntentGapType; description: string; evidence?: string; reason: string; suppressedAt: string; matchAnchors?: string[]; matchTokens?: string[]; } export interface IntentManifest { version: 1; extractedAt: string; codebaseRoot: string; frameworks: string[]; flows: IntentFlow[]; dataModel: DataEntity[]; authModel: AuthModel; featureMap: FeatureGroup[]; gaps: IntentGap[]; confirmedBy?: string; confirmedAt?: string; /** * Content fingerprint of the indexed file set at extraction time * (manifest-stability.ts). A matching fingerprint on a later run means the * codebase is unchanged and this manifest can be reused verbatim, making * the claim set deterministic across reruns. */ sourceFingerprint?: string; } export interface ManifestDelta { addedFlows: IntentFlow[]; removedFlows: IntentFlow[]; changedFlows: Array<{ before: IntentFlow; after: IntentFlow; }>; addedEntities: DataEntity[]; removedEntities: DataEntity[]; addedGaps: IntentGap[]; removedGaps: IntentGap[]; }