Sprint 27: end-of-sprint architecture refactor pass
This commit is contained in:
23
editor/src/ConstraintSchemaFailurePacket.h
Normal file
23
editor/src/ConstraintSchemaFailurePacket.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
// Sprint 27 refactor: shared schema-failure packet helper
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ConstraintViolationDiagnostics.h"
|
||||
|
||||
inline ConstraintDiagnosticPacket makeUnderConstrainedContractPacket(
|
||||
const std::vector<std::string>& errors) {
|
||||
ConstraintDiagnosticPacket packet;
|
||||
packet.ok = false;
|
||||
packet.recommendedAction = "escalate";
|
||||
for (const auto& error : errors) {
|
||||
packet.violations.push_back({
|
||||
"under_constrained_contract",
|
||||
"Taskitem contract failed schema validation",
|
||||
error,
|
||||
false
|
||||
});
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
Reference in New Issue
Block a user