Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
808d69a
designs: phase 3 model review on open-weight models
Nov 24, 2026
e6d6220
bench: score phase 3 layer 3 against the benchmark
Nov 24, 2026
b599bb2
designs: phase 3 on hosted open-weight endpoints
thomas-roos Nov 25, 2026
cdffc77
review: gather layer 2 context in the check container
thomas-roos Nov 25, 2026
62d1313
review: one model call per patch
thomas-roos Nov 25, 2026
4ccebb5
report: show model review
thomas-roos Nov 25, 2026
92076ee
check: --review for a series before sending
thomas-roos Nov 25, 2026
1c7d5ee
bench: send reasoning_effort to the endpoint
thomas-roos Nov 25, 2026
772d2c0
review: add reasoning_effort, and say when an answer was cut
thomas-roos Nov 25, 2026
4b73882
docs: phase 3 measurement
thomas-roos Nov 25, 2026
f2b15dc
bench: held-out set, confidence filter and an evidence prompt
thomas-roos Nov 25, 2026
70eda72
designs: draft fine-tuning layer 3 on review history
thomas-roos Nov 25, 2026
665edd1
bench: replay list reviews and learn rules from them
thomas-roos Nov 25, 2026
b293e31
designs: verify model review live against the lists
thomas-roos Nov 25, 2026
58800b5
review: drop model findings below min_confidence
thomas-roos Nov 25, 2026
d6b6f32
docs: phase 3 accuracy work
thomas-roos Nov 25, 2026
e6692ef
docs: watch the meta-arm, meta-ti and meta-arago lists
thomas-roos Nov 25, 2026
d211af4
review: send prompt v2 and check the quoted evidence
thomas-roos Nov 26, 2026
739fe01
review: log each call on stderr
thomas-roos Nov 26, 2026
5b9e21a
review: escalate risky patches to a larger model with git tools
thomas-roos Nov 26, 2026
46e1cc8
review: score reviews against what the lists decide
thomas-roos Nov 26, 2026
b174bb2
review: series context, more OE facts, no repeated findings
thomas-roos Nov 26, 2026
6ee8d67
review: max_tokens for models that reason at length
thomas-roos Nov 26, 2026
fbed4cc
check: review chosen patches, or write the requests
thomas-roos Nov 26, 2026
9824a69
bench: train a layer 3 model on the lists' review history
thomas-roos Nov 26, 2026
d89487c
designs: a check pass for no false findings on local hardware
thomas-roos Nov 26, 2026
7aeb625
review: give the model the docs of what a patch changes
thomas-roos Nov 26, 2026
68174d1
bench: train on maintainers' review comments, fit 16 GB
thomas-roos Nov 26, 2026
733761e
review: a check pass before a finding is shown
thomas-roos Nov 26, 2026
f5f09e0
bench: training requests with the docs, cleaner comments
thomas-roos Nov 26, 2026
2737278
review: rules from maintainers' reviews, chosen per patch
thomas-roos Nov 26, 2026
7831971
review: the rules in the plugin, built in
thomas-roos Nov 26, 2026
254a597
plugin: evals on real patches for the review rules
thomas-roos Nov 26, 2026
25e8be2
designs: fine-tuning stopped, the history goes into the prompt
thomas-roos Nov 27, 2026
cb1859c
review: stop asking an endpoint that does not answer
thomas-roos Nov 27, 2026
86731ec
review: rules for BitBake behaviour that is not a defect
thomas-roos Nov 27, 2026
a4be6e5
plugin: two more traps, no sign-off demand for a refreshed patch
thomas-roos Nov 27, 2026
395b74e
plugin: make Claude read the review rules before a review
thomas-roos Nov 27, 2026
f5dd5e6
bench: the bitbake.conf default of each variable in the docs index
thomas-roos Nov 27, 2026
98018ed
check: --review-requests writes the request review sends
thomas-roos Nov 27, 2026
1bab54c
review: the rules go to the check pass, not to layer 3
thomas-roos Nov 27, 2026
6ebe6bb
review: retry a reasoning loop at low effort; keep two line-less find…
thomas-roos Nov 27, 2026
99df8ce
README: how model review works, with a diagram
thomas-roos Nov 27, 2026
9d366ae
review: retry a reasoning loop without reasoning
thomas-roos Nov 27, 2026
747e15a
verify: match a confirmation's quote line by line, as evidence is
thomas-roos Nov 27, 2026
0ee7ed9
plugin: lookups in the tree should not show as failed commands
thomas-roos Nov 27, 2026
4f4c41c
README: hosting the review model yourself
thomas-roos Nov 27, 2026
48abb6c
review: configurable retry effort; findings inside a carried patch
thomas-roos Nov 27, 2026
779dc96
review: keep a finding whose path names a unique file
thomas-roos Nov 27, 2026
0cd0730
verify: a confirmation may not quote the finding or the prompt
thomas-roos Nov 27, 2026
07493f4
review: built-in rules without guides; expand a home-relative guides …
thomas-roos Nov 27, 2026
8684607
review: prompt v2.4; --review-requests as review sends it
thomas-roos Nov 27, 2026
7a85979
outcomes: a patch without an interdiff ends undecided
thomas-roos Nov 27, 2026
3da8ce2
context: grep hits in files named like CVE-2024-6197.patch
thomas-roos Nov 27, 2026
33ece4f
verify: a check pass the endpoint cannot answer leaves the patch queued
thomas-roos Nov 27, 2026
1518a67
runner: keep review refs only for queued patches; release replaced ones
thomas-roos Nov 27, 2026
1cdfc5d
report: name every model in the text report's model review
thomas-roos Nov 27, 2026
c9ab094
changes: the review notes say what this branch now does
thomas-roos Nov 27, 2026
4b6352a
README: the model review diagram as the code runs
thomas-roos Nov 27, 2026
ef4b33a
docs: STATUS says what model review sends and what is measured
thomas-roos Nov 27, 2026
3e6df1e
designs: PHASE3 as built
thomas-roos Nov 27, 2026
16eb155
docs: bench, plugin and skill as they are
thomas-roos Nov 27, 2026
61dfb56
review: cut a request to fit the context, least needed first
thomas-roos Nov 27, 2026
86246ae
review: ask several times; the check pass decides by majority
thomas-roos Nov 27, 2026
0ca5065
review: the model's own temperature unless one is set
thomas-roos Nov 27, 2026
6c391e9
review: a finding repeated across samples by its evidence; wait out 429s
thomas-roos Nov 27, 2026
bf0359e
verify: check a large patch without the rules rather than not at all
thomas-roos Nov 27, 2026
443fcba
README: hosting settings that measure what the model can do
thomas-roos Nov 27, 2026
fc8f81a
docs: the clean retest's numbers, not the single-sample ones
thomas-roos Nov 27, 2026
0c8f9a8
designs: phase 4, focused review passes
thomas-roos Nov 27, 2026
212be9e
docs: STATUS with the Qwen3.6-35B-A3B result of the retest
thomas-roos Nov 27, 2026
46063ce
designs: phase 4 question, a smaller model per pass
thomas-roos Nov 27, 2026
b48b7ee
designs: phase 4, merging repeats across samples
thomas-roos Nov 27, 2026
3562ef5
docs: six real defects; phase 4 keeps one check, and the plugin
thomas-roos Nov 27, 2026
17c80a6
plugin: zip's and openssh's cases are traps; PH7 leaves a dateless st…
thomas-roos Nov 27, 2026
467920a
designs: phase 4, the model reviews only what no check can see
thomas-roos Nov 27, 2026
ea2d4cf
designs: phase 4, what only a model can see, in five classes
thomas-roos Nov 28, 2026
10bdce2
designs: phase 4, the replay for the local setup and Claude
thomas-roos Nov 28, 2026
cd4a0ae
designs: phase 4, AutoBuilder failures are no test set for the model
thomas-roos Nov 28, 2026
dc3095f
designs: phase 4, the CVE tag check
thomas-roos Nov 28, 2026
9c8773b
review: the check pass may ask another endpoint and model
thomas-roos Nov 27, 2026
d83773e
designs: phase 4, the hybrid check pass
thomas-roos Nov 27, 2026
610af50
review: leave to the checks what a fixed rule could find
thomas-roos Nov 28, 2026
2c45033
review: ask the check pass again for a misquote; match carried paths …
thomas-roos Nov 28, 2026
9ec7305
plugin: name the five kinds of defect only a review finds
thomas-roos Nov 28, 2026
3ecb54b
review: name the five kinds of defect only a review finds
thomas-roos Nov 28, 2026
cb46828
review: layer 4 may ask another endpoint, and every patch
thomas-roos Nov 28, 2026
82932b9
metadata: report a truncated Backport commit hash
thomas-roos Nov 27, 2026
4d1cc11
metadata: report a CVE tag that names another CVE than its file
thomas-roos Nov 28, 2026
c91b7e9
autobuilder: tie a failure to the recipe, not its directory
thomas-roos Nov 28, 2026
0804bc8
designs: phase 4, all of it on one branch
thomas-roos Nov 28, 2026
7f20064
plugin: say how to fetch the upstream commit of a backport
thomas-roos Nov 28, 2026
cab24e5
designs: phase 4, what Claude's transcripts show about the plugin
thomas-roos Nov 28, 2026
8eb6915
designs: phase 4, upstream for a backport
thomas-roos Nov 28, 2026
408dcee
review: log the finding the check pass refuted
thomas-roos Nov 28, 2026
00d852b
check: judge given findings with --review-findings
thomas-roos Nov 28, 2026
6518e0c
designs: phase 4, one question per class; a missing thing needs a tool
thomas-roos Nov 28, 2026
731eb18
review: ask once per class of defect with questions = true
thomas-roos Nov 28, 2026
4627be3
review: confirm an absence only with a tool's output
thomas-roos Nov 28, 2026
2ce20ba
review: one file for the classes, read by the plugin and bodnuti
thomas-roos Nov 28, 2026
c68d437
review: log the time and tokens of each check pass call
thomas-roos Nov 28, 2026
2046b55
designs: phase 4, smaller requests
thomas-roos Nov 28, 2026
d67cefc
review: no git grep for a function's locals or __anonymous
thomas-roos Nov 28, 2026
f4ffaeb
review: send a big touched file as the lines around its hunks
thomas-roos Nov 28, 2026
302613e
designs: phase 4, the smaller requests that are built
thomas-roos Nov 28, 2026
3b7c691
plugin: three BitBake behaviours models reported as defects
thomas-roos Nov 28, 2026
97f3242
plugin: BB-9, Python functions have bb, os, d and oe
thomas-roos Nov 28, 2026
024fbde
designs: phase 4, layer 4 on the logic patches
thomas-roos Nov 28, 2026
b29a073
build: copy the whole review rules skill into the image
thomas-roos Nov 29, 2026
d7b9676
metadata: report a PV that contradicts the file name
thomas-roos Nov 29, 2026
565b274
metadata: check CVE tags also when the license changed
thomas-roos Nov 29, 2026
75ca893
verify: stop asking once the majority is decided
thomas-roos Nov 29, 2026
574a4e2
verify: log every failed check pass call
thomas-roos Nov 29, 2026
966ea2a
verify: record the check pass's votes
thomas-roos Nov 29, 2026
f29920b
plugin: PKGCFG-2's exception and the kernel's PARTNAME
thomas-roos Nov 29, 2026
bb92656
plugin: shorten PKGCFG-2's exception and TS4
thomas-roos Nov 29, 2026
a87aeb1
plugin: drop the orc line from PKGCFG-2's evidence
thomas-roos Nov 29, 2026
7af0583
review: a system prefix for the reasoning level
thomas-roos Nov 29, 2026
4bfb109
review: say what a dropped finding quoted
thomas-roos Nov 29, 2026
b86213c
review: log a failed attempt before asking again
thomas-roos Nov 29, 2026
e4e84e5
verify: ask once more for a verdict that came back empty
thomas-roos Nov 29, 2026
3f57fa3
verify: five tool turns, as layer 4 has
thomas-roos Nov 29, 2026
7935a10
review: read a recipe's upstream source
thomas-roos Nov 29, 2026
056a54b
review: log each tool call
thomas-roos Nov 29, 2026
d23ec78
designs: phase 4, tools by layer
thomas-roos Nov 29, 2026
d735de5
verify: say what an unparsable verdict began with
thomas-roos Nov 29, 2026
fa8c0dd
review: one tools sentence, tool calls logged in one place; docs
thomas-roos Nov 29, 2026
325f894
review: upstream source tools only with upstream = true
thomas-roos Nov 29, 2026
7f5a59c
config: review profiles for whole setups
thomas-roos Nov 29, 2026
eb42a57
review: list the tools one by one
thomas-roos Nov 29, 2026
3a63bdc
plugin: the review's BitBake facts in the skill
thomas-roos Nov 29, 2026
2a6d9c4
plugin: read upstream before claiming what it has
thomas-roos Nov 29, 2026
45648c4
bench: a replay set from a list, newest first
thomas-roos Nov 29, 2026
d00e7b3
designs: phase 4, the AutoBuilder and learning from each month
thomas-roos Nov 29, 2026
11f1a1c
config: four hours per request for local Qwen3.8
thomas-roos Nov 29, 2026
3a7c2ae
verify: ask once for JSON after a prose verdict
thomas-roos Nov 29, 2026
fe714e4
publish: a model review column in the series index
thomas-roos Nov 29, 2026
4811f26
review: model review for listed branches only
thomas-roos Nov 29, 2026
6aa0d7c
review: keep up to 2,000 characters of a finding
thomas-roos Nov 29, 2026
95e56cc
verify: refute a finding that only supposes
thomas-roos Nov 29, 2026
18945c0
review: a queue entry already gone does not stop the run
thomas-roos Nov 29, 2026
01b82d2
rules: task signatures and returns in appends
thomas-roos Nov 29, 2026
9d31df3
rules: PKGCFG-2 triggers on any empty field
thomas-roos Nov 29, 2026
8626f73
review: a seed option, set in the local profiles
thomas-roos Nov 30, 2026
e63e3a6
publish: the series column keeps its room on a phone
thomas-roos Nov 30, 2026
ffbbb47
publish: result and model review wrap on a phone
thomas-roos Nov 30, 2026
4ab2dbe
publish: say when the check pass confirmed a model finding
thomas-roos Nov 30, 2026
3d4590c
track: a lone revision of an unseen patch is its own series
thomas-roos Nov 30, 2026
59aaf1d
publish: a model finding reads "model" and its kind
thomas-roos Nov 30, 2026
ef72b5f
changes: note the lone revision fix
thomas-roos Nov 30, 2026
a6bfef5
series: decode RFC 2047 encoded words in headers
thomas-roos Nov 30, 2026
746a0f2
review: reuse a review by patch-id only from the same model
thomas-roos Nov 30, 2026
e03d679
watch: review again what another model reviewed
thomas-roos Nov 30, 2026
356f3c9
changes: note the re-review after a switch of model
thomas-roos Nov 30, 2026
63cd42a
publish: what a model review took and decided
thomas-roos Nov 30, 2026
1dbebd4
publish: tokens written, not "thinking included"
thomas-roos Nov 30, 2026
49d9278
review: one pass, no samples or questions
thomas-roos Nov 30, 2026
1c0f4ae
designs: final values from BitBake for the review
thomas-roos Nov 30, 2026
f706377
review: one pipeline, fewer knobs, no repeated requests
thomas-roos Nov 30, 2026
77e4047
review: final values from BitBake in layer 2
thomas-roos Nov 30, 2026
7041f6f
bitbake: OE-Core as of the patch, quieter users
thomas-roos Nov 30, 2026
a7c0f51
bitbake: OE-Core and BitBake of the branch the subject names
thomas-roos Nov 30, 2026
f339343
metadata: PV that repeats the file name, git URI without tag=
thomas-roos Nov 30, 2026
0dcdd52
verify: answer without tools after a broken tool call
thomas-roos Nov 30, 2026
db4b82e
review: no empty BitBake block in the request
thomas-roos Nov 30, 2026
5983979
review: compare a carried backport with its upstream commit
thomas-roos Nov 30, 2026
7229ac5
upstream: short hashes, cgit queries and gitweb in Backport URLs
thomas-roos Nov 30, 2026
2a42813
bitbake: parse the recipe without the distro features it tests for
thomas-roos Nov 30, 2026
620fb96
watch: drop another model's review also for a landed series
thomas-roos Nov 30, 2026
5868e18
review: what an upgrade changes in upstream's build files
thomas-roos Nov 30, 2026
e300264
oelint: bodnuti's static checks as oelint-adv rules
thomas-roos Nov 30, 2026
d3db797
rules: drop the rules a static check already decides
thomas-roos Nov 30, 2026
571d985
oelint: features_check, GitHub archives, auto-detected PACKAGECONFIG
thomas-roos Nov 30, 2026
69ca811
watch: check open series again when the checks change
thomas-roos Nov 30, 2026
5ba1f1f
plugin: name bodnuti's own oelint rules in the skill
thomas-roos Nov 30, 2026
c6873e6
review: skip the model where the checks cover every change
thomas-roos Nov 30, 2026
eda4de0
upstream: which releases contain a backported commit
thomas-roos Nov 30, 2026
c5827ff
upstream: whether a submitted pull or merge request was merged
thomas-roos Nov 30, 2026
c699f78
upstream: compare a submitted patch with the request's code
thomas-roos Nov 30, 2026
14d500e
oelint: SPDX names, Python 2, PACKAGECONFIG defaults, conditional pat…
thomas-roos Nov 30, 2026
ef6d924
review: drop the outcomes scoring
thomas-roos Nov 30, 2026
469ecc8
designs: checks that need the network
thomas-roos Nov 30, 2026
8acc7d6
check: Backports not yet released and merged submissions
thomas-roos Nov 30, 2026
aef3b32
oelint: build tools in DEPENDS, bash, devtool leftovers, sysroot paths
thomas-roos Nov 30, 2026
e2c8a75
README: bodnuti's own oelint rules and the upstream checks
thomas-roos Nov 30, 2026
80fa9c4
watch: check at most twelve series again per run
thomas-roos Nov 30, 2026
ec412fd
upstream: name the main branch, count the others
thomas-roos Nov 30, 2026
96e5061
oelint: glibc, systemd units, CVE_VERSION, Pending with a link; docs/…
thomas-roos Nov 30, 2026
04c13f5
check: lowered versions, placeholder identities, strip without reason
thomas-roos Nov 30, 2026
93b6f23
oelint: the static part of four more review rules
thomas-roos Nov 30, 2026
f24f66a
verify: one plain question after an empty answer with tools
thomas-roos Nov 30, 2026
47e4b83
oelint: a local SRC_URI file that is not there
thomas-roos Nov 30, 2026
db945df
ruff: a layer's Python, for bugs only
thomas-roos Nov 30, 2026
e85c1a7
bitbake: export OE-Core and BitBake, do not add worktrees
thomas-roos Nov 30, 2026
9c4525a
upstream: no shallow fetch into the clone; BitBake's locale in the image
thomas-roos Nov 30, 2026
3e33760
report: CHECKS 11, so the reports the shallow clone and the missing
thomas-roos Nov 30, 2026
4cce6fb
bitbake: parse without host tools
thomas-roos Nov 30, 2026
d50f06e
oelint: keep its crash message out of the report
thomas-roos Dec 1, 2026
3c045e3
review: newest patches first
thomas-roos Dec 1, 2026
767f289
publish: sort the series table by any column
thomas-roos Dec 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/target
__pycache__/

