/** * ADRFlow Core Types * * Defines all domain types used throughout the application. * These types are immutable and represent the core business entities. * * @module adrflow/core/types */ /** * Unique identifier for an ADR * Format: ADR-XXXX where X is a digit */ export type ADRId = `ADR-${string}`; /** * Status of an Architecture Decision Record */ export declare const ADRStatus: { /** Decision is proposed but not yet accepted */ readonly PROPOSED: "proposed"; /** Decision has been accepted and is in effect */ readonly ACCEPTED: "accepted"; /** Decision has been deprecated and should not be followed */ readonly DEPRECATED: "deprecated"; /** Decision has been replaced by another ADR */ readonly SUPERSEDED: "superseded"; }; export type ADRStatus = (typeof ADRStatus)[keyof typeof ADRStatus]; /** * Category of architectural decision */ export declare const DecisionCategory: { /** Technology stack choices (language, framework, library) */ readonly TECHNOLOGY: "technology"; /** System architecture patterns (microservices, monolith, event-driven) */ readonly ARCHITECTURE: "architecture"; /** API design decisions (REST, GraphQL, gRPC) */ readonly API_DESIGN: "api_design"; /** Data modeling and storage decisions */ readonly DATA_MODEL: "data_model"; /** Security-related decisions */ readonly SECURITY: "security"; /** Performance optimization decisions */ readonly PERFORMANCE: "performance"; /** Code structure and refactoring decisions */ readonly REFACTORING: "refactoring"; /** External dependency decisions */ readonly DEPENDENCY: "dependency"; /** Infrastructure and deployment decisions */ readonly INFRASTRUCTURE: "infrastructure"; /** Testing strategy decisions */ readonly TESTING: "testing"; /** Other decisions that don't fit above categories */ readonly OTHER: "other"; }; export type DecisionCategory = (typeof DecisionCategory)[keyof typeof DecisionCategory]; /** * An alternative option that was considered */ export interface Alternative { /** Name of the alternative */ readonly name: string; /** Description of what this alternative would entail */ readonly description: string; /** Advantages of this alternative */ readonly pros: readonly string[]; /** Disadvantages of this alternative */ readonly cons: readonly string[]; /** Reason why this alternative was not chosen (if applicable) */ readonly whyNotChosen?: string; } /** * A consequence of the decision */ export interface Consequence { /** Type of consequence */ readonly type: 'positive' | 'negative' | 'neutral'; /** Description of the consequence */ readonly description: string; /** Timeframe when this consequence manifests */ readonly timeframe?: 'immediate' | 'short-term' | 'long-term'; /** Which stakeholders are affected */ readonly affectedParties?: readonly string[]; } /** * Confidence level in the decision * Based on Olaf Zimmermann's ADR best practices */ export declare const ConfidenceLevel: { /** High confidence - well-researched, team consensus */ readonly HIGH: "high"; /** Medium confidence - reasonable choice but some unknowns */ readonly MEDIUM: "medium"; /** Low confidence - best guess, needs validation */ readonly LOW: "low"; /** Experimental - trying something new, expect to revisit */ readonly EXPERIMENTAL: "experimental"; }; export type ConfidenceLevel = (typeof ConfidenceLevel)[keyof typeof ConfidenceLevel]; /** * Architectural significance level * Helps prioritize which decisions need ADRs */ export declare const SignificanceLevel: { /** Critical - affects entire system, very costly to change */ readonly CRITICAL: "critical"; /** High - significant impact, expensive to reverse */ readonly HIGH: "high"; /** Medium - moderate impact, some effort to change */ readonly MEDIUM: "medium"; /** Low - limited impact, easy to reverse */ readonly LOW: "low"; }; export type SignificanceLevel = (typeof SignificanceLevel)[keyof typeof SignificanceLevel]; /** * Decision driver - what influenced the decision */ export interface DecisionDriver { /** Type of driver */ readonly type: 'requirement' | 'constraint' | 'assumption' | 'risk' | 'goal'; /** Description of the driver */ readonly description: string; /** Priority of this driver */ readonly priority?: 'must-have' | 'should-have' | 'nice-to-have'; } /** * A file that was changed as part of implementing the decision */ export interface RelatedFile { /** Path to the file relative to project root */ readonly path: string; /** Type of change made to the file */ readonly changeType: 'created' | 'modified' | 'deleted' | 'renamed'; /** Number of lines changed (added + removed) */ readonly linesChanged?: number; } /** * Reference to the source of the decision */ export interface SourceReference { /** Type of source */ readonly type: 'claude_session' | 'cursor_session' | 'manual' | 'imported'; /** Identifier of the source (session ID, etc.) */ readonly sourceId?: string; /** Timestamp when the decision was captured */ readonly capturedAt: Date; } /** * Architecture Decision Record * * An immutable record of an architectural decision made during development. * ADRs capture the context, decision, alternatives, and consequences to * preserve institutional knowledge. * * Based on best practices from Olaf Zimmermann's ADR guidance: * - Prioritize by architectural significance * - Disclose confidence levels * - Document decision drivers * - Identify stakeholders and decision makers */ export interface ADR { /** Unique identifier (e.g., ADR-0042) */ readonly id: ADRId; /** Short, descriptive title */ readonly title: string; /** Current status of the decision */ readonly status: ADRStatus; /** Category of the decision */ readonly category: DecisionCategory; /** When the decision was made */ readonly createdAt: Date; /** When the record was last updated */ readonly updatedAt: Date; /** The problem or situation that required a decision */ readonly context: string; /** What was decided */ readonly decision: string; /** Other options that were considered */ readonly alternatives: readonly Alternative[]; /** Positive and negative outcomes of the decision */ readonly consequences: readonly Consequence[]; /** Files that were changed to implement the decision */ readonly relatedFiles: readonly RelatedFile[]; /** Reference to the source of this decision */ readonly source: SourceReference; /** Tags for categorization and search */ readonly tags: readonly string[]; /** ID of the ADR this supersedes (if any) */ readonly supersedes?: ADRId; /** ID of the ADR that superseded this (if any) */ readonly supersededBy?: ADRId; /** Confidence level in this decision */ readonly confidence?: ConfidenceLevel; /** Architectural significance - how important is this decision */ readonly significance?: SignificanceLevel; /** Decision drivers - requirements, constraints, assumptions that led to this decision */ readonly drivers?: readonly DecisionDriver[]; /** Who made this decision (for accountability) */ readonly decisionMakers?: readonly string[]; /** Stakeholders who should be informed or consulted */ readonly stakeholders?: readonly string[]; /** When this decision should be revisited */ readonly reviewDate?: Date; /** Known risks or uncertainties with this decision */ readonly risks?: readonly string[]; /** Assumptions that, if invalidated, would require revisiting this decision */ readonly assumptions?: readonly string[]; } /** * Input for creating a new ADR */ export interface CreateADRInput { readonly title: string; readonly context: string; readonly decision: string; readonly category?: DecisionCategory; readonly alternatives?: readonly Alternative[]; readonly consequences?: readonly Consequence[]; readonly relatedFiles?: readonly RelatedFile[]; readonly tags?: readonly string[]; readonly supersedes?: ADRId; readonly source?: Partial; readonly confidence?: ConfidenceLevel; readonly significance?: SignificanceLevel; readonly drivers?: readonly DecisionDriver[]; readonly decisionMakers?: readonly string[]; readonly stakeholders?: readonly string[]; readonly reviewDate?: Date; readonly risks?: readonly string[]; readonly assumptions?: readonly string[]; } /** * Input for updating an existing ADR */ export interface UpdateADRInput { readonly id: ADRId; readonly status?: ADRStatus; readonly title?: string; readonly context?: string; readonly decision?: string; readonly category?: DecisionCategory; readonly alternatives?: readonly Alternative[]; readonly consequences?: readonly Consequence[]; readonly relatedFiles?: readonly RelatedFile[]; readonly tags?: readonly string[]; readonly supersededBy?: ADRId; } /** * Search options for querying ADRs */ export interface SearchOptions { /** Maximum number of results to return */ readonly limit?: number; /** Offset for pagination */ readonly offset?: number; /** Filter by status */ readonly status?: ADRStatus; /** Filter by category */ readonly category?: DecisionCategory; /** Filter by tags (any match) */ readonly tags?: readonly string[]; /** Filter by date range (start) */ readonly since?: Date; /** Filter by date range (end) */ readonly until?: Date; } /** * Result of a search operation */ export interface SearchResult { /** Matching ADRs */ readonly adrs: readonly ADR[]; /** Total number of matches (for pagination) */ readonly total: number; /** Time taken to execute search in milliseconds */ readonly elapsed: number; } /** * Timeline options for chronological listing */ export interface TimelineOptions { /** Maximum number of results */ readonly limit?: number; /** Return results before this date */ readonly before?: Date; /** Return results after this date */ readonly after?: Date; /** Sort order */ readonly order?: 'asc' | 'desc'; } /** * Statistics about the ADR collection */ export interface ADRStats { /** Total number of ADRs */ readonly total: number; /** Count by status */ readonly byStatus: Readonly>; /** Count by category */ readonly byCategory: Readonly>; /** Date of oldest ADR */ readonly oldestDate?: Date; /** Date of newest ADR */ readonly newestDate?: Date; /** Storage size in bytes */ readonly storageSizeBytes: number; } //# sourceMappingURL=types.d.ts.map