/**
 * vsm-engine module — public entrypoint (ADR 019).
 *
 * Owner: Wertstrom
 *
 * Wertstrom P1 (KAR-878/KAR-986) — Berechnungs-Engine v2 + Validierungs-
 * Engine. Pure calculation + validation, no React, no Supabase, no
 * VsmNode/schema mutation. Safe to import from server, client, worker, and
 * (later) API-route contexts. See README.md for the architecture decision,
 * formula priority/fallback rules, and the full A11 spec-bullet → check/gap
 * mapping.
 *
 * Anything not re-exported from this file is internal (`internal/`) and may
 * change without notice. Cross-module access goes through this entrypoint
 * only — no deep imports into `internal/`.
 */

// A3 Customer Takt (§8.1/§8.2)
export { computeNetAvailableTimePerDay, computeTakt, type NetAvailableTimeResult, type ShiftModelInput, type TaktInput, type TaktResult } from './internal/work-time'

// A5 Inventory Coverage (§8.5)
export { computeInventoryCoverage, type InventoryCoverageResult, type InventoryDemandRate } from './internal/inventory-coverage'

// A10 Effective Capacity (§8.3)
export {
  computeEffectiveCapacity,
  computeUtilization,
  type EfficiencySource,
  type EffectiveCapacityResult,
  type NodeCapacityOverrides,
  type UtilizationResult,
} from './internal/capacity'

// A10 Process Cycle Efficiency (§8.6)
export { computePce, type PceResult } from './internal/pce'

// A10/B5 Quality Impact — scrap, rework, yield (§8.7)
export {
  computeCumulativeYield,
  computeExpectedGoodOutput,
  computeProcessQualityImpact,
  type CumulativeYieldResult,
  type ExpectedGoodOutputResult,
  type ProcessQualityInput,
  type ProcessQualityResult,
} from './internal/quality'

// A4 Timeline Ladder (§8.4/§8.9)
export { computeTimelineLadder, type InventoryTimeContribution, type TimeClassSum, type TimelineLadderResult } from './internal/timeline-ladder'

// A4 Timeline Sequence (§8.4/§8.9, Referenzwertstrom-Auftrag Kais §8) — per-node
// ordered blocks for a classic zigzag/Treppen-Zeitlinie, see module doc.
export { computeTimelineSequence, type ReworkLoopAnnotation, type TimelineBlock, type TimelineBlockCategory, type TimelineBlockLevel, type TimelineSequenceResult } from './internal/timeline-sequence'

// A6 Bottleneck Detection v2 (§8.8)
export { computeBottleneckV2, type BottleneckCandidate, type BottleneckConfidence, type BottleneckResult } from './internal/bottleneck'

// A11 Validation Engine (§17)
export {
  KNOWN_VALIDATION_GAPS,
  runValidation,
  type ValidationCategory,
  type ValidationContext,
  type ValidationGap,
  type ValidationIssue,
  type ValidationResult,
  type ValidationSeverity,
} from './internal/validation'

// A18 Management-Analyse (§18) — Wertstrom P7
export {
  computeManagementAnalysis,
  type AnalysisCategory,
  type AnalysisConfidence,
  type AnalysisStatement,
  type ManagementAnalysisContext,
  type ManagementAnalysisResult,
  type OpenMeasureInput,
  type ScenarioEffectDirection,
  type ScenarioEffectRow,
} from './internal/management-analysis'

// Shared
export type { MetricExplain } from './internal/types'