# claude plugin eval output
plugins/bodnuti/evals/results/
11 changes: 10 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ COPY Cargo.toml Cargo.lock ./
COPY assets ./assets
COPY src ./src
COPY tests ./tests
# The review rules and classes are built in (src/review.rs).
COPY plugins/bodnuti/skills/yocto-review-rules ./plugins/bodnuti/skills/yocto-review-rules
RUN cargo build --release --locked

# shellcheck ships as a static binary in its own image.
Expand All @@ -25,8 +27,12 @@ FROM docker.io/library/debian:trixie-slim
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends git python3 python3-venv ca-certificates \
cppcheck \
cppcheck locales \
&& sed -i 's/^# *en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && locale-gen \
&& rm -rf /var/lib/apt/lists/*
# BitBake's server refuses to start without this locale (designs/PHASE4.md
# §10); the check parses a patch's recipes with it.
ENV LANG=en_US.UTF-8

# Python tools in one venv. The pins live in requirements.txt, where
# vulnerability scanners and Dependabot can read them.
Expand All @@ -49,7 +55,10 @@ COPY --from=shellcheck /bin/shellcheck /usr/local/bin/shellcheck
COPY --from=trivy /usr/local/bin/trivy /usr/local/bin/trivy
COPY --from=build /src/target/release/bodnuti /usr/local/bin/bodnuti

