/**
 * Extract report data from a single spec for HTML reports.
 * Populates all available fields including impactAnalysis, actuals, etc.
 */
export function extractPerSpecData(spec, affectedFiles, architecturalDecisions) {
    return {
        specId: spec.id,
        title: spec.title,
        status: spec.status,
        difficulty: String(spec.difficulty),
        risk: spec.risk,
        devHours: spec.estimation.devHours,
        reviewHours: spec.estimation.reviewHours,
        totalCostUsd: spec.estimation.totalCostUsd,
        tags: spec.tags,
        dependencies: spec.dependencies,
        blockedBy: spec.blockedBy,
        scope: spec.scope,
        target: spec.target,
        gitBranch: spec.gitBranch,
        diagrams: [],
        affectedFiles,
        architecturalDecisions,
        generatedAt: new Date().toISOString(),
        impactAnalysis: extractImpactAnalysis(spec),
        actuals: extractActuals(spec),
        estimationReasoning: spec.estimation.tokenOptimization.reasoning || undefined,
    };
}
function extractImpactAnalysis(spec) {
    if (!spec.impactAnalysis) {
        return undefined;
    }
    const ia = spec.impactAnalysis;
    return {
        affectedModules: ia.affectedModules,
        affectedFiles: ia.affectedFiles,
        breakingChanges: ia.breakingChanges,
        rollbackPlan: ia.rollbackPlan,
    };
}
function extractActuals(spec) {
    if (!spec.actuals) {
        return undefined;
    }
    const a = spec.actuals;
    return {
        devHours: a.devHours,
        reviewHours: a.reviewHours,
        totalCostUsd: a.totalCostUsd,
        completedAt: a.completedAt,
        notes: a.notes,
    };
}
//# sourceMappingURL=spec-data-extractor.js.map