// 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 NoteKinds = { "reserve-answer", "invariant", "pre-existing", "residual-risk", "hold", "info", "immaterial", "send-time-check", "refutation-verified", "unverified", }; constexpr std::array CoverageVerdicts = {"clear", "defect", "immaterial", "n/a"}; constexpr std::array CoverageBlocking = {"defect"}; constexpr std::array CoverageUnowned = {"n/a", "MISSING"}; constexpr std::array 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); }