# The check runs with no network, no secret and read-only mounts, so
# BitBake may parse a patch's recipes here (designs/PHASE4.md §10).
ENV PATH=/opt/venv/bin:$PATH \
BODNUTI_SANDBOXED=1 \
BODNUTI_SHELLCHECK=shellcheck \
BODNUTI_PYTHON=/opt/venv/bin/python \
BODNUTI_OELINT=/opt/venv/bin/oelint-adv \
Expand Down
155 changes: 153 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,22 @@ For layers and BitBake:
- **patchtest** (OE-Core): commit message, shortlog, Signed-off-by, and the
`Upstream-Status`, `Signed-off-by` and `CVE:` headers of added `.patch` files;
- **oelint-adv**: recipe, class, include and configuration style and
correctness rules;
correctness rules, and bodnuti's own (`assets/oelint/`) for what
maintainers ask for again and again: a PV that contradicts or repeats
the file name, a CVE tag naming another CVE, a cut-off Backport hash,
`*_DISTRO_FEATURES` without features_check, GitHub archive tarballs,
old license names, Python 2, PACKAGECONFIG defaults a distro cannot
override, build tools in DEPENDS that a class brings, bash for the main
package, devtool leftovers and `/usr` or `${D}` in configure options;
as style notes, a git URI without `tag=`, an empty PACKAGECONFIG side,
a patch applied under an override and `sed -i` on build files;
- **upstream**, on the host with the network (`--offline` skips it): a
Backport of a commit no upstream release contains, and a Submitted
pull or merge request upstream has merged;
- **shellcheck**: shell in task functions and shipped scripts, run as
`/bin/sh`, which is dash on many hosts;
- **ruff**: the layer's Python (meta/lib/oe, oeqa, scripts), for syntax
errors and undefined names only;
- **leftover files**: patch files a series drops from `SRC_URI` but leaves in
the layer;
- **line length, license changes and CVE_CHECK_IGNORE**: added lines over
Expand All @@ -34,7 +47,8 @@ layerindex-web and error-report-web:
- **trivy**: known vulnerabilities in the application's dependency pins.

