Expand description
The code-quality system prompt for one language.
The prompt is the bridge between the deterministic layer (the configured
linters and formatters) and the semantic layer (the LLM): it tells the
model what drep has already done and what is left for it to do. The body
is identical for every language; only display_name and conventions
vary, so the JSON shape the model is asked to return is never language-
dependent and the parser in crate::analysis::code_quality stays total.
Two instructions are load-bearing and must survive untouched:
- The “do not report anything a formatter or linter would catch” line. The deterministic layer already produces those findings, and without this guard the model floods every file with lint noise that the gate then has to deduplicate against the tooling’s own output.
- The schema block. A model that emits a different shape is, from the parser’s point of view, an unanalyzed file — the parser does not attempt to recover a foreign schema.
Every payload line carries its real file line number in the gutter, and a
finding must not be reported on a line that has no number. Together with
crate::analysis::payload::Payload::valid_lines they are the line-
number provenance the parser relies on to drop findings that point at
code the model was never shown.
Functions§
- build_
analysis_ prompt - Build the code-quality system prompt for one language.