feat(modes): the kernel modes - a patch series and a mailing-list reply

Beside the push gates, crafter-review runs the pre-send review of a kernel
contributor's workbench: --mode series over a format-patch export with its
cover letter, --mode reply over a mail draft. The inventory partitions a
cover letter, a plain mail and the camera review's shape; ten kernel lenses
join the table with their gates (structure, code, artifact truth) and the
persona gate - one maintainer-persona instance per --reviewers entry, its
whole pass gating its blocks and pruning the units that are not theirs. A
series' code units are keyed on the code like the push gates'; every text
unit on its text, the references it cites and the anchor when it is dated.
The references an artifact cites are prefetched through utilities/lore.py
into the gate-state, with a digest in the run layer, and a persona's
calibration map is its lore listing. The kernel schema carries the persona
vocabulary, the kernel note kinds, the predicted review and the not-mine
list; the matrix the persona holes, the thin and the modelled units; gates
clean without a persona pass is GATES CLEAN. A reply's gate-state sits
beside the draft and is read once; a kernel mode needs --subsystem,
defaults the effort to max and the trees to work/linux,work/milos-linux,
and excuses no unit from the holes.

The kernel lenses and the common text ship verbatim; the table lists them
after the push gates' lenses and the config template holds them off, so a
repository that never turns them on changes nothing. Prompts, keys and plans
were checked byte for byte against the pipeline these modes replace, on its
own artifacts: two replies and a series, every system prompt, user prompt,
job and reuse key identical.
This commit is contained in:
Jorijn van der Graaf 2026-10-31 22:56:12 +01:00
commit 339f4b9b40
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
46 changed files with 5732 additions and 362 deletions

View file

