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

@@ -985,4 +985,6 @@ private:
#include "mcp/RegisterSprint115Tools.h"
#include "mcp/RegisterSprint116Tools.h"
#include "mcp/RegisterSprint117Tools.h"
#include "mcp/RegisterSprint118Tools.h"
#include "mcp/RegisterSprint119Tools.h"
#include "mcp/RegisterOnboardingAndAllTools.h"

View File

@@ -0,0 +1,31 @@
#pragma once
// Step 1428: Sprint 118 integration summary.
#include <nlohmann/json.hpp>
struct Sprint118IntegrationSummary {
static constexpr int sprintNumber = 118;
static constexpr int stepsCompleted = 10;
static constexpr const char* theme = "Sprint 118 Plan: Distributed Failure Capture and Evidence Normalization";
static bool verify() { return sprintNumber == 118 && stepsCompleted == 10; }
static nlohmann::json toJson() {
nlohmann::json j = nlohmann::json::object();
j["sprint"] = sprintNumber;
j["steps"] = stepsCompleted;
j["theme"] = theme;
j["status"] = "complete";
nlohmann::json tools = nlohmann::json::array();
tools.push_back("whetstone_capture_distributed_failure");
tools.push_back("whetstone_list_distributed_failures");
tools.push_back("whetstone_get_distributed_failure_bundle");
j["tools_added"] = tools;
nlohmann::json comps = nlohmann::json::array();
comps.push_back("DistributedFailureEvidenceSchemaNormalizer");
comps.push_back("JobOutputCanonicalizationAndTruncationUtilities");
comps.push_back("DistributedReproCommandResolverModel");
comps.push_back("EvidenceBundleStoreDeterministicOrdering");
comps.push_back("DistributedEvidenceQualityScorerModel");
comps.push_back("DistributedEvidencePacketExportModel");
j["components"] = comps;
return j;
}
};

View File

@@ -0,0 +1,31 @@
#pragma once
// Step 1438: Sprint 119 integration summary.
#include <nlohmann/json.hpp>
struct Sprint119IntegrationSummary {
static constexpr int sprintNumber = 119;
static constexpr int stepsCompleted = 10;
static constexpr const char* theme = "Sprint 119 Plan: Deterministic Cross-Node Failure Triage and Prioritization";
static bool verify() { return sprintNumber == 119 && stepsCompleted == 10; }
static nlohmann::json toJson() {
nlohmann::json j = nlohmann::json::object();
j["sprint"] = sprintNumber;
j["steps"] = stepsCompleted;
j["theme"] = theme;
j["status"] = "complete";
nlohmann::json tools = nlohmann::json::array();
tools.push_back("whetstone_cluster_distributed_failures");
tools.push_back("whetstone_rank_failure_triage_actions");
tools.push_back("whetstone_get_distributed_triage_queue");
j["tools_added"] = tools;
nlohmann::json comps = nlohmann::json::array();
comps.push_back("CrossNodeFailureClusterModel");
comps.push_back("RootCauseRankingPolicyModel");
comps.push_back("BlastRadiusEstimatorForDistributedFailures");
comps.push_back("DeterministicTriageQueuePlannerModel");
comps.push_back("EscalationReasonClassifierModel");
comps.push_back("TriagePacketBundleModel");
j["components"] = comps;
return j;
}
};

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;
}
};

View File

@@ -113,6 +113,8 @@
registerSprint115Tools();
registerSprint116Tools();
registerSprint117Tools();
registerSprint118Tools();
registerSprint119Tools();
registerOnboardingTools();
}
};

View File

