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>
83 lines
2.5 KiB
C++
83 lines
2.5 KiB
C++
// Step 827: Governance and audit report bundle (8 tests)
|
|
#include "governance/GovernanceAuditReport.h"
|
|
#include <iostream>
|
|
|
|
static int p=0,f=0;
|
|
#define T(n) { std::cout << " " << #n << "... "; }
|
|
#define P() { std::cout << "PASS\n"; ++p; }
|
|
#define F(m) { std::cout << "FAIL: " << m << "\n"; ++f; }
|
|
#define C(c,m) if (!(c)) { F(m); return; }
|
|
|
|
static AuditEntry makeEntry(const std::string& id, const std::string& cat) {
|
|
AuditEntry e; e.entryId = id; e.category = cat; e.actorId = "alice";
|
|
e.action = "approve"; e.timestamp = "2026-01-01"; e.details = "detail";
|
|
return e;
|
|
}
|
|
|
|
void t1() {
|
|
T(build_report);
|
|
auto r = GovernanceAuditReportModel::build("RPT-01", {makeEntry("E1","decision")});
|
|
C(r.totalDecisions == 1, "decisions");
|
|
C(r.compliant, "compliant");
|
|
P();
|
|
}
|
|
void t2() {
|
|
T(validate_valid_report);
|
|
auto r = GovernanceAuditReportModel::build("RPT-02", {});
|
|
std::string err;
|
|
C(GovernanceAuditReportModel::validate(r, &err), "valid");
|
|
P();
|
|
}
|
|
void t3() {
|
|
T(validate_missing_id);
|
|
GovernanceAuditReport r;
|
|
std::string err;
|
|
C(!GovernanceAuditReportModel::validate(r, &err) && err == "report_id_missing", "err");
|
|
P();
|
|
}
|
|
void t4() {
|
|
T(category_counts);
|
|
auto r = GovernanceAuditReportModel::build("RPT-04", {
|
|
makeEntry("E4a","decision"), makeEntry("E4b","waiver"), makeEntry("E4c","policy")
|
|
});
|
|
C(r.totalDecisions == 1 && r.totalWaivers == 1 && r.totalPolicyChanges == 1, "counts");
|
|
P();
|
|
}
|
|
void t5() {
|
|
T(multiple_decisions);
|
|
auto r = GovernanceAuditReportModel::build("RPT-05", {
|
|
makeEntry("E5a","decision"), makeEntry("E5b","decision")
|
|
});
|
|
C(r.totalDecisions == 2, "two");
|
|
P();
|
|
}
|
|
void t6() {
|
|
T(empty_entries_ok);
|
|
auto r = GovernanceAuditReportModel::build("RPT-06", {});
|
|
C(r.entries.empty(), "empty");
|
|
C(r.totalDecisions == 0, "zero");
|
|
P();
|
|
}
|
|
void t7() {
|
|
T(to_json_structure);
|
|
auto r = GovernanceAuditReportModel::build("RPT-07", {makeEntry("E7","waiver")});
|
|
auto j = GovernanceAuditReportModel::toJson(r);
|
|
C(j.value("report_id","") == "RPT-07", "id");
|
|
C(j.value("total_waivers", 0) == 1, "waivers");
|
|
C(j.contains("entries"), "entries");
|
|
P();
|
|
}
|
|
void t8() {
|
|
T(compliant_flag_true);
|
|
auto r = GovernanceAuditReportModel::build("RPT-08", {makeEntry("E8","decision")});
|
|
C(r.compliant, "compliant");
|
|
P();
|
|
}
|
|
|
|
int main() {
|
|
std::cout << "Step 827: Governance and audit report bundle\n";
|
|
t1(); t2(); t3(); t4(); t5(); t6(); t7(); t8();
|
|
std::cout << "\nResults: " << p << "/" << (p+f) << " passed\n";
|
|
return f ? 1 : 0;
|
|
}
|