32 lines
1.4 KiB
Text
32 lines
1.4 KiB
Text
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||
|
|
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||
|
|
|
||
|
|
export module Crafter.Review:Schema;
|
||
|
|
import std;
|
||
|
|
import :Json;
|
||
|
|
|
||
|
|
// The structured output a pass returns: FINDING, NOTE, COVERAGE and the
|
||
|
|
// verdict. One block schema and one whole schema per run, the union of every
|
||
|
|
// lens's vocabulary, so the tool block ahead of the user message is
|
||
|
|
// byte-identical across lenses and the prompt cache is shared. The bytes are
|
||
|
|
// fixed: SchemaJson() is the schema in DumpCompactSorted's form, and the
|
||
|
|
// goldens hold the descriptions.
|
||
|
|
export namespace Crafter::Review::Schema {
|
||
|
|
constexpr std::array<std::string_view, 10> NoteKinds = {
|
||
|
|
"reserve-answer", "invariant", "pre-existing", "residual-risk", "hold", "info", "immaterial",
|
||
|
|
"send-time-check", "refutation-verified", "unverified",
|
||
|
|
};
|
||
|
|
constexpr std::array<std::string_view, 4> CoverageVerdicts = {"clear", "defect", "immaterial", "n/a"};
|
||
|
|
constexpr std::array<std::string_view, 1> CoverageBlocking = {"defect"};
|
||
|
|
constexpr std::array<std::string_view, 2> CoverageUnowned = {"n/a", "MISSING"};
|
||
|
|
constexpr std::array<std::string_view, 2> VerdictEnum = {"FIX FIRST", "SEND-READY"};
|
||
|
|
|
||
|
|
Json Finding();
|
||
|
|
Json Note();
|
||
|
|
Json Coverage();
|
||
|
|
Json BlockSchema();
|
||
|
|
Json WholeSchema();
|
||
|
|
// The schema of `kind` ("block", anything else the whole one) as it goes
|
||
|
|
// to claude.
|
||
|
|
std::string SchemaJson(std::string_view kind);
|
||
|
|
}
|