Sprints 46-58 implement the cross-language porting foundation: language-to-IR adapters, equivalence checking, gate validation, legacy ingestion, managed/dynamic families, low-level/logic-actor semantics, debug workflow tooling, AST-native family tools, Rust/CPP raising tools, system-level orchestration, query family, and porting gates. Sprint 59 adds the governance layer (policy packs, review boards, waiver packets, ambiguity triage, decision ledger) with the whetstone_review_porting_decision MCP tool. Also includes: sprint plans 46-130, MCP taskitem pipeline scripts, CLAUDE.md, docs, and full test matrix (steps 689-828). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
#pragma once
|
|
// Step 1532: debug stop-reason classifier model.
|
|
|
|
#include <string>
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
struct DebugStopReason {
|
|
std::string code = "unknown";
|
|
std::string summary = "Unknown stop reason";
|
|
};
|
|
|
|
class DebugStopReasonClassifier {
|
|
public:
|
|
static DebugStopReason classify(bool budgetExceeded,
|
|
bool policyViolation,
|
|
bool testsFailing,
|
|
bool patchRejected) {
|
|
DebugStopReason r;
|
|
if (policyViolation) {
|
|
r.code = "policy_violation";
|
|
r.summary = "Policy constraint violated";
|
|
} else if (budgetExceeded) {
|
|
r.code = "budget_exhausted";
|
|
r.summary = "Budget exhausted before green";
|
|
} else if (patchRejected) {
|
|
r.code = "patch_rejected";
|
|
r.summary = "Patch proposal rejected by checks";
|
|
} else if (testsFailing) {
|
|
r.code = "tests_still_failing";
|
|
r.summary = "Tests still failing after attempts";
|
|
}
|
|
return r;
|
|
}
|
|
|
|
static nlohmann::json toJson(const DebugStopReason& r) {
|
|
return {{"code", r.code}, {"summary", r.summary}};
|
|
}
|
|
};
|