From 788985814efa8aeaa83346e70d166d6e67f0d111 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Fri, 12 Jun 2026 11:30:20 -0700 Subject: [PATCH 1/2] test: reviewbot unified-review demo (throwaway) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A scratch fixture (outside build/test/coverage) with two latent, type-clean issues — an unguarded divide-by-zero in mean() and parsePort() missing a radix plus a falsy-zero default — to verify reviewbot's unified CodeRabbit-style review (one thread + committable suggestions + consolidated AI-fix prompt). Will be closed. --- scratch/reviewbot-unified-demo.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scratch/reviewbot-unified-demo.ts diff --git a/scratch/reviewbot-unified-demo.ts b/scratch/reviewbot-unified-demo.ts new file mode 100644 index 0000000000..1eb8eb726a --- /dev/null +++ b/scratch/reviewbot-unified-demo.ts @@ -0,0 +1,13 @@ +// Throwaway fixture to verify reviewbot's unified CodeRabbit-style review (one thread: summary body + +// inline committable suggestions + a consolidated "Prompt for AI agents"). Lives in scratch/ — outside +// the build, typecheck, test, and coverage scope — so it cannot affect CI. Safe to delete. + +/** Return the average of the numbers. */ +export function mean(values: number[]): number { + return values.reduce((a, b) => a + b, 0) / values.length; +} + +/** Parse a port number from a string, defaulting to 8080. */ +export function parsePort(raw: string): number { + return parseInt(raw) || 8080; +} From c64b367accca6afe2e7eb754fe053eb24515a6a6 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Fri, 12 Jun 2026 11:39:10 -0700 Subject: [PATCH 2/2] test: clearer findings for unified-review demo Drop the throwaway framing + add three latent issues (clampPercent missing the lower bound, average's empty-array NaN, parsePort missing radix + falsy-zero) so the reviewer surfaces inline findings + the consolidated AI-fix prompt. --- scratch/reviewbot-unified-demo.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scratch/reviewbot-unified-demo.ts b/scratch/reviewbot-unified-demo.ts index 1eb8eb726a..ad9e513fee 100644 --- a/scratch/reviewbot-unified-demo.ts +++ b/scratch/reviewbot-unified-demo.ts @@ -1,9 +1,15 @@ -// Throwaway fixture to verify reviewbot's unified CodeRabbit-style review (one thread: summary body + -// inline committable suggestions + a consolidated "Prompt for AI agents"). Lives in scratch/ — outside -// the build, typecheck, test, and coverage scope — so it cannot affect CI. Safe to delete. +// Small numeric helpers. + +/** Clamp a percentage into the 0–100 range. */ +export function clampPercent(value: number): number { + if (value > 100) { + return 100; + } + return value; +} /** Return the average of the numbers. */ -export function mean(values: number[]): number { +export function average(values: number[]): number { return values.reduce((a, b) => a + b, 0) / values.length; }