Each checker runs on the tree before and after the series, so existing
problems are not blamed on the author. See [`designs/DESIGN.md`](designs/DESIGN.md)
problems are not blamed on the author. Every check, with its id and its test, is in
[`docs/CHECKS.md`](docs/CHECKS.md). See [`designs/DESIGN.md`](designs/DESIGN.md)
for the design and [`docs/STATUS.md`](docs/STATUS.md) for the current state.

## Usage
Expand All @@ -53,6 +67,143 @@ bodnuti check --repo <layer checkout> <Message-ID | lore URL | mbox files...>

Exit status: 0 clean, 1 findings, 2 a checker could not run or bad input.

### Model review before sending

`--review` also asks an open-weight model to review each patch
([`designs/PHASE3.md`](designs/PHASE3.md)): bodnuti gathers the patch's
context (the files it touches, what they require and inherit, where the
names it changes are used) and sends one request per patch to an
OpenAI-compatible endpoint. Its findings are listed under "model review",
marked unverified, and never change the exit status.

The settings are the `[review]` table of `--review-config`, by default
`~/.config/bodnuti/watch.toml`:

```toml
[review]
endpoint = "https://api.friendli.ai/serverless/v1"
api_key_file = "~/.config/bodnuti/review.key" # mode 600
model = "zai-org/GLM-5.3-Flash"
guides = "~/sashiko/projects/yoctoproject/prompts" # optional
docs = "~/docs-index.json" # optional, from bench/phase3/docs_index.py
verify = true # the check pass
```