@ -32,7 +32,7 @@ namespace Crafter::Review::Schema {
}
}
Json Finding() {
Json Finding(bool kernel) {
Json contests = {
{"type", "object"},
{"additionalProperties", false},
@ -47,8 +47,8 @@ namespace Crafter::Review::Schema {
{"additionalProperties", false},
{"required", {"finding", "evidence", "proposedAction", "items"}},
{"properties", {
{"finding", String("the defect - by your lens's charter question (objective wrongness)")},
{"evidence", String("file:line, a verbatim quote, the steps taken in the application and what was observed (a screenshot or snapshot path) - no vibes")},
{"finding", String(kernel ? "the defect - by your lens's charter question (objective wrongness, or a predicted reviewer comment)" : "the defect - by your lens's charter question (objective wrongness)")},
{"evidence", String(kernel ? "file:line, msgid, or verbatim quote - no vibes" : "file:line, a verbatim quote, the steps taken in the application and what was observed (a screenshot or snapshot path) - no vibes")},
{"proposedAction", String()},
{"items", StringList("the INVENTORY unit ids this finding concerns, copied exactly; a finding that spans units lists them all")},
{"dischargedBy", String("id of a disposition listed under DISPOSITIONS IN FORCE that discharges this finding (you verified its grounds); omit when none applies")},
@ -57,65 +57,75 @@ namespace Crafter::Review::Schema {
};
}
Json Note() {
Json Note(bool kernel) {
Json properties = {
{"kind", {{"type", "string"}, {"enum", kernel ? Strings(KernelNoteKinds) : Strings(NoteKinds)}}},
{"note", String()},
{"evidence", String()},
{"action", String(kernel ? "what the orchestrator does with it (bank / ledger / confirm at send / nothing)" : "what the orchestrator does with it (bank / record in the manifest / check at push time / nothing)")},
{"id", String(kernel ? "disposition-review and refutation-verified only: the disposition id" : "refutation-verified only: the disposition id")},
};
if (kernel) properties["wouldComment"] = {{"type", "boolean"}, {"description", "disposition-review only: would this reviewer comment on the discharged item as the artifact stands?"}};
properties["items"] = StringList("INVENTORY unit ids this note concerns");
return {
{"type", "object"},
{"additionalProperties", false},
{"required", {"kind", "note", "evidence", "action"}},
{"properties", {
{"kind", {{"type", "string"}, {"enum", Strings(NoteKinds)}}},
{"note", String()},
{"evidence", String()},
{"action", String("what the orchestrator does with it (bank / record in the manifest / check at push time / nothing)")},
{"id", String("refutation-verified only: the disposition id")},
{"items", StringList("INVENTORY unit ids this note concerns")},
}},
{"properties", properties},
};
}
Json Coverage() {
Json Coverage(bool kernel) {
return {
{"type", "object"},
{"additionalProperties", false},
{"required", {"item", "verdict", "basis"}},
{"properties", {
{"item", String("an INVENTORY unit id, verbatim")},
{"verdict", {{"type", "string"}, {"enum", Strings(CoverageVerdicts)}}},
{"basis", String("what this verdict rests on: the tree ref, the command run, the steps taken in the application and the evidence file - or the literal string \"no record\"")},
{"verdict", {{"type", "string"}, {"enum", kernel ? Strings(KernelCoverageVerdicts) : Strings(CoverageVerdicts)}}},
{"basis", String(kernel ? "what this verdict rests on: the source fetched / tree ref / units crossed / your own message-id - or the literal string \"no record\""
: "what this verdict rests on: the tree ref, the command run, the steps taken in the application and the evidence file - or the literal string \"no record\"")},
}},
};
}
Json BlockSchema() {
Json BlockSchema(bool kernel) {
return {
{"type", "object"},
{"additionalProperties", false},
{"required", {"verdict", "findings", "notes", "coverage"}},
{"properties", {
{"verdict", Verdict("FIX FIRST iff any finding is undischarged - the pipeline derives the same and fails closed on disagreement")},
{"findings", {{"type", "array"}, {"items", Finding()}}},
{"notes", {{"type", "array"}, {"items", Note()}}},
{"coverage", {{"type", "array"}, {"items", Coverage()}, {"minItems", 1}, {"maxItems", 1}, {"description", "exactly one entry: the unit this pass covers"}}},
{"findings", {{"type", "array"}, {"items", Finding(kernel)}}},
{"notes", {{"type", "array"}, {"items", Note(kernel)}}},
{"coverage", {{"type", "array"}, {"items", Coverage(kernel)}, {"minItems", 1}, {"maxItems", 1}, {"description", "exactly one entry: the unit this pass covers"}}},
}},
};
}
Json WholeSchema() {
Json WholeSchema(bool kernel) {
Json properties = {
{"verdict", Verdict({})},
{"findings", {{"type", "array"}, {"items", Finding(kernel)}}},
{"notes", {{"type", "array"}, {"items", Note(kernel)}}},
{"coverage", {{"type", "array"}, {"items", Coverage(kernel)}, {"description", "one entry per unit you were asked to cover"}}},
{"summary", String(kernel ? "5-10 sentences: the artifact as you judged it and the constraints the block passes must respect; a persona adds its calibration digest (pet issues, phrasing, imperatives found in its own mail)"
: "5-10 sentences: the range as you judged it and the constraints the block passes must respect (the functional lens: how to reach each touched screen, the login used, what the block passes must not touch)")},
};
if (kernel) {
properties["predictedReview"] = String("persona lens only: the review this person would send, in their voice");
properties["notMine"] = StringList("persona lens only: unit ids that are not your tree, file or decision (each must carry a basis in coverage)");
}
return {
{"type", "object"},
{"additionalProperties", false},
{"required", {"verdict", "findings", "notes", "coverage", "summary"}},
{"properties", {
{"verdict", Verdict({})},
{"findings", {{"type", "array"}, {"items", Finding()}}},
{"notes", {{"type", "array"}, {"items", Note()}}},
{"coverage", {{"type", "array"}, {"items", Coverage()}, {"description", "one entry per unit you were asked to cover"}}},
{"summary", String("5-10 sentences: the range as you judged it and the constraints the block passes must respect (the functional lens: how to reach each touched screen, the login used, what the block passes must not touch)")},
}},
{"properties", properties},
};
}
std::string SchemaJson(std::string_view kind) {
return DumpCompactSorted(kind == "block" ? BlockSchema() : WholeSchema());
std::string SchemaJson(std::string_view kind, std::string_view mode) {
const bool kernel = mode == "reply" || mode == "series";
return DumpCompactSorted(kind == "block" ? BlockSchema(kernel) : WholeSchema(kernel));
}
}