Review a PR change (static + hints + draft comment)
review_prGenerates a single Markdown PR review comment by diffing base..head, collecting analyzer hints and style/functional findings, and formatting them without posting.
Instructions
Run check_diff on base..head, build_review_packet for heuristic hints, and format_pr_review into one markdown comment (static table, candidate rules, idioms, style nits, functional bullets). Does not post. Prefer this over three separate calls. profile ceph auto-builds synthetic compdb when needed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo": "<repo>",
"base": "<base>"
},
"name": "review_pr"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base git ref (merge-base or target branch SHA). | |
| head | No | Head ref (PR branch). Default: working tree. | |
| repo | Yes | Absolute path of the git checkout. | |
| scope | No | Optional scope line; auto-generated when omitted. | |
| title | No | PR title for the comment heading. | |
| tools | No | Analyzers to run; omit for the default set: clang-tidy, clangsa and cppcheck plus semgrep and infer when installed. clang-tidy = cert-*/bugprone checks plus Clang Static Analyzer checks; clangsa = standalone `clang --analyze` (adds alpha checkers); cppcheck = cppcheck; semgrep = the bundled CERT pattern rules; infer = Infer (null, leak, use-after-free, overflow, race); codeql = the CodeQL CERT query packs, opt-in because each run builds a database (tens of seconds or more). A requested analyzer that is not installed is skipped and listed in `warnings`. | |
| compdb | No | Absolute path of the directory that contains compile_commands.json. Strongly recommended: without it files are compiled with guessed flags and often fail to parse. Omitted: auto-detected in root, root/build or root/build-clang. | |
| profile | No | Review profile: 'default' (plain SEI CERT), 'ceph' (Ceph severities, suppressions and idioms), 'misra' (MISRA C:2012 + MISRA C++:2023), 'autosar' (AUTOSAR C++14) or an absolute path to a profile .yaml file. | ceph |
| standards | No | Standards to map findings to, overriding the profile's `standards` (default profile: cert). misra-c-2012 applies to .c files (adds the cppcheck MISRA addon); misra-cpp-2023 and autosar-cpp14 to C++ files. Example: ["cert", "misra"]. | |
| diff_context | No | Omit to use profile default (ceph: 3). | |
| baseline_path | No | Absolute path of a baseline JSON written by `cert-review baseline create`. Findings recorded there are left out and counted in `baseline`; file paths in it are relative to its directory. Matching uses rule, file and hashes of the code line and its neighbours, so line shifts do not resurface old findings. Omit to report everything. | |
| github_footer | No | Append collapsible footer: pull_request_target, mcp, github-action. Omit when drafting for manual paste. | |
| min_confidence | No | Drop findings below this confidence. Rule-specific checkers score 0.9, general checkers 0.3-0.65, +0.1 when two tools agree. 0.5 keeps most real hits. | |
| functional_notes | No | Extra functional bullets for the comment. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||