Ready-made settings for whole setups, endpoint, model and parameters,
are in [`config/review/`](config/review/): Qwen3.8 on your own GPU
(`qwen3.8-local.toml`, with layer 4 at xhigh in
`qwen3.8-local-escalate.toml`, and the Modelfile) and GLM-5.3 hosted
(`glm-hosted.toml`). Pick one with `--review-config`. `tools` in a profile lists the
check pass's and layer 4's read-only tools one by one, by default
`grep`, `show` and `log`; `upstream_grep` and `upstream_show` fetch a
recipe's upstream source over the network, and `upstream_commit` the
commit a carried Backport names, whose comparison with the patch then
also goes into every review request.

Or a model of your own, which sends no key:

```
bodnuti check --review --review-endpoint http://localhost:11434/v1 \
--review-model qwen3:30b-a3b --repo <layer> <mbox files>
```

A series not yet sent is private: `--review` sends it, with its context,
to the endpoint, so choose one whose data terms you accept.

#### How model review works

Model review adds layers 2 to 4 of [`designs/PHASE3.md`](designs/PHASE3.md)
after the checks. Each step after layer 3 only removes model findings, and
none of them changes the checks' result:

```mermaid
flowchart TD
mail["Series from the list<br/>(untrusted)"] --> l1
l1["Layer 1: deterministic checks<br/>patchtest, oelint-adv, shellcheck, ..."] --> l2
l2["Layer 2: context, in the no-network container<br/>files touched, require/inherit, git grep"] --> docs
docs["Docs for what the patch changes<br/>glossary, classes, task flags, bitbake.conf values"] --> l3
l3["Layer 3: one model call per patch<br/>guides, JSON schema, quoted evidence"] --> val
val{"Validation<br/>file and line in the request?<br/>evidence quoted word for word?<br/>confidence, not a layer-1 repeat?"} -->|kept| check
val -->|dropped| log[("dropped, with the reason")]
val -->|kept, verify off| report
check{"Check pass (verify = true)<br/>review rules,<br/>read-only git grep/show/log,<br/>upstream source"} -->|confirmed with a quote| report
check -->|refuted| log
l3 -.->|risky patch or low confidence| l4["Layer 4: escalation (draft)<br/>larger model with read-only git tools"]
l4 -.-> val
report["Report: model findings apart,<br/>marked unverified, never in the result"] --> score
score["Scoring against what the lists decided<br/>later revisions, Fixes: commits"]
rules[("Review rules<br/>plugins/bodnuti/skills/yocto-review-rules")] --> check
rules -.-> l4
rules --> plugin["Claude Code skill<br/>same Markdown files"]
```

