/**
 * Increment Reopener
 *
 * Handles reopening of completed increments, tasks, and user stories
 * when issues are discovered after completion.
 *
 * Part of smart reopen functionality (increment 0032)
 */
import { IncrementMetadata, IncrementStatus } from '../types/increment-metadata.js';
/**
 * Reopen target types
 */
export declare enum ReopenTarget {
    /** Reopen entire increment */
    INCREMENT = "increment",
    /** Reopen specific task(s) */
    TASK = "task",
    /** Reopen user story + related tasks */
    USER_STORY = "user-story"
}
/**
 * Reopen context
 */
export interface ReopenContext {
    /** What to reopen */
    target: ReopenTarget;
    /** Increment ID */
    incrementId: string;
    /** Task ID (if target = TASK) */
    taskId?: string;
    /** User story ID (if target = USER_STORY) */
    userStoryId?: string;
    /** Reason for reopening (required for audit trail) */
    reason: string;
    /** Force reopen (bypass WIP checks) */
    force?: boolean;
}
/**
 * Reopen result
 */
export interface ReopenResult {
    /** Success flag */
    success: boolean;
    /** Items that were reopened */
    itemsReopened: string[];
    /** Warning messages */
    warnings: string[];
    /** Error messages */
    errors: string[];
    /** WIP limit exceeded? */
    wipLimitExceeded?: boolean;
    /** Increment metadata after reopen */
    metadata?: IncrementMetadata;
}
/**
 * WIP validation result
 */
export interface WIPValidationResult {
    /** Is reopen allowed? */
    allowed: boolean;
    /** Warning flag */
    warning: boolean;
    /** Message */
    message?: string;
    /** Current active count */
    activeCount?: number;
    /** Limit for increment type */
    limit?: number;
}
/**
 * Reopen history entry (audit trail)
 */
export interface ReopenHistoryEntry {
    /** When reopened */
    date: string;
    /** Why reopened */
    reason: string;
    /** Previous status */
    previousStatus: IncrementStatus;
    /** Who reopened (always 'user' for now) */
    by: string;
}
/**
 * Extended metadata with reopen history
 */
export interface IncrementMetadataWithReopen extends IncrementMetadata {
    /** Reopen tracking */
    reopened?: {
        /** Number of times reopened */
        count: number;
        /** Reopen history */
        history: ReopenHistoryEntry[];
    };
}
/**
 * Increment Reopener
 *
 * Provides smart reopen functionality for increments, tasks, and user stories
 */
export declare class IncrementReopener {
    /**
     * Reopen a completed increment
     *
     * @param context - Reopen context
     * @returns Reopen result
     */
    static reopenIncrement(context: ReopenContext): Promise<ReopenResult>;
    /**
     * Reopen specific task(s) in an increment
     *
     * @param context - Reopen context
     * @returns Reopen result
     */
    static reopenTask(context: ReopenContext): Promise<ReopenResult>;
    /**
     * Reopen user story + related tasks
     *
     * @param context - Reopen context
     * @returns Reopen result
     */
    static reopenUserStory(context: ReopenContext): Promise<ReopenResult>;
    /**
     * Validate WIP limits before reopening
     *
     * @param metadata - Increment metadata
     * @param force - Force reopen?
     * @returns Validation result
     */
    private static validateWIPLimits;
    /**
     * Reopen uncompleted tasks in increment
     *
     * @param incrementId - Increment ID
     * @param reason - Reason for reopening
     * @returns List of reopened task IDs
     */
    private static reopenUncompletedTasks;
    /**
     * Find tasks that implement a user story (by AC field)
     *
     * @param incrementId - Increment ID
     * @param userStoryId - User story ID (e.g., "US-001")
     * @returns List of task IDs
     */
    private static findTasksForUserStory;
    /**
     * Update user story status in living docs
     *
     * @param incrementId - Increment ID
     * @param userStoryId - User story ID
     * @param status - New status
     * @param reason - Reason
     * @returns Success flag
     */
    private static updateUserStoryStatus;
    /**
     * Find user story files in living docs
     *
     * @param basePath - Base search path
     * @param userStoryId - User story ID (e.g., "US-001")
     * @returns List of file paths
     */
    private static findUserStoryFiles;
}
//# sourceMappingURL=increment-reopener.d.ts.map