Production-oriented MoonBit change-point detection, streaming windows, multivariate monitoring, replay, SLO and alert routing
moon add Zy789kl/moon-change-point///|
import {
"Zy789kl/moon-change-point" @cp,
}
///|
fn main {
let detector = @cp.Cusum::new(target_mean=0.0, control_limit=5.0, drift=0.5)
let result = detector.update_result(2.0, index=1)
println(result.summary())
}moon run cmd/main| detector | detections | first detection | precision | recall | F1 |
|---|---|---|---|---|---|
| CUSUM | 77 | 258 | 0.012987012987012988 | 1 | 0.025641025641025647 |
| Robust-Z | 11 | 257 | 0.09090909090909091 | 1 | 0.16666666666666669 |
| Projection ensemble | 1 | 257 | 1 | 1 | 1 |
moon fmt --check
moon check --deny-warn --target all
moon build --target all
moon test --deny-warn --target allpub struct AdaptiveBaseline {
moments : OnlineMoments
value : Double
learning_rate : Double
initialized : Bool
}pub struct AdaptiveThreshold {
threshold : Double
rate : Double
minimum : Double
maximum : Double
count : Int
}fn AdaptiveThreshold::new(initial? : Double, rate? : Double, minimum? : Double, maximum? : Double) -> AdaptiveThresholdpub(all) enum AggregationKind {
MeanAggregate
SumAggregate
MinimumAggregate
MaximumAggregate
StandardDeviationAggregate
}pub struct AlertBudget {
capacity : Double
refill : Double
tokens : Double
suppressed : Int
}fn AlertEvent::new(metric : String, point : ChangePoint, suppressed? : Bool, ordinal? : Int) -> AlertEventpub struct AlertPolicy {
minimum_score : Double
minimum_confidence : Double
minimum_gap : Int
recovery_points : Int
quiet_points : Int
healthy_points : Int
}fn AlertPolicy::new(minimum_score? : Double, minimum_confidence? : Double, minimum_gap? : Int, recovery_points? : Int) -> AlertPolicypub(all) enum AlertSeverity {
Informational
Warning
Critical
}pub struct Ar1Forecaster {
mean : Double
covariance : Double
variance : Double
previous : Double
count : Int
forgetting : Double
}pub struct BenchmarkResult {
name : String
samples : Int
passes : Int
detections : Int
first_detection : Int
checksum : Double
truth_count : Int
metrics : ChangePointMetrics
}pub struct BootstrapEstimate {
mean : Double
lower : Double
upper : Double
standard_error : Double
replicates : Int
}pub(all) enum ChangeDirection {
Increase
Decrease
VarianceIncrease
VarianceDecrease
DistributionShift
Unknown
}pub struct ChangePoint {
timestamp : Int64
index : Int
score : Double
confidence : Double
severity : AlertSeverity
direction : ChangeDirection
detector : String
baseline : Double
observed : Double
}fn ChangePoint::from_result(point : SignalPoint, result : DetectionResult, detector : String, baseline : Double) -> ChangePointpub struct ChangePointMetrics {
true_positives : Int
false_positives : Int
false_negatives : Int
precision : Double
recall : Double
f1 : Double
mean_detection_delay : Double
}pub struct ConsecutiveRule {
required : Int
hits : Int
misses : Int
}pub struct Cusum {
target_mean : Double
control_limit : Double
drift : Double
g_positive : Double
g_negative : Double
t : Int
}pub struct DataQualityGate {
minimum_ratio : Double
reject_non_monotonic : Bool
reject_dimension_mismatch : Bool
}fn DataQualityGate::new(minimum_ratio? : Double, reject_non_monotonic? : Bool, reject_dimension_mismatch? : Bool) -> DataQualityGatepub struct DetectionExplanation {
result : DetectionResult
baseline : Double
observed : Double
deviation : Double
relative_change : Double
contributions : Array[EvidenceContribution]
recommendation : String
}pub struct DetectionResult {
changed : Bool
score : Double
confidence : Double
direction : ChangeDirection
index : Int
evidence : Double
}fn DetectionResult::new(changed : Bool, score : Double, confidence : Double, direction : ChangeDirection, index : Int, evidence? : Double) -> DetectionResultpub struct DetectorSpec {
name : String
family : String
online : Bool
multivariate : Bool
robust : Bool
default_threshold : Double
description : String
}fn DetectorSpec::new(name : String, family : String, online : Bool, multivariate : Bool, robust : Bool, default_threshold : Double, description : String) -> DetectorSpecpub(all) enum DetectorType {
CusumDetector(Cusum)
PageHinkleyDetector(PageHinkley)
BayesianDetector(Bayesian)
}pub struct DeterministicRng {
state : Int64
}pub struct DistributionShiftDetector {
reference : DoubleWindow
current : DoubleWindow
threshold : Double
index : Int
}fn DistributionShiftDetector::new(window_size? : Int, threshold? : Double) -> DistributionShiftDetectorfn DistributionShiftDetector::update(self : DistributionShiftDetector, value : Double) -> DetectionResultpub struct EnsembleResult {
result : DetectionResult
votes : Int
detector_count : Int
agreement : Double
}pub struct EvidenceContribution {
name : String
value : Double
weight : Double
contribution : Double
}fn EvidenceContribution::new(name : String, value : Double, weight? : Double) -> EvidenceContributionpub struct EwmaDetector {
baseline : Double
variance : Double
alpha : Double
threshold : Double
warmup : Int
count : Int
index : Int
initialized : Bool
}fn EwmaDetector::new(alpha? : Double, threshold? : Double, warmup? : Int, initial_mean? : Double, initial_variance? : Double) -> EwmaDetectorpub struct FeatureExtractor {
left : DoubleWindow
right : DoubleWindow
threshold : Double
index : Int
}pub struct ForecastPoint {
prediction : Double
lower : Double
upper : Double
residual : Double
}fn ForecastPoint::new(prediction : Double, residual : Double, uncertainty? : Double) -> ForecastPointpub struct Histogram {
minimum : Double
maximum : Double
bins : Int
counts : Array[Int]
total : Int
}pub struct HoltForecaster {
level : Double
trend : Double
alpha : Double
beta : Double
count : Int
}pub struct HysteresisRule {
enter_threshold : Double
exit_threshold : Double
active : Bool
}pub struct Incident {
metric : String
first_timestamp : Int64
last_timestamp : Int64
alerts : Int
critical : Int
maximum_score : Double
direction : ChangeDirection
}pub(all) enum LateDataPolicy {
Drop
KeepForCorrection
ReplaceSameTimestamp
}fn LinearForecaster::new(window_size? : Int, horizon? : Int, uncertainty_multiplier? : Double) -> LinearForecasterpub struct MahalanobisDetector {
stats : OnlineVectorStats
threshold : Double
warmup : Int
index : Int
}fn MahalanobisDetector::new(dimension : Int, threshold? : Double, warmup? : Int) -> MahalanobisDetectorfn MahalanobisDetector::update(self : MahalanobisDetector, values : Array[Double]) -> DetectionResultpub struct MeanVarianceDetector {
baseline : DoubleWindow
current : DoubleWindow
mean_threshold : Double
variance_threshold : Double
index : Int
}fn MeanVarianceDetector::new(window_size? : Int, mean_threshold? : Double, variance_threshold? : Double) -> MeanVarianceDetectorpub struct MetricPipeline {
name : String
detector : PipelineDetector
policy : AlertPolicy
index : Int
ordinal : Int
baseline : Double
}fn MetricPipeline::new(name : String, detector : PipelineDetector, policy? : AlertPolicy, baseline? : Double) -> MetricPipelinepub(all) enum MissingValueStrategy {
DropValue
ImputeLast
ImputeMean
ImputeZero
MarkUnknown
}pub struct MultiMetricMonitor {
pipelines : Array[MetricPipeline]
processed : Int
emitted : Int
suppressed : Int
}fn MultiMetricMonitor::process(self : MultiMetricMonitor, metric_index : Int, timestamp : Int64, value : Double) -> AlertEvent?fn MultiMetricMonitor::process_batch(self : MultiMetricMonitor, metric_index : Int, points : Array[SignalPoint]) -> Array[AlertEvent]pub struct MultiScaleDetector {
short : RobustZDetector
medium : RobustZDetector
long : TrendShiftDetector
minimum_consensus : Double
index : Int
}fn MultiScaleDetector::new(short? : Int, medium? : Int, long? : Int, minimum_consensus? : Double) -> MultiScaleDetectorfn MultivariateEnsemble::new(detectors : Array[ProjectionDetector], quorum? : Int) -> MultivariateEnsemblefn MultivariateEnsemble::update(self : MultivariateEnsemble, values : Array[Double]) -> DetectionResultpub struct OfflineChange {
index : Int
score : Double
left_mean : Double
right_mean : Double
left_variance : Double
right_variance : Double
direction : ChangeDirection
}pub struct OnlineMoments {
count : Int
mean : Double
m2 : Double
minimum : Double
maximum : Double
}fn OnlineVectorStats::standardized(self : OnlineVectorStats, values : Array[Double]) -> Array[Double]pub struct PageHinkley {
target_mean : Double
control_limit : Double
delta : Double
alpha : Double
sum : Double
min_sum : Double
n : Int
}fn PageHinkley::new(target_mean? : Double, control_limit? : Double, delta? : Double, alpha? : Double) -> PageHinkleypub(all) enum PipelineDetector {
LegacyDetector(Detector)
Ewma(EwmaDetector)
RobustZ(RobustZDetector)
VarianceShift(VarianceShiftDetector)
TrendShift(TrendShiftDetector)
IqrSpike(IqrSpikeDetector)
}fn PipelineDetector::update(self : PipelineDetector, value : Double, index : Int) -> DetectionResultpub struct ProductionAdaptiveBaselineDetector {
window : DoubleWindow
learning_rate : Double
threshold : Double
warmup : Int
baseline : Double
index : Int
initialized : Bool
}fn ProductionAdaptiveBaselineDetector::baseline(self : ProductionAdaptiveBaselineDetector) -> Doublefn ProductionAdaptiveBaselineDetector::new(window_size? : Int, learning_rate? : Double, threshold? : Double, warmup? : Int) -> ProductionAdaptiveBaselineDetectorfn ProductionAdaptiveBaselineDetector::update(self : ProductionAdaptiveBaselineDetector, value : Double) -> DetectionResultpub struct ProductionAlertConfig {
minimum_score : Double
minimum_confidence : Double
minimum_gap : Int64
recovery_points : Int
action : RecoveryAction
severity : AlertSeverity
budget_per_window : Int
budget_window : Int64
}fn ProductionAlertConfig::new(minimum_score? : Double, minimum_confidence? : Double, minimum_gap? : Int64, recovery_points? : Int, action? : RecoveryAction, severity? : AlertSeverity, budget_per_window? : Int, budget_window? : Int64) -> ProductionAlertConfigpub struct ProductionAlertEnvelope {
fingerprint : String
event : AlertEvent
delivery_attempts : Int
delivered : Bool
deduplicated : Int
}fn ProductionAlertEnvelope::new(fingerprint : String, event : AlertEvent) -> ProductionAlertEnvelopepub(all) enum ProductionBackpressurePolicy {
DropNewestSample
DropOldestSample
RejectProducer
}pub(all) enum ProductionBaselineStrategy {
FixedBaseline
RollingMedian
RollingMean
ExponentiallyWeighted
SeasonalBaseline
}pub struct ProductionBatchResult {
batch_id : String
input_count : Int
accepted_count : Int
rejected_count : Int
event_count : Int
alert_count : Int
checksum : Double
duration_ticks : Int64
}pub struct ProductionBucket {
start_timestamp : Int64
end_timestamp : Int64
samples : Array[ProductionSample]
}pub struct ProductionBucketizer {
interval : Int64
origin : Int64
current : ProductionBucket?
flushed : Int
dropped : Int
}fn ProductionBucketizer::push(self : ProductionBucketizer, sample : ProductionSample) -> Array[ProductionBucket]pub struct ProductionCalibrationBin {
lower : Double
upper : Double
count : Int
positives : Int
mean_score : Double
observed_rate : Double
}pub(all) enum ProductionCalibrationMode {
IdentityCalibration
HistogramCalibration
PriorWeightedCalibration
}pub struct ProductionCanaryTracker {
plan : ProductionRolloutPlan
guardrail : ProductionGuardrailController
observations : Int
healthy_observations : Int
blocked_observations : Int
last_decision : ProductionGuardrailDecision?
}fn ProductionCanaryTracker::guardrail(self : ProductionCanaryTracker) -> ProductionGuardrailControllerfn ProductionCanaryTracker::last_decision(self : ProductionCanaryTracker) -> ProductionGuardrailDecision?fn ProductionCanaryTracker::new(plan : ProductionRolloutPlan, guardrail : ProductionGuardrailController) -> ProductionCanaryTrackerfn ProductionCanaryTracker::observe(self : ProductionCanaryTracker, observation : ProductionGuardrailObservation) -> ProductionGuardrailDecisionpub struct ProductionConfidenceInterval {
estimate : Double
lower : Double
upper : Double
confidence : Double
samples : Int
test_kind : ProductionStatTestKind
}fn ProductionConfidenceInterval::contains(self : ProductionConfidenceInterval, value : Double) -> Boolfn ProductionConfidenceInterval::test_kind(self : ProductionConfidenceInterval) -> ProductionStatTestKindpub struct ProductionConfigIssue {
field : String
message : String
fatal : Bool
}fn ProductionConfigIssue::new(field : String, message : String, fatal? : Bool) -> ProductionConfigIssuepub struct ProductionConfusionMatrix {
true_positive : Int
false_positive : Int
true_negative : Int
false_negative : Int
}fn ProductionConfusionMatrix::from_scores(scores : Array[Double], labels : Array[Bool], threshold : Double) -> ProductionConfusionMatrixpub(all) enum ProductionContractFieldKind {
Numeric
Timestamp
Sequence
Label
Boolean
}pub struct ProductionContractReport {
metric : String
checked : Int
accepted : Int
rejected : Int
missing : Int
warnings : Int
violations : Array[ProductionContractViolation]
distinct_labels : Array[String]
first_timestamp : Int64
last_timestamp : Int64
has_timestamp : Bool
monotonic : Bool
}fn ProductionContractReport::violations(self : ProductionContractReport) -> Array[ProductionContractViolation]pub struct ProductionContractRule {
name : String
field_kind : ProductionContractFieldKind
required : Bool
allow_missing : Bool
minimum : Double
maximum : Double
has_minimum : Bool
has_maximum : Bool
minimum_samples : Int
maximum_gap : Int64
monotonic_timestamps : Bool
maximum_label_length : Int
maximum_distinct_values : Int
severity : ProductionContractSeverity
}fn ProductionContractRule::new(name : String, field_kind? : ProductionContractFieldKind, required? : Bool, allow_missing? : Bool, minimum? : Double, maximum? : Double, has_minimum? : Bool, has_maximum? : Bool, minimum_samples? : Int, maximum_gap? : Int64, monotonic_timestamps? : Bool, maximum_label_length? : Int, maximum_distinct_values? : Int, severity? : ProductionContractSeverity) -> ProductionContractRulepub(all) enum ProductionContractSeverity {
ContractError
ContractWarning
}pub struct ProductionContractSummary {
contract_count : Int
report_count : Int
valid_count : Int
rejected_count : Int
warning_count : Int
total_samples : Int
total_violations : Int
}pub struct ProductionContractValidator {
rules : Array[ProductionContractRule]
reports : Array[ProductionContractReport]
total_batches : Int
total_samples : Int
total_violations : Int
}fn ProductionContractValidator::filter_numeric_batch(self : ProductionContractValidator, metric : String, timestamps : Array[Int64], values : Array[Double]) -> (Array[Int64], Array[Double], ProductionContractReport)fn ProductionContractValidator::latest_report(self : ProductionContractValidator) -> ProductionContractReport?fn ProductionContractValidator::register(self : ProductionContractValidator, rule : ProductionContractRule) -> Boolfn ProductionContractValidator::reports(self : ProductionContractValidator) -> Array[ProductionContractReport]fn ProductionContractValidator::rules(self : ProductionContractValidator) -> Array[ProductionContractRule]fn ProductionContractValidator::summary(self : ProductionContractValidator) -> ProductionContractSummaryfn ProductionContractValidator::validate_label_batch(self : ProductionContractValidator, metric : String, timestamps : Array[Int64], labels : Array[String]) -> ProductionContractReportfn ProductionContractValidator::validate_numeric_batch(self : ProductionContractValidator, metric : String, timestamps : Array[Int64], values : Array[Double]) -> ProductionContractReportpub struct ProductionContractViolation {
code : ProductionContractViolationCode
severity : ProductionContractSeverity
metric : String
rule : String
index : Int
value : Double
has_value : Bool
message : String
}fn ProductionContractViolation::code(self : ProductionContractViolation) -> ProductionContractViolationCodefn ProductionContractViolation::new(code : ProductionContractViolationCode, severity : ProductionContractSeverity, metric : String, rule : String, index? : Int, value? : Double, has_value? : Bool, message? : String) -> ProductionContractViolationfn ProductionContractViolation::severity(self : ProductionContractViolation) -> ProductionContractSeveritypub(all) enum ProductionContractViolationCode {
MissingMetric
MissingValue
NonFiniteValue
ValueBelowMinimum
ValueAboveMaximum
TimestampOutOfOrder
TimestampTooOld
DuplicateSequence
EmptyLabel
LabelTooLong
InvalidBoolean
InsufficientSamples
ExcessiveGap
CardinalityExceeded
SchemaMismatch
}pub struct ProductionCurvePoint {
threshold : Double
precision : Double
recall : Double
f1 : Double
false_positive_rate : Double
support : Int
}fn ProductionCurvePoint::from_matrix(threshold : Double, matrix : ProductionConfusionMatrix) -> ProductionCurvePointpub struct ProductionDashboardPoint {
timestamp : Int64
value : Double
baseline : Double
score : Double
changed : Bool
state : ProductionHealthState
}fn ProductionDashboardPoint::new(timestamp : Int64, value : Double, baseline : Double, result : DetectionResult, state : ProductionHealthState) -> ProductionDashboardPointpub struct ProductionDashboardSeries {
name : String
points : Array[ProductionDashboardPoint]
dropped : Int
}fn ProductionDashboardSeries::points(self : ProductionDashboardSeries) -> Array[ProductionDashboardPoint]fn ProductionDashboardSeries::push(self : ProductionDashboardSeries, point : ProductionDashboardPoint, capacity? : Int) -> Unitpub(all) enum ProductionDeliveryChannel {
ConsoleChannel
LogChannel
TicketChannel
PagerChannel
WebhookChannel
DashboardChannel
}pub struct ProductionDeliveryDecision {
rule : String
channel : ProductionDeliveryChannel
allowed : Bool
reason : String
fingerprint : String
}fn ProductionDeliveryDecision::channel(self : ProductionDeliveryDecision) -> ProductionDeliveryChannelpub struct ProductionDeliveryRule {
name : String
channel : ProductionDeliveryChannel
minimum_severity : AlertSeverity
include_suppressed : Bool
minimum_score : Double
cooldown : Int64
}fn ProductionDeliveryRule::new(name : String, channel : ProductionDeliveryChannel, minimum_severity? : AlertSeverity, include_suppressed? : Bool, minimum_score? : Double, cooldown? : Int64) -> ProductionDeliveryRulepub struct ProductionDetectionConfig {
detector_name : String
threshold : Double
confidence : Double
warmup_points : Int
minimum_segment : Int
maximum_score : Double
direction_filter : ChangeDirection?
}fn ProductionDetectionConfig::accepts(self : ProductionDetectionConfig, result : DetectionResult) -> Boolfn ProductionDetectionConfig::direction_filter(self : ProductionDetectionConfig) -> ChangeDirection?fn ProductionDetectionConfig::new(detector_name? : String, threshold? : Double, confidence? : Double, warmup_points? : Int, minimum_segment? : Int, maximum_score? : Double, direction_filter? : ChangeDirection?) -> ProductionDetectionConfigpub(all) enum ProductionDetectorKind {
CusumStackDetector
RobustZStackDetector
EwmaStackDetector
VarianceStackDetector
TrendStackDetector
SeasonalStackDetector
DistributionStackDetector
}pub struct ProductionDetectorStack {
kinds : Array[ProductionDetectorKind]
detectors : Array[PipelineDetector]
weights : Array[Double]
minimum_votes : Int
index : Int
}fn ProductionDetectorStack::new(kinds : Array[ProductionDetectorKind], detectors : Array[PipelineDetector], weights? : Array[Double], minimum_votes? : Int) -> ProductionDetectorStackfn ProductionDetectorStack::update(self : ProductionDetectorStack, value : Double) -> ProductionStackResultpub struct ProductionDetectorVote {
kind : ProductionDetectorKind
result : DetectionResult
weight : Double
accepted : Bool
}pub struct ProductionDriftReport {
baseline_count : Int
current_count : Int
mean_shift : Double
variance_ratio : Double
ks_distance : Double
energy_distance : Double
drift_score : Double
drifted : Bool
}fn ProductionDriftReport::from_values(baseline : Array[Double], current : Array[Double], threshold? : Double) -> ProductionDriftReportfn ProductionEscalationPolicy::add(self : ProductionEscalationPolicy, step : ProductionEscalationStep) -> Unitfn ProductionEscalationPolicy::due(self : ProductionEscalationPolicy, incident : ProductionIncident, now : Int64) -> Array[ProductionEscalationStep]fn ProductionEscalationPolicy::new(steps? : Array[ProductionEscalationStep]) -> ProductionEscalationPolicyfn ProductionEscalationPolicy::steps(self : ProductionEscalationPolicy) -> Array[ProductionEscalationStep]pub struct ProductionEscalationStep {
channel : String
delay : Int64
minimum_severity : AlertSeverity
}fn ProductionEscalationStep::eligible(self : ProductionEscalationStep, incident : ProductionIncident, now : Int64) -> Boolfn ProductionEscalationStep::new(channel : String, delay : Int64, minimum_severity? : AlertSeverity) -> ProductionEscalationSteppub struct ProductionEventBudget {
capacity : Int
interval : Int64
window_start : Int64?
used : Int
denied : Int
}pub struct ProductionExportBatch {
records : Array[ProductionExportRecord]
capacity : Int
accepted : Int
rejected : Int
duplicate : Int
}fn ProductionExportBatch::add(self : ProductionExportBatch, record : ProductionExportRecord) -> Boolfn ProductionExportBatch::add_many(self : ProductionExportBatch, records : Array[ProductionExportRecord]) -> Intpub(all) enum ProductionExportField {
ExportTimestamp
ExportMetric
ExportValue
ExportBaseline
ExportScore
ExportHealth
ExportState
ExportSource
}pub(all) enum ProductionExportFormat {
ExportJsonLines
ExportCsv
ExportPrometheus
ExportMarkdown
ExportSummaryJson
}pub struct ProductionExportOptions {
format : ProductionExportFormat
delimiter : String
include_header : Bool
include_metadata : Bool
pretty : Bool
max_records : Int
metric_prefix : String
metric_namespace : String
line_ending : String
}fn ProductionExportOptions::new(format? : ProductionExportFormat, delimiter? : String, include_header? : Bool, include_metadata? : Bool, pretty? : Bool, max_records? : Int, metric_prefix? : String, metric_namespace? : String, line_ending? : String) -> ProductionExportOptionsfn ProductionExportOptions::with_format(self : ProductionExportOptions, format : ProductionExportFormat) -> ProductionExportOptionspub struct ProductionExportRecord {
timestamp : Int64
metric : String
value : Double
baseline : Double
score : Double
health : Double
state : String
source : String
}fn ProductionExportRecord::field(self : ProductionExportRecord, field : ProductionExportField) -> Stringfn ProductionExportRecord::new(timestamp : Int64, metric : String, value : Double, baseline? : Double, score? : Double, health? : Double, state? : String, source? : String) -> ProductionExportRecordfn ProductionExportRecord::with_state(self : ProductionExportRecord, state : String) -> ProductionExportRecordpub struct ProductionExportStats {
batches : Int
records : Int
bytes : Int
failures : Int
truncated : Int
}pub struct ProductionFeature {
name : String
kind : ProductionFeatureKind
value : Double
valid : Bool
sample_count : Int
source_window : Int
}fn ProductionFeature::new(kind : ProductionFeatureKind, value : Double, sample_count : Int, source_window : Int) -> ProductionFeaturepub struct ProductionFeatureConfig {
window_size : Int
seasonal_period : Int
include_distribution : Bool
include_autocorrelation : Bool
outlier_threshold : Double
}fn ProductionFeatureConfig::new(window_size? : Int, seasonal_period? : Int, include_distribution? : Bool, include_autocorrelation? : Bool, outlier_threshold? : Double) -> ProductionFeatureConfigpub(all) enum ProductionFeatureKind {
LevelFeature
SpreadFeature
TrendFeature
VolatilityFeature
SkewFeature
KurtosisFeature
AutocorrelationFeature
DifferenceFeature
QuantileFeature
DistributionEntropyFeature
MissingRatioFeature
OutlierRatioFeature
SeasonalStrengthFeature
}pub struct ProductionFeaturePipeline {
config : ProductionFeatureConfig
windows : Array[ProductionTimeWindow]
extracted : Int
invalid : Int
}fn ProductionFeaturePipeline::extract(self : ProductionFeaturePipeline, values : Array[Double]) -> ProductionFeatureVectorfn ProductionFeaturePipeline::extract_batch(self : ProductionFeaturePipeline, batches : Array[Array[Double]]) -> Array[ProductionFeatureVector]fn ProductionFeaturePipeline::extract_from_window(self : ProductionFeaturePipeline, window : ProductionTimeWindow) -> ProductionFeatureVectorfn ProductionFeatureScaler::fit(self : ProductionFeatureScaler, vectors : Array[ProductionFeatureVector]) -> Boolfn ProductionFeatureScaler::inverse(self : ProductionFeatureScaler, values : Array[Double]) -> Array[Double]fn ProductionFeatureScaler::transform(self : ProductionFeatureScaler, vector : ProductionFeatureVector) -> ProductionFeatureVectorpub struct ProductionFeatureVector {
features : Array[ProductionFeature]
values : Array[Double]
valid_count : Int
missing_count : Int
}fn ProductionFeatureVector::distance(self : ProductionFeatureVector, other : ProductionFeatureVector) -> Doublefn ProductionFeatureVector::get(self : ProductionFeatureVector, name : String) -> ProductionFeature?pub(all) enum ProductionFillPolicy {
ForwardFill
ZeroFill
LinearInterpolate
SkipEmpty
}pub struct ProductionForecastInterval {
timestamp : Int64
prediction : Double
lower : Double
upper : Double
confidence : Double
horizon : Int
model : ProductionForecastKind
}fn ProductionForecastInterval::new(timestamp : Int64, prediction : Double, uncertainty : Double, confidence? : Double, horizon? : Int, model? : ProductionForecastKind) -> ProductionForecastIntervalpub(all) enum ProductionForecastKind {
LastValueForecast
MeanForecast
HoltForecast
SeasonalNaiveForecast
HoltWintersForecast
}pub struct ProductionForecastScore {
model : ProductionForecastKind
mae : Double
rmse : Double
bias : Double
coverage : Double
}pub struct ProductionForecaster {
kind : ProductionForecastKind
period : Int
horizon : Int
window : DoubleWindow
holt : HoltForecaster
seasonal : ProductionHoltWinters
residuals : ProductionQuantileState
count : Int
missing : Int
}fn ProductionForecaster::forecast(self : ProductionForecaster, start_timestamp : Int64, step : Int64, horizon? : Int, confidence? : Double) -> Array[ProductionForecastInterval]fn ProductionForecaster::new(kind? : ProductionForecastKind, window_size? : Int, period? : Int, horizon? : Int) -> ProductionForecasterfn ProductionForecaster::update(self : ProductionForecaster, value : Double) -> ProductionForecastIntervalpub(all) enum ProductionGuardrailAction {
GuardrailAllow
GuardrailObserve
GuardrailWarn
GuardrailBlock
GuardrailRollback
}pub struct ProductionGuardrailController {
rules : Array[ProductionGuardrailRule]
history : Array[ProductionGuardrailDecision]
failure_streak : Int
recovery_streak : Int
sequence : Int64
blocked : Bool
paused : Bool
last_timestamp : Int64
evaluated : Int
triggered : Int
}fn ProductionGuardrailController::evaluate(self : ProductionGuardrailController, observation : ProductionGuardrailObservation) -> ProductionGuardrailDecisionfn ProductionGuardrailController::evaluate_batch(self : ProductionGuardrailController, observations : Array[ProductionGuardrailObservation]) -> Array[ProductionGuardrailDecision]fn ProductionGuardrailController::history(self : ProductionGuardrailController) -> Array[ProductionGuardrailDecision]fn ProductionGuardrailController::latest(self : ProductionGuardrailController) -> ProductionGuardrailDecision?fn ProductionGuardrailController::register(self : ProductionGuardrailController, rule : ProductionGuardrailRule) -> Boolfn ProductionGuardrailController::remove(self : ProductionGuardrailController, name : String) -> Boolfn ProductionGuardrailController::rules(self : ProductionGuardrailController) -> Array[ProductionGuardrailRule]fn ProductionGuardrailController::summary(self : ProductionGuardrailController) -> ProductionGuardrailSummarypub struct ProductionGuardrailDecision {
action : ProductionGuardrailAction
rule_name : String
metric : ProductionGuardrailMetricKind
value : Double
threshold : Double
score : Double
triggered : Bool
failure_streak : Int
recovery_streak : Int
sequence : Int64
reason : String
}fn ProductionGuardrailDecision::action(self : ProductionGuardrailDecision) -> ProductionGuardrailActionfn ProductionGuardrailDecision::metric(self : ProductionGuardrailDecision) -> ProductionGuardrailMetricKindpub(all) enum ProductionGuardrailDirection {
GuardrailAbove
GuardrailBelow
GuardrailOutside
}pub(all) enum ProductionGuardrailMetricKind {
GuardrailErrorRate
GuardrailFalsePositiveRate
GuardrailDetectionDelay
GuardrailDataQuality
GuardrailThroughput
GuardrailLatency
GuardrailCoverage
GuardrailDriftScore
}pub struct ProductionGuardrailObservation {
timestamp : Int64
metric : ProductionGuardrailMetricKind
value : Double
baseline : Double
sample_count : Int
confidence : Double
source : String
}fn ProductionGuardrailObservation::metric(self : ProductionGuardrailObservation) -> ProductionGuardrailMetricKindfn ProductionGuardrailObservation::new(timestamp : Int64, metric : ProductionGuardrailMetricKind, value : Double, sample_count? : Int, baseline? : Double, confidence? : Double, source? : String) -> ProductionGuardrailObservationpub struct ProductionGuardrailRule {
name : String
metric : ProductionGuardrailMetricKind
direction : ProductionGuardrailDirection
warning_threshold : Double
blocking_threshold : Double
rollback_threshold : Double
minimum_samples : Int
window_size : Int
consecutive_failures : Int
recovery_samples : Int
weight : Double
enabled : Bool
}fn ProductionGuardrailRule::direction(self : ProductionGuardrailRule) -> ProductionGuardrailDirectionfn ProductionGuardrailRule::new(name : String, metric? : ProductionGuardrailMetricKind, direction? : ProductionGuardrailDirection, warning_threshold? : Double, blocking_threshold? : Double, rollback_threshold? : Double, minimum_samples? : Int, window_size? : Int, consecutive_failures? : Int, recovery_samples? : Int, weight? : Double, enabled? : Bool) -> ProductionGuardrailRulefn ProductionGuardrailRule::with_enabled(self : ProductionGuardrailRule, enabled : Bool) -> ProductionGuardrailRulepub struct ProductionGuardrailSummary {
evaluated : Int
triggered : Int
blocked : Bool
paused : Bool
failure_streak : Int
recovery_streak : Int
risk_score : Double
}pub(all) enum ProductionHealthState {
ColdStart
Healthy
DegradedQuality
AlertingState
RecoveringState
DisabledState
}pub struct ProductionHoltWinters {
period : Int
alpha : Double
beta : Double
gamma : Double
levels : Array[Double]
level : Double
trend : Double
count : Int
index : Int
initialized : Bool
residuals : ProductionResidualScale
}fn ProductionHoltWinters::new(period? : Int, alpha? : Double, beta? : Double, gamma? : Double) -> ProductionHoltWintersfn ProductionHoltWinters::predict_interval(self : ProductionHoltWinters, timestamp : Int64, horizon? : Int, confidence? : Double) -> ProductionForecastIntervalpub struct ProductionIncident {
id : Int
metric : String
first_timestamp : Int64
last_timestamp : Int64
alert_count : Int
max_score : Double
severity : AlertSeverity
state : ProductionIncidentState
acknowledged : Bool
snooze_until : Int64?
escalation_level : Int
recovery_observations : Int
}pub struct ProductionIncidentManager {
policy : ProductionIncidentPolicy
incidents : Array[ProductionIncident]
next_id : Int
ingested : Int
grouped : Int
resolved : Int
}fn ProductionIncidentManager::escalate_due(self : ProductionIncidentManager) -> Array[ProductionIncident]fn ProductionIncidentManager::incidents(self : ProductionIncidentManager) -> Array[ProductionIncident]fn ProductionIncidentManager::ingest(self : ProductionIncidentManager, event : ProductionMonitorEvent) -> ProductionIncidentfn ProductionIncidentManager::observe_healthy(self : ProductionIncidentManager, metric : String, timestamp : Int64) -> Array[ProductionIncident]fn ProductionIncidentManager::open_incidents(self : ProductionIncidentManager) -> Array[ProductionIncident]pub struct ProductionIncidentPolicy {
grouping_gap : Int64
recovery_points : Int
escalation_after : Int
retention : Int
}fn ProductionIncidentPolicy::new(grouping_gap? : Int64, recovery_points? : Int, escalation_after? : Int, retention? : Int) -> ProductionIncidentPolicypub(all) enum ProductionIncidentState {
OpenIncident
AcknowledgedIncident
SnoozedIncident
ResolvedIncident
ReopenedIncident
}pub struct ProductionMaintenanceWindow {
name : String
start : Int64
end : Int64
reason : String
}fn ProductionMaintenanceWindow::contains(self : ProductionMaintenanceWindow, timestamp : Int64) -> Boolfn ProductionMaintenanceWindow::new(name : String, start : Int64, end : Int64, reason? : String) -> ProductionMaintenanceWindowpub struct ProductionMetricCatalog {
series : Array[ProductionMetricSeries]
ingested : Int
rejected : Int
}fn ProductionMetricCatalog::find(self : ProductionMetricCatalog, name : String) -> ProductionMetricSeries?fn ProductionMetricCatalog::ingest(self : ProductionMetricCatalog, name : String, sample : ProductionSample) -> Boolfn ProductionMetricCatalog::ingest_point(self : ProductionMetricCatalog, name : String, point : SignalPoint) -> Boolfn ProductionMetricCatalog::register(self : ProductionMetricCatalog, metric : ProductionMetricSeries) -> Boolfn ProductionMetricCatalog::relations(self : ProductionMetricCatalog, correlation_threshold? : Double) -> Array[ProductionMetricRelation]fn ProductionMetricFrame::new(timestamp : Int64, names : Array[String], values : Array[Double]) -> ProductionMetricFramepub struct ProductionMetricRelation {
left : String
right : String
correlation : Double
distance : Double
related : Bool
}pub struct ProductionMetricSeries {
name : String
unit : String
window : ProductionTimeWindow
updates : Int
invalid : Int
}fn ProductionMetricSeries::correlation(self : ProductionMetricSeries, other : ProductionMetricSeries) -> Doublefn ProductionMetricSeries::new(name : String, unit? : String, capacity? : Int) -> ProductionMetricSeriespub struct ProductionMonitor {
config : ProductionMonitorConfig
detector : PipelineDetector
baseline_window : DoubleWindow
recent_window : ProductionTimeWindow
events : Array[ProductionMonitorEvent]
state : ProductionHealthState
processed : Int
valid : Int
invalid : Int
changes : Int
emitted : Int
suppressed : Int
recovery_count : Int
consecutive_healthy : Int
consecutive_alerts : Int
ordinal : Int
latest_score : Double
latest_baseline : Double
latest_value : Double
last_timestamp : Int64
last_value : Double?
}fn ProductionMonitor::new(config : ProductionMonitorConfig, detector : PipelineDetector) -> ProductionMonitorfn ProductionMonitor::update(self : ProductionMonitor, sample : ProductionSample) -> ProductionMonitorEvent?fn ProductionMonitor::update_batch(self : ProductionMonitor, samples : Array[ProductionSample]) -> Array[ProductionMonitorEvent]fn ProductionMonitor::update_point(self : ProductionMonitor, point : SignalPoint) -> ProductionMonitorEvent?pub struct ProductionMonitorCheckpoint {
config_fingerprint : String
processed : Int
valid : Int
invalid : Int
changes : Int
emitted : Int
suppressed : Int
recovery_count : Int
last_timestamp : Int64
baseline : Double
latest_value : Double
latest_score : Double
state : ProductionHealthState
baseline_values : Array[Double]
recent_values : Array[Double]
}pub struct ProductionMonitorConfig {
name : String
mode : ProductionMonitorMode
missing_values : MissingValueStrategy
baseline : ProductionBaselineStrategy
fixed_baseline : Double
detection : ProductionDetectionConfig
window : ProductionWindowConfig
alerts : ProductionAlertConfig
dimensions : Int
version : Int
}fn ProductionMonitorConfig::is_actionable(self : ProductionMonitorConfig, result : DetectionResult) -> Boolfn ProductionMonitorConfig::new(name? : String, mode? : ProductionMonitorMode, missing_values? : MissingValueStrategy, baseline? : ProductionBaselineStrategy, fixed_baseline? : Double, detection? : ProductionDetectionConfig, window? : ProductionWindowConfig, alerts? : ProductionAlertConfig, dimensions? : Int, version? : Int) -> ProductionMonitorConfigfn ProductionMonitorConfig::validate(self : ProductionMonitorConfig) -> Array[ProductionConfigIssue]pub struct ProductionMonitorEvent {
metric : String
timestamp : Int64
sequence : Int
kind : ProductionMonitorEventKind
state : ProductionHealthState
result : DetectionResult
baseline : Double
value : Double
message : String
ordinal : Int
}pub(all) enum ProductionMonitorEventKind {
Observation
InvalidInput
WarmupObservation
ChangeDetected
AlertEmitted
AlertSuppressed
RecoveryStarted
RecoveryCompleted
QualityDegraded
}pub(all) enum ProductionMonitorMode {
ObserveOnly
Alerting
Backfill
Replay
}pub struct ProductionMonitorSnapshot {
name : String
state : ProductionHealthState
processed : Int
valid : Int
invalid : Int
warmup_remaining : Int
changes : Int
emitted : Int
suppressed : Int
recovery_count : Int
latest_score : Double
baseline : Double
latest_value : Double
quality_ratio : Double
last_timestamp : Int64
}pub struct ProductionOnlineCalibrator {
bins : Array[ProductionScoreBin]
mode : ProductionCalibrationMode
observations : Int
positive : Int
negative : Int
}fn ProductionOnlineCalibrator::calibrate(self : ProductionOnlineCalibrator, score : Double) -> Doublefn ProductionOnlineCalibrator::new(bin_count? : Int, mode? : ProductionCalibrationMode) -> ProductionOnlineCalibratorfn ProductionOnlineCalibrator::update(self : ProductionOnlineCalibrator, score : Double, changed : Bool, weight? : Double) -> Unitpub struct ProductionPolicyEngine {
rules : Array[ProductionDeliveryRule]
schedule : ProductionSuppressionSchedule
budget : ProductionEventBudget
recent : Array[ProductionAlertEnvelope]
evaluated : Int
delivered : Int
suppressed : Int
duplicates : Int
}fn ProductionPolicyEngine::add_maintenance(self : ProductionPolicyEngine, window : ProductionMaintenanceWindow) -> Boolfn ProductionPolicyEngine::add_rule(self : ProductionPolicyEngine, rule : ProductionDeliveryRule) -> Unitfn ProductionPolicyEngine::evaluate(self : ProductionPolicyEngine, event : AlertEvent) -> Array[ProductionDeliveryDecision]pub struct ProductionPreprocessingReport {
input_count : Int
output_count : Int
invalid_input : Int
invalid_output : Int
clipped : Int
imputed : Int
transformed : Int
finite : Bool
}pub struct ProductionPreprocessor {
specs : Array[ProductionTransformSpec]
missing : MissingValueStrategy
batches : Int
values : Int
failed : Int
}fn ProductionPreprocessor::add(self : ProductionPreprocessor, spec : ProductionTransformSpec) -> Unitfn ProductionPreprocessor::transform(self : ProductionPreprocessor, values : Array[Double]) -> (Array[Double], ProductionPreprocessingReport)fn ProductionPreprocessor::transform_batches(self : ProductionPreprocessor, batches : Array[Array[Double]]) -> Array[Array[Double]]fn ProductionPreprocessor::transform_points(self : ProductionPreprocessor, points : Array[SignalPoint]) -> (Array[SignalPoint], ProductionPreprocessingReport)fn ProductionQuantileState::absolute_quantile(self : ProductionQuantileState, probability : Double) -> Doublefn ProductionQuantileState::quantile(self : ProductionQuantileState, probability : Double) -> Doublepub struct ProductionQueryResult {
metric : String
window : ProductionQueryWindow
function : ProductionWindowFunction
value : Double
count : Int
quality : Double
}pub struct ProductionQueryWindow {
start : Int64
end : Int64
}pub struct ProductionRateSummary {
samples : Int
resets : Int
invalid : Int
mean_rate : Double
maximum_rate : Double
latest_rate : Double
}pub struct ProductionRateTracker {
previous_timestamp : Int64?
previous_value : Double?
resets : Int
invalid : Int
}fn ProductionRateTracker::push(self : ProductionRateTracker, timestamp : Int64, value : Double) -> Double?pub struct ProductionReadinessCheck {
name : String
passed : Bool
critical : Bool
value : Double
expected : Double
message : String
}fn ProductionReadinessCheck::new(name : String, passed : Bool, expected : Double, value : Double, message? : String, critical? : Bool) -> ProductionReadinessCheckpub struct ProductionReadinessReport {
checks : Array[ProductionReadinessCheck]
passed : Bool
critical_failures : Int
warnings : Int
status : ProductionServiceStatus
}fn ProductionReadinessReport::checks(self : ProductionReadinessReport) -> Array[ProductionReadinessCheck]fn ProductionReadinessReport::from_checks(checks : Array[ProductionReadinessCheck]) -> ProductionReadinessReportpub struct ProductionReplayConfig {
mode : ProductionReplayMode
start_timestamp : Int64
step : Int64
maximum_points : Int
compare_tolerance : Double
include_quiet : Bool
}fn ProductionReplayConfig::new(mode? : ProductionReplayMode, start_timestamp? : Int64, step? : Int64, maximum_points? : Int, compare_tolerance? : Double, include_quiet? : Bool) -> ProductionReplayConfigpub struct ProductionReplayDifference {
points_delta : Int
changes_delta : Int
emitted_delta : Int
checksum_delta : Double
score_delta : Double
equivalent : Bool
}fn ProductionReplayDifference::from_summaries(left : ProductionReplaySummary, right : ProductionReplaySummary, tolerance? : Double) -> ProductionReplayDifferencepub(all) enum ProductionReplayMode {
StatefulReplay
ShadowReplay
CompareReplay
}pub struct ProductionReplayObservation {
index : Int
timestamp : Int64
value : Double
baseline : Double
result : DetectionResult
state : ProductionHealthState
emitted : Bool
}pub struct ProductionReplayRunner {
config : ProductionReplayConfig
observations : Array[ProductionReplayObservation]
skipped : Int
}fn ProductionReplayRunner::observations(self : ProductionReplayRunner) -> Array[ProductionReplayObservation]fn ProductionReplayRunner::run(self : ProductionReplayRunner, monitor : ProductionMonitor, points : Array[SignalPoint]) -> ProductionReplaySummarypub struct ProductionReplaySummary {
points : Int
valid : Int
invalid : Int
changes : Int
emitted : Int
suppressed : Int
checksum : Double
first_change : Int
mean_score : Double
maximum_score : Double
final_state : ProductionHealthState
}pub(all) enum ProductionReportFormat {
CsvReport
MarkdownReport
LineReport
}pub struct ProductionReportOptions {
format : ProductionReportFormat
include_events : Bool
include_features : Bool
maximum_rows : Int
decimals : Int
}fn ProductionReportOptions::new(format? : ProductionReportFormat, include_events? : Bool, include_features? : Bool, maximum_rows? : Int, decimals? : Int) -> ProductionReportOptionspub struct ProductionResampler {
step : Int64
policy : ProductionFillPolicy
origin : Int64?
last : ProductionSample?
pending_empty : Int
produced : Int
}fn ProductionResampler::push(self : ProductionResampler, sample : ProductionSample) -> Array[ProductionSample]pub struct ProductionResidualScale {
alpha : Double
center : Double
deviation : Double
count : Int
missing : Int
}fn ProductionResidualScale::uncertainty(self : ProductionResidualScale, confidence? : Double) -> Doublepub struct ProductionRolloutPlan {
name : String
stages : Array[ProductionRolloutStage]
active_stage : Int
started_at : Int64
completed : Bool
aborted : Bool
}fn ProductionRolloutPlan::add_stage(self : ProductionRolloutPlan, stage : ProductionRolloutStage) -> Unitfn ProductionRolloutPlan::promote(self : ProductionRolloutPlan, timestamp : Int64, health : Double) -> Boolpub struct ProductionRolloutStage {
name : String
exposure : Double
minimum_duration : Int64
maximum_duration : Int64
required_health : Double
automatic_promotion : Bool
}fn ProductionRolloutStage::new(name : String, exposure? : Double, minimum_duration? : Int64, maximum_duration? : Int64, required_health? : Double, automatic_promotion? : Bool) -> ProductionRolloutStagepub struct ProductionSample {
timestamp : Int64
value : Double
sequence : Int
imputed : Bool
late : Bool
}fn ProductionSample::new(timestamp : Int64, value : Double, sequence? : Int, imputed? : Bool, late? : Bool) -> ProductionSamplepub struct ProductionSampleQueue {
capacity : Int
policy : ProductionBackpressurePolicy
samples : Array[ProductionSample]
accepted : Int
dropped : Int
rejected : Int
}fn ProductionSampleQueue::new(capacity? : Int, policy? : ProductionBackpressurePolicy) -> ProductionSampleQueuepub struct ProductionScoreBin {
lower : Double
upper : Double
total : Double
positives : Double
prior_positive : Double
prior_negative : Double
}fn ProductionScoreBin::new(lower : Double, upper : Double, prior_positive? : Double, prior_negative? : Double) -> ProductionScoreBinpub struct ProductionSeriesQuery {
metric : String
window : ProductionQueryWindow
function : ProductionWindowFunction
minimum_quality : Double
}fn ProductionSeriesQuery::execute(self : ProductionSeriesQuery, series : ProductionMetricSeries) -> ProductionQueryResultfn ProductionSeriesQuery::new(metric : String, window : ProductionQueryWindow, function? : ProductionWindowFunction, minimum_quality? : Double) -> ProductionSeriesQuerypub struct ProductionServiceHeartbeat {
service : String
timestamp : Int64
status : ProductionServiceStatus
monitor_count : Int
fleet_score : Double
processed : Int
alerts : Int
incidents : Int
p95_latency : Double
}fn ProductionServiceHeartbeat::new(service : String, timestamp : Int64, snapshots : Array[ProductionMonitorSnapshot], incidents : Int, p95_latency? : Double) -> ProductionServiceHeartbeatpub struct ProductionServiceRegistry {
service : String
monitors : Array[ProductionMonitor]
heartbeats : Int
status : ProductionServiceStatus
}fn ProductionServiceRegistry::heartbeat(self : ProductionServiceRegistry, timestamp : Int64, incidents : Int, p95_latency? : Double) -> ProductionServiceHeartbeatfn ProductionServiceRegistry::process(self : ProductionServiceRegistry, metric_index : Int, sample : ProductionSample) -> ProductionMonitorEvent?fn ProductionServiceRegistry::process_all(self : ProductionServiceRegistry, samples : Array[ProductionSample]) -> Array[ProductionMonitorEvent]fn ProductionServiceRegistry::register(self : ProductionServiceRegistry, monitor : ProductionMonitor) -> Boolfn ProductionServiceRegistry::snapshots(self : ProductionServiceRegistry) -> Array[ProductionMonitorSnapshot]pub(all) enum ProductionServiceStatus {
StartingService
ReadyService
DegradedService
DrainingService
FailedService
}pub struct ProductionSloObjective {
name : String
target : Double
window : Int64
burn_limit : Double
kind : ProductionSloWindowKind
}fn ProductionSloObjective::new(name : String, target? : Double, window? : Int64, burn_limit? : Double, kind? : ProductionSloWindowKind) -> ProductionSloObjectivepub struct ProductionSloReport {
objective : ProductionSloObjective
total : Int
good : Int
bad : Int
compliance : Double
burn_rate : Double
remaining_budget : Double
breached : Bool
}pub struct ProductionSloTracker {
objective : ProductionSloObjective
total : Int
good : Int
bad : Int
window_start : Int64?
}fn ProductionSloTracker::observe(self : ProductionSloTracker, timestamp : Int64, good : Bool) -> Unitfn ProductionSloTracker::observe_event(self : ProductionSloTracker, timestamp : Int64, event : ProductionMonitorEvent) -> Unitpub(all) enum ProductionSloWindowKind {
ShortSloWindow
LongSloWindow
RollingSloWindow
}pub struct ProductionStackResult {
result : DetectionResult
votes : Array[ProductionDetectorVote]
agreement : Double
strongest : ProductionDetectorKind
}pub(all) enum ProductionStatTestKind {
MeanDifferenceTest
MedianDifferenceTest
PermutationShiftTest
BootstrapIntervalTest
CorrelationTest
VarianceRatioTest
}pub struct ProductionStatTestResult {
kind : ProductionStatTestKind
statistic : Double
p_value : Double
effect : Double
interval : ProductionConfidenceInterval
significant : Bool
}fn ProductionStatTestResult::interval(self : ProductionStatTestResult) -> ProductionConfidenceIntervalpub struct ProductionStreamMetrics {
enqueued : Int
processed : Int
emitted : Int
rejected : Int
aggregates : Int
flushes : Int
last_timestamp : Int64
}pub struct ProductionStreamProcessor {
queue : ProductionSampleQueue
bucketizer : ProductionBucketizer
monitor : ProductionMonitor
status : ProductionStreamStatus
metrics : ProductionStreamMetrics
started_at : Int64?
}fn ProductionStreamProcessor::drain(self : ProductionStreamProcessor) -> Array[ProductionMonitorEvent]fn ProductionStreamProcessor::enqueue(self : ProductionStreamProcessor, sample : ProductionSample) -> Boolfn ProductionStreamProcessor::flush(self : ProductionStreamProcessor) -> Array[ProductionMonitorEvent]fn ProductionStreamProcessor::new(monitor : ProductionMonitor, queue_capacity? : Int, queue_policy? : ProductionBackpressurePolicy, bucket_interval? : Int64) -> ProductionStreamProcessorpub(all) enum ProductionStreamStatus {
StartingStream
RunningStream
PausedStream
DrainingStream
StoppedStream
}pub struct ProductionSuppressionSchedule {
windows : Array[ProductionMaintenanceWindow]
suppressed : Int
}fn ProductionSuppressionSchedule::active(self : ProductionSuppressionSchedule, timestamp : Int64) -> ProductionMaintenanceWindow?fn ProductionSuppressionSchedule::add(self : ProductionSuppressionSchedule, window : ProductionMaintenanceWindow) -> Boolfn ProductionSuppressionSchedule::allow(self : ProductionSuppressionSchedule, timestamp : Int64) -> Boolfn ProductionSuppressionSchedule::windows(self : ProductionSuppressionSchedule) -> Array[ProductionMaintenanceWindow]pub struct ProductionTelemetryCounters {
samples_received : Int
samples_rejected : Int
samples_imputed : Int
late_samples : Int
detector_updates : Int
alerts_emitted : Int
alerts_suppressed : Int
incidents_opened : Int
incidents_resolved : Int
report_exports : Int
}fn ProductionTelemetryCounters::observe_incident(self : ProductionTelemetryCounters, opened : Bool, resolved : Bool) -> Unitfn ProductionTelemetryCounters::observe_result(self : ProductionTelemetryCounters, result : DetectionResult, emitted : Bool) -> Unitfn ProductionTelemetryCounters::observe_sample(self : ProductionTelemetryCounters, sample : ProductionSample, accepted : Bool) -> Unitpub struct ProductionTelemetryExporter {
options : ProductionExportOptions
stats : ProductionExportStats
}fn ProductionTelemetryExporter::export_batch(self : ProductionTelemetryExporter, batch : ProductionExportBatch) -> Stringfn ProductionTelemetryExporter::export_csv(self : ProductionTelemetryExporter, records : Array[ProductionExportRecord]) -> Stringfn ProductionTelemetryExporter::export_json_lines(self : ProductionTelemetryExporter, records : Array[ProductionExportRecord]) -> Stringfn ProductionTelemetryExporter::export_markdown(self : ProductionTelemetryExporter, records : Array[ProductionExportRecord]) -> Stringfn ProductionTelemetryExporter::export_prometheus(self : ProductionTelemetryExporter, records : Array[ProductionExportRecord]) -> Stringfn ProductionTelemetryExporter::export_summary(self : ProductionTelemetryExporter, records : Array[ProductionExportRecord]) -> Stringfn ProductionTelemetryExporter::new(options? : ProductionExportOptions) -> ProductionTelemetryExporterfn ProductionTelemetryExporter::options(self : ProductionTelemetryExporter) -> ProductionExportOptionspub struct ProductionThresholdController {
scores : DoubleWindow
target_alert_rate : Double
minimum_threshold : Double
maximum_threshold : Double
hysteresis : Double
threshold : Double
updates : Int
}fn ProductionThresholdController::new(window_size? : Int, target_alert_rate? : Double, minimum_threshold? : Double, maximum_threshold? : Double, hysteresis? : Double) -> ProductionThresholdControllerfn ProductionThresholdController::push(self : ProductionThresholdController, score : Double) -> Doublepub struct ProductionThresholdCost {
false_positive : Double
false_negative : Double
alert_volume : Double
}fn ProductionThresholdCost::new(false_positive? : Double, false_negative? : Double, alert_volume? : Double) -> ProductionThresholdCostfn ProductionThresholdCost::score(self : ProductionThresholdCost, matrix : ProductionConfusionMatrix) -> Doublepub struct ProductionThresholdSelection {
threshold : Double
matrix : ProductionConfusionMatrix
objective : Double
strategy : String
}fn ProductionThresholdSelection::matrix(self : ProductionThresholdSelection) -> ProductionConfusionMatrixpub struct ProductionTimeWindow {
capacity : Int
values : Array[ProductionSample]
start_index : Int
length : Int
dropped : Int
}fn ProductionTimeWindow::push(self : ProductionTimeWindow, sample : ProductionSample) -> ProductionSample?pub(all) enum ProductionTransformKind {
IdentityTransform
ClipTransform
DifferenceTransform
Log1pTransform
SqrtTransform
ZScoreTransform
RobustZTransform
DetrendTransform
SmoothTransform
WinsorizeTransform
SeasonalRemoveTransform
RateTransform
}pub struct ProductionTransformSpec {
kind : ProductionTransformKind
parameter_a : Double
parameter_b : Double
integer_parameter : Int
}fn ProductionTransformSpec::new(kind : ProductionTransformKind, parameter_a? : Double, parameter_b? : Double, integer_parameter? : Int) -> ProductionTransformSpecpub struct ProductionWindowConfig {
reorder_capacity : Int
allowed_lateness : Int64
aggregate_size : Int
retention_points : Int
maximum_gap : Int64?
deduplicate_timestamps : Bool
}fn ProductionWindowConfig::new(reorder_capacity? : Int, allowed_lateness? : Int64, aggregate_size? : Int, retention_points? : Int, maximum_gap? : Int64?, deduplicate_timestamps? : Bool) -> ProductionWindowConfigpub(all) enum ProductionWindowFunction {
QueryMean
QuerySum
QueryMinimum
QueryMaximum
QueryMedian
QueryP95
QueryCount
QueryRate
QueryChange
}pub struct ProductionWindowSummary {
start_timestamp : Int64
end_timestamp : Int64
count : Int
valid_count : Int
imputed_count : Int
late_count : Int
sum : Double
mean : Double
variance : Double
minimum : Double
maximum : Double
median : Double
first : Double
last : Double
}pub struct ProjectionDetector {
weights : Array[Double]
baseline : Double
variance : Double
alpha : Double
threshold : Double
count : Int
index : Int
}fn ProjectionDetector::new(weights : Array[Double], alpha? : Double, threshold? : Double) -> ProjectionDetectorpub(all) enum QualityIssue {
MissingValue
NonFiniteValue
OutOfRange
NonMonotonicTimestamp
ExcessiveGap
DimensionMismatch
}pub struct QualityReport {
count : Int
valid : Int
missing : Int
non_finite : Int
out_of_range : Int
non_monotonic : Int
excessive_gaps : Int
issues : Array[QualityIssue]
}pub struct RankShiftDetector {
left : DoubleWindow
right : DoubleWindow
threshold : Double
index : Int
}pub(all) enum RecoveryAction {
KeepOpen
AutoResolve
RequireAcknowledgement
Escalate
}pub struct RecoveryPlan {
severity : AlertSeverity
immediate_action : String
verification_window : Int
cooldown : Int
escalation_score : Double
}pub struct RecoveryTracker {
plan : RecoveryPlan
attempts : Int
acknowledged : Bool
recovered : Bool
}pub struct ReorderBuffer {
capacity : Int
policy : LateDataPolicy
pending : Array[OrderedPoint]
watermark : Int64
arrival_order : Int
dropped : Int
late_count : Int
}pub struct ReplayComparator {
score_tolerance : Double
confidence_tolerance : Double
compared : Int
mismatches : Int
}fn ReplayComparator::compare(self : ReplayComparator, expected : DetectionResult, actual : DetectionResult) -> Boolfn ReplayComparator::new(score_tolerance? : Double, confidence_tolerance? : Double) -> ReplayComparatorfn ReplayRecord::new(point : SignalPoint, result : DetectionResult, elapsed : Int64) -> ReplayRecordpub struct ReplaySummary {
total : Int
changed : Int
first_change : Int
last_change : Int
mean_score : Double
max_score : Double
elapsed : Int64
}pub struct ReservoirSample {
capacity : Int
values : Array[Double]
seen : Int
rng : DeterministicRng
}pub struct RoutingBudget {
capacity : Int
used : Int
}pub struct RoutingDecision {
metric : String
channel : String
priority : Int
acknowledged : Bool
reason : String
}fn RoutingDecision::new(metric : String, channel : String, priority : Int, reason : String) -> RoutingDecisionpub struct ScaleEvidence {
short_score : Double
medium_score : Double
long_score : Double
consensus : Double
changed : Bool
}pub struct ScoreCalibrator {
observations : Array[ScoreObservation]
max_observations : Int
positive_weight : Double
negative_weight : Double
}fn ScoreCalibrator::push(self : ScoreCalibrator, score : Double, changed : Bool, weight? : Double) -> Unitpub struct ScoreObservation {
score : Double
changed : Bool
weight : Double
}fn SeasonalAnomalyDetector::new(period : Int, threshold? : Double, alpha? : Double) -> SeasonalAnomalyDetectorfn SeasonalAnomalyDetector::update(self : SeasonalAnomalyDetector, value : Double) -> DetectionResultpub struct SegmentQuality {
count : Int
mean : Double
deviation : Double
stability : Double
completeness : Double
score : Double
}pub struct SegmentRange {
start : Int
end : Int
}pub(all) enum SignalPattern {
Stable
MeanShift
VarianceShift
Trend
Spike
MeanAndVarianceShift
}pub struct SignalPoint {
timestamp : Int64
value : Double
sequence : Int
}pub struct SignalScenario {
name : String
length : Int
change_at : Int
baseline : Double
shift : Double
noise : Double
post_noise : Double
trend : Double
pattern : SignalPattern
seed : Int64
}fn SignalScenario::mean_and_variance(length? : Int, change_at? : Int, baseline? : Double, shift? : Double, noise? : Double, post_noise? : Double, seed? : Int64) -> SignalScenariofn SignalScenario::mean_shift(length? : Int, change_at? : Int, baseline? : Double, shift? : Double, noise? : Double, seed? : Int64) -> SignalScenariofn SignalScenario::spike(length? : Int, spike_at? : Int, baseline? : Double, spike? : Double, noise? : Double, seed? : Int64) -> SignalScenariofn SignalScenario::stable(length? : Int, baseline? : Double, noise? : Double, seed? : Int64) -> SignalScenariofn SignalScenario::trend(length? : Int, change_at? : Int, baseline? : Double, trend? : Double, noise? : Double, seed? : Int64) -> SignalScenariofn SignalScenario::variance_shift(length? : Int, change_at? : Int, baseline? : Double, noise? : Double, post_noise? : Double, seed? : Int64) -> SignalScenariopub struct SloReport {
window : SloWindow
target : Double
budget : Double
burn : Double
breached : Bool
recommendation : String
}pub struct SloWindow {
total : Int
bad : Int
changed : Int
severe : Int
}pub struct StatsSummary {
count : Int
mean : Double
variance : Double
standard_deviation : Double
minimum : Double
maximum : Double
median : Double
first : Double
last : Double
}pub struct StepChangeDetector {
reference : DoubleWindow
current : DoubleWindow
threshold : Double
index : Int
}pub struct StreamEngine {
reorder : ReorderBuffer
tracker : WatermarkTracker
aggregator : WindowAggregator
pipeline : MetricPipeline
processed : Int
aggregates : Int
alerts : Int
}fn StreamEngine::new(metric : String, detector : PipelineDetector, window_size? : Int, lateness? : Int) -> StreamEnginepub struct ThresholdPoint {
index : Int
threshold : Double
score : Double
accepted : Bool
}pub struct ThresholdReport {
threshold : Double
true_positives : Int
false_positives : Int
true_negatives : Int
false_negatives : Int
precision : Double
recall : Double
f1 : Double
expected_cost : Double
}pub struct TimeWindow {
start : Int64
end : Int64
ordinal : Int
}pub struct TrendShiftDetector {
window : DoubleWindow
slope_threshold : Double
persistence : Int
consecutive : Int
index : Int
}fn TrendShiftDetector::new(window_size? : Int, slope_threshold? : Double, persistence? : Int) -> TrendShiftDetectorpub struct VarianceShiftDetector {
short_window : DoubleWindow
long_window : DoubleWindow
threshold : Double
warmup : Int
index : Int
}fn VarianceShiftDetector::new(short_window? : Int, long_window? : Int, threshold? : Double) -> VarianceShiftDetectorpub struct WatermarkTracker {
allowed_lateness : Int64
maximum_seen : Int64
accepted : Int
dropped : Int
}pub struct WindowAggregate {
start_timestamp : Int64
end_timestamp : Int64
count : Int
value : Double
summary : StatsSummary
}pub struct WindowAggregator {
size : Int
kind : AggregationKind
window : DoubleWindow
start_timestamp : Int64
end_timestamp : Int64
count : Int
}pub struct WindowDiagnostic {
before : StatsSummary
after : StatsSummary
mean_shift : Double
variance_ratio : Double
distribution_shift : Double
severity : AlertSeverity
actionable : Bool
}pub struct WindowFeatures {
count : Int
mean : Double
standard_deviation : Double
median : Double
mad : Double
minimum : Double
maximum : Double
range : Double
slope : Double
autocorrelation : Double
change_rate : Double
}fn absolute(value : Double) -> Doublefn align_by_timestamp(left : Array[SignalPoint], right : Array[SignalPoint]) -> (Array[Double], Array[Double])fn best_f1_threshold(scores : Array[Double], labels : Array[Bool], candidates : Array[Double]) -> ThresholdPointfn best_threshold(observations : Array[ScoreObservation], candidates : Array[Double], false_positive_cost? : Double, false_negative_cost? : Double) -> ThresholdReportfn binary_segmentation(values : Array[Double], threshold? : Double, min_segment? : Int, max_changes? : Int) -> Array[OfflineChange]fn bootstrap_change_score(left : Array[Double], right : Array[Double], replicates? : Int, seed? : Int64) -> BootstrapEstimatefn bucket_timestamp(timestamp : Int64, origin : Int64, width : Int64) -> Int64fn clamp_probability(value : Double) -> Doublefn correlation_alert(before : Array[Array[Double]], after : Array[Array[Double]], threshold? : Double) -> DetectionResultfn diagnose_windows(before_values : Array[Double], after_values : Array[Double], shift_threshold? : Double, distribution_threshold? : Double) -> WindowDiagnosticfn evaluate_change_points(predicted : Array[Int], truth : Array[Int], tolerance? : Int) -> ChangePointMetricsfn evaluate_threshold(observations : Array[ScoreObservation], threshold : Double, false_positive_cost? : Double, false_negative_cost? : Double) -> ThresholdReportfn evidence_strength(score : Double, confidence : Double, deviation : Double) -> Doublefn expected_alert_cost(false_positive_rate : Double, false_negative_rate : Double, false_positive_cost? : Double, false_negative_cost? : Double) -> Doublefn explain_batch(results : Array[DetectionResult], baseline : Double, values : Array[Double], detector : String) -> Array[DetectionExplanation]fn is_finite(value : Double) -> Boolfn make_explanation(result : DetectionResult, baseline : Double, observed : Double, detector : String) -> DetectionExplanationfn merge_nearby_changes(changes : Array[OfflineChange], minimum_distance : Int) -> Array[OfflineChange]fn production_bootstrap_difference(left : Array[Double], right : Array[Double], replicates? : Int, confidence? : Double, seed? : Int64) -> ProductionConfidenceIntervalfn production_bootstrap_interval(values : Array[Double], replicates? : Int, confidence? : Double, seed? : Int64) -> ProductionConfidenceIntervalfn production_calibrate_result(calibrator : ProductionOnlineCalibrator, result : DetectionResult) -> DetectionResultfn production_calibration_bins(probabilities : Array[Double], labels : Array[Bool], bins? : Int) -> Array[ProductionCalibrationBin]fn production_control_limits(baseline : Array[Double], sigma_multiplier? : Double) -> (Double, Double)fn production_dashboard_series(name : String, events : Array[ProductionMonitorEvent], maximum_rows? : Int) -> ProductionDashboardSeriesfn production_export_merge_batches(left : ProductionExportBatch, right : ProductionExportBatch) -> ProductionExportBatchfn production_export_metric_mean(records : Array[ProductionExportRecord], metric : String) -> Doublefn production_export_normalize_metric_name(metric : String) -> Stringfn production_export_record_prometheus(record : ProductionExportRecord, options : ProductionExportOptions) -> Stringfn production_export_validate_metric_name(metric : String) -> Boolfn production_feature_contributions(vector : ProductionFeatureVector, weights : Array[Double]) -> Array[EvidenceContribution]fn production_forecast_score(actual : Array[Double], predictions : Array[ProductionForecastInterval]) -> ProductionForecastScorefn production_frame_change_score(before : ProductionMetricFrame, after : ProductionMetricFrame) -> Doublefn production_impute_values(values : Array[Double], strategy : MissingValueStrategy) -> Array[Double]fn production_incident_rate_markdown(incidents : Array[ProductionIncident], start : Int64, end : Int64) -> Stringfn production_join_series(series : Array[ProductionMetricSeries], tolerance : Int64) -> Array[ProductionMetricFrame]fn production_mean_shift_test(left : Array[Double], right : Array[Double], alpha? : Double, replicates? : Int) -> ProductionStatTestResultfn production_median_shift_test(left : Array[Double], right : Array[Double], alpha? : Double, replicates? : Int) -> ProductionStatTestResultfn production_monitor_signal(monitor : ProductionMonitor, points : Array[SignalPoint]) -> ProductionMonitorSnapshotfn production_precision_recall_curve(scores : Array[Double], labels : Array[Bool], steps? : Int) -> Array[ProductionCurvePoint]fn production_query_rollup(series : ProductionMetricSeries, start : Int64, end : Int64, step : Int64, function? : ProductionWindowFunction) -> Array[ProductionQueryResult]fn production_roc_curve(scores : Array[Double], labels : Array[Bool], steps? : Int) -> Array[ProductionCurvePoint]fn production_run_batch(batch_id : String, monitor : ProductionMonitor, samples : Array[ProductionSample]) -> ProductionBatchResultfn production_scenario_points(scenario : SignalScenario, start_timestamp? : Int64, step? : Int64) -> Array[SignalPoint]fn production_select_cost_threshold(scores : Array[Double], labels : Array[Bool], cost? : ProductionThresholdCost, steps? : Int) -> ProductionThresholdSelectionfn production_select_f1_threshold(scores : Array[Double], labels : Array[Bool], steps? : Int) -> ProductionThresholdSelectionfn production_snapshots_csv_header() -> Stringfn production_startup_report(config : ProductionMonitorConfig, initial_values : Array[Double]) -> ProductionReadinessReportfn production_stream_process_points(processor : ProductionStreamProcessor, points : Array[SignalPoint]) -> Array[ProductionMonitorEvent]fn production_transform_values(values : Array[Double], specs : Array[ProductionTransformSpec], missing? : MissingValueStrategy) -> Array[Double]fn production_window_feature_distance(left : Array[Double], right : Array[Double], config? : ProductionFeatureConfig) -> Doublefn recommended_detector(multivariate : Bool, offline : Bool, robust : Bool) -> Stringfn rolling_origins(length : Int, train_size : Int, horizon : Int, step? : Int) -> Array[SegmentRange]fn weighted_consensus(results : Array[DetectionResult], weights : Array[Double], quorum : Double) -> DetectionResultfn window_summaries(points : Array[SignalPoint], windows : Array[TimeWindow]) -> Array[StatsSummary]Production-oriented MoonBit change-point detection, streaming windows, multivariate monitoring, replay, SLO and alert routing