Build a SEI CERT review packet
build_review_packetBuilds code-hunk review packets with candidate SEI CERT rules for issues analyzers cannot decide, letting you judge each hunk and send findings to validate_findings.
Instructions
Build a packet for reviewing code against SEI CERT rules that analyzers cannot decide: code hunks, each with up to max_rules_per_hunk candidate rules (picked by token/API heuristics and profile idioms, rules fully covered by a specific checker left out) and their text excerpts. Diff mode (repo plus base or diff_text): changed lines with 3 lines of context. Path mode (path): whole files. Hunks are cut into 60-line windows. Use after check_diff or check_files; judge each hunk, then send your findings to validate_findings. Read-only; run_static=true also runs the analyzers (same cost as check_diff/check_files) to mark lines already reported. Output is large, roughly 5-25 KB per hunk.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "build_review_packet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Diff mode: base git ref; required with repo unless diff_text is given. | |
| head | No | Diff mode: head git ref; omit for the working tree. | |
| path | No | Path mode: absolute path of a file or directory. Ignored when diff mode applies. | |
| repo | No | Diff mode: absolute path of the git checkout. | |
| 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) or an absolute path to a profile .yaml file. | default |
| diff_text | No | Diff mode: unified diff text, paths relative to repo. | |
| run_static | No | Also run the analyzers and list their findings per hunk so they are not repeated. Set false if you already ran check_diff/check_files. | |
| max_rules_per_hunk | No | Candidate rules per hunk. Omit to use the profile's value (6 in both bundled profiles). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hunks | Yes | file (absolute), start_line, end_line, code (line-numbered), idioms[] {id, hint}, candidate_rules[] {rule_id, title, tier, matched, severity, priority, level, profile_note, text (<= 3500 chars), url}, existing_findings[] {rule_id, line, checker}. | |
| profile | Yes | ||
| instructions | Yes | How to review the hunks and what makes a finding acceptable. | |
| rule_database | Yes | Commit of the bundled rule database. | |
| skipped_hunks | Yes | [file, start_line, end_line] of hunks with no candidate rule. | |
| finding_schema | Yes | Fields each finding must have: rule_id, file, line, message, quote; optional severity, fix, confidence. | |
| static_findings | Yes | Analyzer findings for the same scope; [] when run_static=false. |