Files
whetstone_DSL/editor/src/graduation/HintRollbackControl.h
Bill 1696b92bb8 Add Sprints 46-59: governance, porting foundation, and language graduation prep (Steps 689-828)
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>
2026-02-22 13:18:10 -07:00

50 lines
1.5 KiB
C++

#pragma once
// Step 864: Hint rollback and suppression controls.
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
struct HintSuppression {
std::string suppressionId;
std::string pairId;
std::string reason;
bool active = true;
};
class HintRollbackControl {
public:
bool suppress(const HintSuppression& s, std::string* error = nullptr) {
if (s.pairId.empty()) { if (error) *error = "pair_id_missing"; return false; }
if (s.reason.empty()) { if (error) *error = "reason_missing"; return false; }
suppressions_.push_back(s);
return true;
}
bool isSuppressed(const std::string& pairId) const {
for (const auto& s : suppressions_)
if (s.pairId == pairId && s.active) return true;
return false;
}
bool lift(const std::string& pairId, std::string* error = nullptr) {
for (auto& s : suppressions_)
if (s.pairId == pairId && s.active) { s.active = false; return true; }
if (error) *error = "suppression_not_found";
return false;
}
int activeSuppressionsCount() const {
int n = 0;
for (const auto& s : suppressions_) if (s.active) ++n;
return n;
}
static nlohmann::json toJson(const HintSuppression& s) {
return {{"suppression_id", s.suppressionId}, {"pair_id", s.pairId},
{"reason", s.reason}, {"active", s.active}};
}
private:
std::vector<HintSuppression> suppressions_;
};