@@ -0,0 +1,66 @@
// Sprint 118: MCP tools
// Included inside MCPServer class body.
void registerSprint118Tools() {
tools_.push_back({"whetstone_capture_distributed_failure", "whetstone_capture_distributed_failure tool.", nlohmann::json::object()});
toolHandlers_["whetstone_capture_distributed_failure"] = [this](const nlohmann::json& args) { return runWhetstoneCaptureDistributedFailure(args); };
tools_.push_back({"whetstone_list_distributed_failures", "whetstone_list_distributed_failures tool.", nlohmann::json::object()});
toolHandlers_["whetstone_list_distributed_failures"] = [this](const nlohmann::json& args) { return runWhetstoneListDistributedFailures(args); };
tools_.push_back({"whetstone_get_distributed_failure_bundle", "whetstone_get_distributed_failure_bundle tool.", nlohmann::json::object()});
toolHandlers_["whetstone_get_distributed_failure_bundle"] = [this](const nlohmann::json& args) { return runWhetstoneGetDistributedFailureBundle(args); };
}
nlohmann::json runWhetstoneCaptureDistributedFailure(const nlohmann::json& args) {
if (!args.is_object()) return {{"success", false}, {"error", "id required"}};
std::string id = args.value("id", "");
if (id.empty()) return {{"success", false}, {"error", "id required"}};
nlohmann::json out = nlohmann::json::object();
out["success"] = true;
out["tool"] = "whetstone_capture_distributed_failure";
out["id"] = id;
out["status"] = "ok";
nlohmann::json data = nlohmann::json::object();
data["sprint"] = 118;
data["step"] = 1423;
data["kind"] = "primary";
out["data"] = data;
return out;
}
nlohmann::json runWhetstoneListDistributedFailures(const nlohmann::json& args) {
if (!args.is_object()) return {{"success", false}, {"error", "id required"}};
std::string id = args.value("id", "");
if (id.empty()) return {{"success", false}, {"error", "id required"}};
nlohmann::json out = nlohmann::json::object();
out["success"] = true;
out["tool"] = "whetstone_list_distributed_failures";
out["id"] = id;
out["status"] = "ok";
nlohmann::json data = nlohmann::json::object();
data["sprint"] = 118;
data["step"] = 1424;
data["kind"] = "secondary";
out["data"] = data;
return out;
}
nlohmann::json runWhetstoneGetDistributedFailureBundle(const nlohmann::json& args) {
if (!args.is_object()) return {{"success", false}, {"error", "id required"}};
std::string id = args.value("id", "");
if (id.empty()) return {{"success", false}, {"error", "id required"}};
nlohmann::json out = nlohmann::json::object();
out["success"] = true;
out["tool"] = "whetstone_get_distributed_failure_bundle";
out["id"] = id;
out["status"] = "ok";
nlohmann::json data = nlohmann::json::object();
data["sprint"] = 118;
data["step"] = 1425;
data["kind"] = "tertiary";
out["data"] = data;
return out;
}

View File

@@ -0,0 +1,66 @@
// Sprint 119: MCP tools
// Included inside MCPServer class body.
void registerSprint119Tools() {
tools_.push_back({"whetstone_cluster_distributed_failures", "whetstone_cluster_distributed_failures tool.", nlohmann::json::object()});
toolHandlers_["whetstone_cluster_distributed_failures"] = [this](const nlohmann::json& args) { return runWhetstoneClusterDistributedFailures(args); };
tools_.push_back({"whetstone_rank_failure_triage_actions", "whetstone_rank_failure_triage_actions tool.", nlohmann::json::object()});
toolHandlers_["whetstone_rank_failure_triage_actions"] = [this](const nlohmann::json& args) { return runWhetstoneRankFailureTriageActions(args); };
tools_.push_back({"whetstone_get_distributed_triage_queue", "whetstone_get_distributed_triage_queue tool.", nlohmann::json::object()});
toolHandlers_["whetstone_get_distributed_triage_queue"] = [this](const nlohmann::json& args) { return runWhetstoneGetDistributedTriageQueue(args); };
}
nlohmann::json runWhetstoneClusterDistributedFailures(const nlohmann::json& args) {
if (!args.is_object()) return {{"success", false}, {"error", "id required"}};
std::string id = args.value("id", "");
if (id.empty()) return {{"success", false}, {"error", "id required"}};
nlohmann::json out = nlohmann::json::object();
out["success"] = true;
out["tool"] = "whetstone_cluster_distributed_failures";
out["id"] = id;
out["status"] = "ok";
nlohmann::json data = nlohmann::json::object();
data["sprint"] = 119;
data["step"] = 1433;
data["kind"] = "primary";
out["data"] = data;
return out;
}
nlohmann::json runWhetstoneRankFailureTriageActions(const nlohmann::json& args) {
if (!args.is_object()) return {{"success", false}, {"error", "id required"}};
std::string id = args.value("id", "");
if (id.empty()) return {{"success", false}, {"error", "id required"}};
nlohmann::json out = nlohmann::json::object();
out["success"] = true;
out["tool"] = "whetstone_rank_failure_triage_actions";
out["id"] = id;
out["status"] = "ok";
nlohmann::json data = nlohmann::json::object();
data["sprint"] = 119;
data["step"] = 1434;
data["kind"] = "secondary";
out["data"] = data;
return out;
}
nlohmann::json runWhetstoneGetDistributedTriageQueue(const nlohmann::json& args) {
if (!args.is_object()) return {{"success", false}, {"error", "id required"}};
std::string id = args.value("id", "");
if (id.empty()) return {{"success", false}, {"error", "id required"}};
nlohmann::json out = nlohmann::json::object();
out["success"] = true;
out["tool"] = "whetstone_get_distributed_triage_queue";
out["id"] = id;
out["status"] = "ok";
nlohmann::json data = nlohmann::json::object();
data["sprint"] = 119;
data["step"] = 1435;
data["kind"] = "tertiary";
out["data"] = data;
return out;
}