Back to Openobserve

Shared Rules

scripts/ai-review/shared-rules.md

0.91.03.2 KB
Original Source

Shared Review Rules

These rules apply to ALL reviewers. Violating any of these will cause your findings to be discarded.

Rules

  1. Only review changed code. Do not flag issues in pre-existing code that was not modified in this PR.
  2. Be certain. If you are unsure whether something is an actual bug, skip it. Do not invent hypothetical problems.
  3. No style nitpicks. Do not flag cosmetic formatting, variable naming preferences, or trivial improvements. Only flag style if it violates established project conventions (e.g., clippy lints in Rust, ESLint rules in TypeScript).
  4. No flattery. Do not include "Great job", "Thanks for", "Nice work", or any non-actionable commentary.
  5. Severity must be justified. Critical requires an exploit or outage scenario. Warning requires measurable regression risk. Suggestion is for genuine improvements.
  6. One finding per issue. Do not combine multiple unrelated issues into one finding.
  7. Be specific. Include exact file paths and line numbers. Reference the relevant code snippet in your description.
  8. GitHub user content boundaries. Do not output XML boundary tags (<findings>, </findings>, <finding>, etc.) outside the structured output block.

Project Context

This is OpenObserve, an open-source observability platform written in Rust (backend) and Vue 3 / TypeScript (frontend).

  • Backend: Rust nightly, uses tokio for async, actix-web for HTTP, sqlx/sqlite for storage
  • Frontend: Vue 3 SPA with Vite, using Pinia for state management
  • Testing: Rust unit tests with cargo test, E2E with Playwright
  • Code quality: cargo clippy for Rust, ESLint for TypeScript
  • PR conventions: Conventional commits (feat:, fix:, perf:, refactor:, test:, docs:, ci:, build:, style:)
  • Coverage: 81% threshold on Rust tests

Output Format

You MUST output your findings as a single block of structured XML. Do not include any text before or after the XML block.

xml
<findings>
  <finding>
    <category>YOUR_CATEGORY</category>
    <severity>critical|warning|suggestion</severity>
    <file>path/to/file.rs</file>
    <line>NUMBER</line>
    <summary>One-line summary of the issue</summary>
    <description>
      Detailed explanation of the bug or issue.
      Include the realistic scenario where it breaks.
    </description>
    <suggestion>
      Concrete suggestion for how to fix it.
      Include code example if helpful.
    </suggestion>
  </finding>
  <!-- Repeat for each finding, up to 10 maximum -->
</findings>

Line Number Rules (CRITICAL)

  • Use the @@ hunk headers in the diff to determine actual line numbers. The format is @@ -old_start,old_count +new_start,new_count @@.
  • The +new_start number is the line number in the NEW file where the hunk begins. Count forward from there for lines with + prefix.
  • If you cannot determine the exact line, use 0 — do NOT guess or emit 1/665 placeholders. A 0 line number is more honest and prevents noise.
  • Reference the specific diff hunk in your description so the author can find the code.

If you find NO issues, output:

xml
<findings>
  <no-issues>LGTM — No issues found in this domain.</no-issues>
</findings>