- **Layer 2** gathers context with no network and under a size cap: the
files a patch touches, what they `require` and `inherit`, where the names
it changes are used, and with `docs` the documentation and the
`bitbake.conf` value of each variable, class and task flag it changes. With `BODNUTI_BITBAKE`
naming a BitBake checkout, BitBake parses the recipes it touches before
and after it, in a sandbox, and the request carries their final values.
- **Layer 3** reviews the patch with sashiko's Yocto guides, its
false-positive guide and severity scale (`guides`), not the review rules:
with the rules in the request, local models checked patch headers field
by field and stopped reading the code.
- **The check pass** (`verify = true`) asks the model once more about each
finding, with the review rules and read-only tools: git on the tree after
the patch, and the upstream source of a recipe at its version, which
bodnuti fetches from the recipe's own SRC_URI and checksum. A finding is
shown only when the model confirms it with a line it quotes from the
patch, its context or a tool's output.
- **Layer 4** (`[review.escalate]`) sends risky patches to a larger model
with the review rules and the same tools. It is a draft; on eight logic
patches it found nothing the check pass had not
([`designs/PHASE4.md`](designs/PHASE4.md) §0.1).
- **The review rules** are Markdown files condensed from maintainers'
inline review on the lists, built into bodnuti; a `rules/` directory in
`guides` replaces them. The same files are the Claude Code skill
`yocto-review-rules`, so any assistant reviewing or writing a recipe can
read them.

