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:
parent
4fc15fe1c2
commit
339f4b9b40
46 changed files with 5732 additions and 362 deletions
|
|
@ -22,7 +22,11 @@ import sys, json, hashlib, subprocess, pathlib, tempfile, os, shutil
|
|||
W = pathlib.Path(sys.argv[1]); EXE = sys.argv[2]
|
||||
G = W / 'tests/Goldens/fixture/pipeline.json'
|
||||
g = json.loads(G.read_text())
|
||||
TABLE = [('repo-better-solution.md', 'none'), ('repo-functional.md', 'browser'), ('repo-bug-prover.md', 'none'), ('repo-security.md', 'none'), ('repo-facts.md', 'none')]
|
||||
TABLE = [('repo-better-solution.md', 'none'), ('repo-functional.md', 'browser'), ('repo-bug-prover.md', 'none'), ('repo-security.md', 'none'), ('repo-facts.md', 'none'),
|
||||
('better-solution.md', 'none'), ('code-quality.md', 'none'), ('minimalism.md', 'none'), ('bug-prover.md', 'none'), ('facts.md', 'none'), ('consistency.md', 'none'),
|
||||
('process-docs.md', 'none'), ('etiquette.md', 'none'), ('conciseness.md', 'none'), ('maintainer-persona.md', 'none')]
|
||||
# The push gates' lenses: the plans and estimates of the series goldens are theirs.
|
||||
REPO_TABLE = TABLE[:5]
|
||||
GATES = [('Gate 1 — Approach', ['repo-better-solution.md']), ('Gate 2 — Functional', ['repo-functional.md']),
|
||||
('Gate 3 — Proof', ['repo-bug-prover.md', 'repo-security.md']), ('Gate 4 — Commit truth', ['repo-facts.md'])]
|
||||
name_of = lambda f: f.replace('.md', '')
|
||||
|
|
@ -129,7 +133,7 @@ for name, entry in g['series'].items():
|
|||
if 'plans' not in entry: continue
|
||||
jobs = []
|
||||
recorded = []
|
||||
for f, _ in TABLE:
|
||||
for f, _ in REPO_TABLE:
|
||||
plan = entry['plans'].get(f)
|
||||
if plan is None: continue
|
||||
here = ([plan['whole']] if plan['whole'] is not None else []) + plan['blocks']
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -94,6 +94,8 @@ namespace {
|
|||
std::map<std::string, Json> wholeByLens;
|
||||
const std::vector<std::string> exclude = {"**/*.test.*", "docs/**", "tests/**"};
|
||||
for (const Plan::Lens& lens : Plan::Lenses) {
|
||||
// The goldens record the push gates; the kernel modes' lenses are another mode's.
|
||||
if (lens.kernel) continue;
|
||||
const Plan::LensPlan plan = Plan::PlanLens(lens.file, units, built.lines, {}, exclude);
|
||||
Json blocks = Json::array();
|
||||
for (const Json& block : plan.blocks) blocks.push_back(block);
|
||||
|
|
@ -141,6 +143,8 @@ namespace {
|
|||
std::vector<std::string> all;
|
||||
std::vector<std::string> statics;
|
||||
for (const Plan::Lens& lens : Plan::Lenses) {
|
||||
// The goldens record the push gates; the kernel modes' lenses are another mode's.
|
||||
if (lens.kernel) continue;
|
||||
all.emplace_back(lens.file);
|
||||
if (lens.file != Plan::FunctionalLens) statics.emplace_back(lens.file);
|
||||
}
|
||||
|
|
@ -150,6 +154,8 @@ namespace {
|
|||
SameJson(ToJson(Plan::NotReviewed(units, built.lines, functional, exclude)), golden.at("notReviewed").at("functional"), std::format("{}: not_reviewed functional", name));
|
||||
std::vector<Json> jobs;
|
||||
for (const Plan::Lens& lens : Plan::Lenses) {
|
||||
// The goldens record the push gates; the kernel modes' lenses are another mode's.
|
||||
if (lens.kernel) continue;
|
||||
for (const bool excluded : {false, true}) {
|
||||
const Plan::LensPlan plan = Plan::PlanLens(lens.file, units, built.lines, {}, excluded ? std::span<const std::string>(exclude) : std::span<const std::string>());
|
||||
Json blocks = Json::array();
|
||||
|
|
|
|||
Loading…
Reference in a new issue