Implement sprints 118-119 distributed failure evidence and triage

This commit is contained in:
Bill
2026-02-24 12:31:17 -07:00
parent b9e666dc9c
commit 1c0645b2f9
40 changed files with 1021 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1431: Blast-radius estimator for distributed failures.
#include <string>
#include <nlohmann/json.hpp>
struct BlastRadiusEstimatorForDistributedFailures {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class BlastRadiusEstimatorForDistributedFailuresFactory {
public:
static BlastRadiusEstimatorForDistributedFailures make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const BlastRadiusEstimatorForDistributedFailures& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1429: Cross-node failure cluster model.
#include <string>
#include <nlohmann/json.hpp>
struct CrossNodeFailureClusterModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class CrossNodeFailureClusterModelFactory {
public:
static CrossNodeFailureClusterModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const CrossNodeFailureClusterModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1432: Deterministic triage queue planner model.
#include <string>
#include <nlohmann/json.hpp>
struct DeterministicTriageQueuePlannerModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class DeterministicTriageQueuePlannerModelFactory {
public:
static DeterministicTriageQueuePlannerModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const DeterministicTriageQueuePlannerModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1427: Distributed evidence packet export model.
#include <string>
#include <nlohmann/json.hpp>
struct DistributedEvidencePacketExportModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class DistributedEvidencePacketExportModelFactory {
public:
static DistributedEvidencePacketExportModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const DistributedEvidencePacketExportModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1426: Distributed evidence quality scorer model.
#include <string>
#include <nlohmann/json.hpp>
struct DistributedEvidenceQualityScorerModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class DistributedEvidenceQualityScorerModelFactory {
public:
static DistributedEvidenceQualityScorerModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const DistributedEvidenceQualityScorerModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1419: `DistributedFailureEvidence` schema + normalizer.
#include <string>
#include <nlohmann/json.hpp>
struct DistributedFailureEvidenceSchemaNormalizer {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class DistributedFailureEvidenceSchemaNormalizerFactory {
public:
static DistributedFailureEvidenceSchemaNormalizer make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const DistributedFailureEvidenceSchemaNormalizer& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1421: Distributed repro command resolver model.
#include <string>
#include <nlohmann/json.hpp>
struct DistributedReproCommandResolverModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class DistributedReproCommandResolverModelFactory {
public:
static DistributedReproCommandResolverModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const DistributedReproCommandResolverModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1436: Escalation reason classifier model.
#include <string>
#include <nlohmann/json.hpp>
struct EscalationReasonClassifierModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class EscalationReasonClassifierModelFactory {
public:
static EscalationReasonClassifierModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const EscalationReasonClassifierModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1422: Evidence bundle store + deterministic ordering.
#include <string>
#include <nlohmann/json.hpp>
struct EvidenceBundleStoreDeterministicOrdering {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class EvidenceBundleStoreDeterministicOrderingFactory {
public:
static EvidenceBundleStoreDeterministicOrdering make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const EvidenceBundleStoreDeterministicOrdering& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1420: Job-output canonicalization and truncation utilities.
#include <string>
#include <nlohmann/json.hpp>
struct JobOutputCanonicalizationAndTruncationUtilities {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class JobOutputCanonicalizationAndTruncationUtilitiesFactory {
public:
static JobOutputCanonicalizationAndTruncationUtilities make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const JobOutputCanonicalizationAndTruncationUtilities& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1430: Root-cause ranking policy model.
#include <string>
#include <nlohmann/json.hpp>
struct RootCauseRankingPolicyModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class RootCauseRankingPolicyModelFactory {
public:
static RootCauseRankingPolicyModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const RootCauseRankingPolicyModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};

View File

@@ -0,0 +1,33 @@
#pragma once
// Step 1437: Triage packet bundle model.
#include <string>
#include <nlohmann/json.hpp>
struct TriagePacketBundleModel {
std::string id;
std::string detail;
int score = 0;
bool enabled = false;
bool valid = false;
};
class TriagePacketBundleModelFactory {
public:
static TriagePacketBundleModel make(const std::string& id,
const std::string& detail,
int score,
bool enabled) {
bool valid = !id.empty() && !detail.empty() && score >= 0;
return {id, detail, score, enabled, valid};
}
static nlohmann::json toJson(const TriagePacketBundleModel& v) {
nlohmann::json j = nlohmann::json::object();
j["id"] = v.id;
j["detail"] = v.detail;
j["score"] = v.score;
j["enabled"] = v.enabled;
j["valid"] = v.valid;
return j;
}
};