A finding never changes the exit status or the result. Training a model
instead was tried and stopped
([`designs/TRAINING.md`](designs/TRAINING.md) §8).

#### Hosting the model yourself

Any OpenAI-compatible server works; these steps use
[ollama](https://ollama.com) on one GPU.

1. **The model must fit in GPU memory, context included.** A model that
spills layers to the CPU runs five to ten times slower. After the first
request, `ollama ps` must say `100% GPU`.
2. **Pick a quantization that leaves room for the context.** On a 16 GB
card, Qwen3.8-27B at 4 bits with a 48k context fits, text only; the
default 4-bit builds of 26B to 27B models (17 to 18 GB) with their
vision projector do not.
3. **Make the model** from
[`config/review/qwen3.8-27b.Modelfile`](config/review/qwen3.8-27b.Modelfile):
`ollama create bodnuti-qwen3.8-27b-48k-text -f config/review/qwen3.8-27b.Modelfile`.
4. **Point bodnuti at it** with
[`config/review/qwen3.8-local.toml`](config/review/qwen3.8-local.toml),
or copy its `[review]` table into `watch.toml`.

Leave `temperature` unset: the model's own setting applies, and
reasoning models loop under greedy decoding (temperature 0). `seed`
fixes the draw, so the same request gets the same answer and a run
can be repeated; one pass is all there is. Qwen3.8 reads its
reasoning level from a line before the system prompt, which Ollama
does not write: set it with `system_prefix`. `context_tokens` must
match the server: bodnuti leaves out the context a request needs
least until it fits with room for `max_tokens`. If reasoning uses up
`max_tokens`, bodnuti asks once more without reasoning.
5. **Build the docs index** from yocto-docs, bitbake and openembedded-core
checkouts:
`python3 bench/phase3/docs_index.py --yocto-docs … --bitbake … --oe-core … --out ~/docs-index.json`.

What to expect, measured on 30 November 2026 with Qwen3.8 on a 16 GB
GPU: about 21 minutes a patch, 16 to find and 5 to check; on a judge
set of 14 findings with known truth the check pass refuted all 10
false ones.

`bodnuti poll` and `bodnuti publish` are the watcher's commands; see
[`docs/DEPLOY.md`](docs/DEPLOY.md).

Expand Down
90 changes: 90 additions & 0 deletions assets/bitbake_values.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Final variable values of a few recipes, for bodnuti's review context
# (designs/PHASE4.md §10). Run by src/bitbake.rs in a sandbox: the recipes
# come from a patch, and parsing them runs their Python.
#
# stdin: {"bitbake": dir, "build": dir, "tree": dir, "layers": [dir],
# "recipes": [path], "names": [variable], "features": [feature]}
# Each recipe is parsed again without each of "features" in
# DISTRO_FEATURES, and without all of them: variant "without x11".
# stdout, last line: "BODNUTI-JSON: " + {"values": {path: {variant: {name:
# value}}}, "errors": {path: message}}
import json
import os
import sys

req = json.load(sys.stdin)
sys.path.insert(0, os.path.join(req["bitbake"], "lib"))
build = req["build"]
os.makedirs(os.path.join(build, "conf"), exist_ok=True)
with open(os.path.join(build, "conf", "bblayers.conf"), "w") as f:
f.write('BBPATH = "${TOPDIR}"\nBBLAYERS = "%s"\n' % " ".join(req["layers"]))
with open(os.path.join(build, "conf", "local.conf"), "w") as f:
# Parsing needs no host tools; the check container has none of gcc,
# make or patch, and BitBake would refuse to start without them.
f.write('MACHINE = "qemux86-64"\nINHERIT:remove = "sanity"\nBB_NO_NETWORK = "1"\n'
'HOSTTOOLS:forcevariable = ""\nHOSTTOOLS_NONFATAL:forcevariable = ""\n')
os.chdir(build)

import bb.data # noqa: E402
import bb.parse # noqa: E402
import bb.tinfoil # noqa: E402

out = {"values": {}, "errors": {}}


def same_before_and_after(v):
# The build and the worktree are temporary directories, different
# before and after the patch; name them, so only real changes differ.
if v is None:
return None
return v.replace(build, "${TOPDIR}").replace(req["tree"], "${LAYER}")


def first_line(e):
lines = [l for l in str(e).splitlines() if l.strip()]
return (lines[-1] if lines else type(e).__name__)[:300]


try:
with bb.tinfoil.Tinfoil(tracking=False) as t:
t.prepare(config_only=True, quiet=2)
for path in req["recipes"]:
variants = {}
try:
d = t.parse_recipe_file(path, appends=False)
todo = [("target", d)]
extend = (d.getVar("BBCLASSEXTEND") or "").split()
for v in [v for v in ("native", "nativesdk") if v in extend]:
todo.append((v, t.parse_recipe_file("virtual:%s:%s" % (v, path), appends=False)))
for v, dv in todo:
variants[v] = {n: same_before_and_after(dv.getVar(dv.expand(n))) for n in req["names"]}
# A combination left out: the recipe without the distro
# features it tests for, one at a time and all together.
# The recipe's own DISTRO_FEATURES: the configuration's
# plus the backfilled ones (opengl, wayland, vulkan...).
base = (t.config_data.getVar("DISTRO_FEATURES") or "").split()
have = (d.getVar("DISTRO_FEATURES") or "").split()
present = [f for f in req.get("features", []) if f in have]
# One at a time, two at a time (vulkan without x11 and
# wayland), and all together.
drops = [[f] for f in present]
drops += [[a, b] for i, a in enumerate(present) for b in present[i + 1:]]
if len(present) > 2:
drops.append(present)
for drop in drops:
name = "without " + " ".join(drop)
cd = bb.data.createCopy(t.config_data)
cd.setVar("DISTRO_FEATURES", " ".join(f for f in base if f not in drop))
# A backfilled feature is dropped by naming it here.
cd.appendVar("DISTRO_FEATURES_BACKFILL_CONSIDERED", " " + " ".join(drop))
try:
dv = t.parse_recipe_file(path, appends=False, config_data=cd)
variants[name] = {n: same_before_and_after(dv.getVar(dv.expand(n))) for n in req["names"]}
except bb.parse.SkipRecipe as e:
variants[name] = {"__skipped__": first_line(e)}
out["values"][path] = variants
except Exception as e: # a recipe that does not parse is a finding
out["errors"][path] = first_line(e)
except Exception as e: # the configuration itself did not parse
out["errors"][""] = first_line(e)
print("BODNUTI-JSON: " + json.dumps(out))
Empty file.
Loading