Skip to content

QA synthesis rules

Consolidates the findings of every other agent into one report, removing duplicates and false positives, ranking what is left and giving a verdict.

  • Agent id: qa_synthesis
  • Rules: 14 (source: qa_synthesis.yaml)
  • Deterministic checks: none

QA-001: Confirm every check finding before keeping it

  • Severity: info
  • Languages: all

Treat findings with source set to check as pattern matches, not confirmed defects. Open the file at the reported line and keep the finding only if the code really does what the rule describes; drop it otherwise and count it as a false positive in the summary. After confirming, set the finding to the rule's severity.

QA-002: Merge duplicates and shared root causes

  • Severity: info
  • Languages: all

Merge findings with the same file, line and rule into one. Then merge findings from different agents that describe the same root cause at the same place (a hardcoded key flagged by security and data_privacy, a complex function flagged by metrics and code_quality): keep the most specific rule id, the highest severity, and mention the other agents in the message. Known overlaps are duplication (ARC-006, CQ-007, MET-006), validation (API-013, TYP-007, TYP-002), TLS (SEC-015, PRIV-006) and shared state (ARC-007, CQ-016).

QA-003: Rule out common false positives

  • Severity: info
  • Languages: all

Drop findings in test fixtures, examples, documentation, vendored or generated code, and lockfiles, unless the rule is about those files or the code ships to production. Drop secrets that are placeholders or read from the environment, PII patterns that match version numbers, dates or sample data, and SQL built only from constants.

QA-004: Adjust severity to reachability and exposure

  • Severity: info
  • Languages: all

Lower a finding by one level when the code cannot be reached from outside input (dead code, an internal script, a test helper) and raise it by one level when the code sits on a public endpoint, handles money, or touches personal data. Write the reason for any change in the message, and never lower a confirmed leaked secret below critical. Do not apply the personal-data raise to data_privacy rules or the public-endpoint raise to api_contract rules: their severity already assumes it.

QA-005: Separate new findings from existing debt

  • Severity: info
  • Languages: all

When the review scope is a diff, mark whether each finding is on a line the change added or modified, or on untouched code nearby. Lead with findings the change introduced; list pre-existing issues after them, and do not let pre-existing issues alone block the change unless they are critical.

QA-006: Order the report by severity then impact

  • Severity: info
  • Languages: all

Present findings sorted by severity (critical, high, medium, low, info), then by file. Within the same severity, put exploitable security and data-loss issues before correctness bugs, and correctness bugs before maintainability debt.

QA-007: Require evidence on every finding

  • Severity: info
  • Languages: all

Keep a finding only if it names a file, a line when one applies, and a short evidence excerpt, and if its message says what is wrong and how to fix it in one or two sentences. Rewrite vague findings ("improve error handling") into a concrete change or drop them. Mask secrets in every excerpt, leaving at most the first four characters visible.

QA-008: Report only real problems

  • Severity: info
  • Languages: all

Leave out style preferences the project's formatter or linter already enforces, and suggestions that would only rename, reorder or rephrase working code. Keep a low finding only when it records concrete debt someone could act on.

QA-009: Use the computed score without inventing another

  • Severity: info
  • Languages: all

Quote the 0 to 100 score synthesize_report returns, and explain it by the counts that produced it (critical 15, high 8, medium 3, low 1 point each subtracted from 100). Do not compute a different score, weight categories again, or round it to a letter grade. Call synthesize_report only after QA-001 to QA-004, on the cleaned list with adjusted severities, and call it again if you drop or change a finding. The score stops at 0 and is not scaled to code size: do not compare scopes of different sizes.

QA-010: Verdict wording

  • Severity: info
  • Languages: all

End with exactly one verdict, treating every finding as introduced when the scope is not a diff. Request changes when a critical or high finding remains on code the change introduced, or a critical remains anywhere in scope. Approve with comments when what remains is medium or lower, or high on untouched code. Approve when nothing remains after false positives are removed, and say that plainly instead of inventing minor issues.

QA-011: Say what was not reviewed

  • Severity: info
  • Languages: all

List the agents that did not run, the files that were skipped or truncated, and any check that returned an error (for example an OSV lookup failure), so the reader does not take silence for a clean result. Use the truncated flags and errors lists from the tool results.

QA-012: Give a short prioritized action list

  • Severity: info
  • Languages: all

After the findings, give at most five next actions in order, each tied to one or more rule ids and files, starting with what blocks the change. Group fixes that touch the same function into one action.

QA-013: Note what the change does well

  • Severity: info
  • Languages: all

When the review covers a change, add one to three specific strengths (a test that pins the fixed bug, a removed duplicate, validation moved to the boundary). Skip this section when there is nothing specific to say rather than writing generic praise.

QA-014: Keep assistant findings in the same schema

  • Severity: info
  • Languages: all

Record findings you raise yourself while reading code as Finding objects with source set to assistant, a rule id from get_rules when one fits, and the same severity scale, then pass them to synthesize_report together with the check findings. Do not report findings only in prose where the synthesis cannot count or deduplicate them.