LEVEL 2 · BUILDER

PR Review Reporter

A local patch-review artifact that preserves Git line evidence and can enter CI as SARIF. Use --diff - for stdin, --repo /path --base REF --head REF for a read-only Git diff, or --candidates recorded-findings.json to validate another reviewer's findings against the supplied patch.

4 stages~8 hoursPython, TypeScriptcore
Recover new-file line numbersGenerate narrow review candidatesVerify and merge findingsPublish a local escaped report
YOU END UP WITH

A local patch-review artifact that preserves Git line evidence and can enter CI as SARIF.

USEFUL FOR
  • Use --diff - for stdin, --repo /path --base REF --head REF for a read-only Git diff, or --candidates recorded-findings.json to validate another reviewer's findings against the supplied patch.
LEARN FIRST
  • Node 22.18+, Python 3 and Git only for --repo mode
  • unified diff counters, JSON, exact source quotes and HTML escaping.
PROJECT OUTLINE

PR Review Reporter in 4 stages

A local patch-review artifact that preserves Git line evidence and can enter CI as SARIF.

  1. Recover new-file line numbers

    Parse hunk headers into old and new counters. Context consumes both counters, deletions consume only the old counter, and additions consume the new counter while producing a reviewable location. Reject truncated hunks and parent-traversing paths. The parser is deliberately for text unified diffs; binary patches and combined merge diffs are outside the contract. Wire Python into TypeScript using execFileSync and stdin, never an interpolated shell command.

    starter · ~2 hours · TypeScript

    parseDiff
  2. Generate narrow review candidates

    Build explicit static detectors for dynamic eval, shell exec, disabled TLS validation and empty catch handlers. Inspect only added lines. These patterns produce review candidates rather than proof of exploitable behavior. Keeping rule ids stable makes deduplication possible when a later model reviewer reports the same concern.

    core · ~2 hours · TypeScript

    inspect
  3. Verify and merge findings

    Require an existing added-line location and a nonempty exact source substring for every candidate. Reject fabricated files, deleted-line locations, empty quotes and invalid severity values. Merge findings by file, line and rule; keep the stronger severity when reviewers disagree. The quote gate establishes location support, not the truth of a security claim, which still needs review.

    core · ~2 hours · TypeScript

    verifymerge
  4. Publish a local escaped report

    Render a self-contained report with source locations, quoted evidence, severity and message. Escape source text as carefully as prose: a diff can contain executable HTML. Keep external publication outside the tool. The CLI writes review.html locally and prints a machine-readable summary for automation.

    core · ~2 hours · TypeScript

    escapeHTMLrender

All projects · Course catalog · Source on GitHub