r/codereview • • 32m ago

I built an MCP server that makes Claude check whether anyone understands the code before it edits it

Thumbnail gallery
1 Upvotes

r/codereview • • 2h ago

Just because I'm curious

1 Upvotes

First I have no intention of bricking my Nook Glowlight 3 and actually trying this bash script suggested by Brave AI. Now that that is it of the way, I'm planning on rooting said EReader so I can install a custom launcher and all that. While figuring out the steps I needed to take the Brave Assistant kept trying to help, so I thought I would see if it could write a script that would auto complete the rooting process and to my surprise it came back with...

#!/bin/bash

set -e

clear

echo "=== Nook GlowLight 3 Root Script ==="

echo "1. Enable USB Debugging on the Nook first."

echo "2. Plug it in and authorize when prompted."

echo "3. Press Enter when ready..."

read -p " > "

--- Install ADB if missing ---

if ! command -v adb &>/dev/null; then

echo "Installing ADB..."

sudo apt update -qq

sudo apt install -y android-tools-adb

fi

--- udev rule ---

RULE='SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"'

if ! grep -q "2080" /etc/udev/rules.d/51-android.rules 2>/dev/null; then

echo "$RULE" | sudo tee /etc/udev/rules.d/51-android.rules

sudo udevadm control --reload-rules

echo "Udev rule added. Unplug & replug the Nook, then press Enter."

read -p " > "

fi

--- Wait for device ---

echo "Waiting for device..."

adb wait-for-device

DEV=$(adb devices | grep -w "device" | head -1 | awk '{print $1}')

if [ -z "$DEV" ]; then

echo "ERROR: Nook not detected. Check cable/port."

exit 1

fi

echo "Device found: $DEV"

--- Download & patch root script ---

cd /tmp

if [ ! -d "rooting-nook-glowlight" ]; then

git clone https://github.com/wmahfoudh/rooting-nook-glowlight.git

fi

cd rooting-nook-glowlight

Remove model-number check (the critical fix)

sed -i '/BNRV510/d' rootnook.sh

sed -i '/BNRV520/d' rootnook.sh

Comment out the if-block that tests model

sed -i 's/^if.model./# &/' rootnook.sh

chmod +x rootnook.sh

--- Run root ---

echo "Starting root..."

./rootnook.sh

--- Boot animation fix ---

read -p "Root complete. Fix boot animation bug? [Y/n] " ans

if [[ "$ans" != [Nn]* ]]; then

echo "Rebooting Nook and removing bootanimation..."

adb reboot

adb wait-for-device

adb shell "su -c 'mount -o remount,rw /system && mv /system/bin/bootanimation /system/bin/bootanimation.bak'"

adb reboot

echo "Done. Nook is rooted."

else

echo "Skipping boot animation fix."

fi

So I'm genuinely curious if this would auto complete the root?


r/codereview • • 13h ago

Code review: claiming a filesystem lock for an npm module installer

1 Upvotes

I maintain create-tigra, an MIT npm generator, and would appreciate a focused review of its optional-module installer. Two CLI processes must not modify the same project at once. The installer writes an owner file into a candidate directory before renaming the nonempty directory into the lock location.

Excerpt from lib/installer-transaction.js:

await writeFile(path.join(candidate, mine), '', { flag: 'wx', mode: 0o600 });
const lock = await projectPath(root, INSTALL_STATE, 'directory');
if (!lock.stat) {
  try {
    await rename(candidate, lock.file);
    return lock.file;
  } catch (error) {
    if (!(await projectPath(root, INSTALL_STATE, 'directory')).stat) throw error;
  }
}

The full function then inspects the owner PID and attempts recovery only for a dead owner, claiming its unique filename with another rename.

What concurrent interleaving would you test first? Are there platform-specific rename or process-liveness assumptions that should be made explicit? What would you simplify while preserving crash recovery?

Suggestions, honest feedback, and a roast of the code are welcome. The repository documents known dependency advisories separately; I am asking about this locking/recovery boundary, not asserting that passing tests proves it safe.


r/codereview • • 1d ago

I built a CLI that catches green CI runs where zero tests ran

0 Upvotes

r/codereview • • 1d ago

javascript Review my verdict logic: when should a verification check be allowed to block a merge?

2 Upvotes

Context, honestly stated: I'm the founder of a small dev-tool (SolveLang) and this is the verdict module from the GitHub check we just shipped to production. It decides whether a pull request gets a red or green verification check. I'm posting the code for review, not pitching — no links. I want the design attacked.

The check grades evidence about a PR (policy evaluation, the head's own CI state, required checks) into verified / failed / unverified. This module turns that into a blocking decision. The design rule I started from: only *failed* evidence may block — "unverified" means "not established," and blocking on it would block nearly every PR.

```js

// What blocks (each is a *failed* evidence state, never a mere

// unverified one):

// 1. the PR Gate policy evaluation failed;

// 2. the PR Gate route failed or did not run (blast-radius evidence

// unusable — the receipt records the route as a failed finding);

// 3. the head's own CI has failing or timed-out check runs;

// 4. a config-named required check is absent, unfinished, or not

// successful on the head.

export function computeBlocking({ gateRoute, checkRuns, requiredChecks, ownCheckName }) {

const reasons = [];

if (gateRoute?.status === "failed") {

reasons.push(

"PR Gate route failed — blast-radius and policy evidence is unusable (the receipt records this as a failed finding)."

);

} else if (gateRoute?.status === "not-run") {

reasons.push("PR Gate route was not run — blast-radius evidence was not produced.");

} else if (gateRoute?.status === "ran") {

const summary = gateRoute.summary;

const failedRules = (summary?.policyVerdicts ?? [])

.filter((verdict) => verdict.status === "fail")

.map((verdict) => verdict.rule);

if (summary && summary.policyPassed === false && failedRules.length > 0) {

reasons.push(`PR Gate policy failed: ${failedRules.join(", ")}.`);

}

if (summary && summary.integrityVerified === false) {

reasons.push("Solve Graph integrity did not verify — the blast-radius output is not relied on.");

}

}

const others = (checkRuns ?? []).filter((run) => run.name !== ownCheckName);

const failing = others.filter(

(run) => run.conclusion === "failure" || run.conclusion === "timed_out"

);

if (failing.length > 0) {

reasons.push(

`Head CI has failing check run(s): ${failing.map((run) => `${run.name} (${run.conclusion})`).join(", ")}.`

);

}

for (const name of requiredChecks ?? []) {

const run = others.find((candidate) => candidate.name === name);

if (!run) {

reasons.push(`Required check not present on the head: ${name}.`);

} else if (run.status !== "completed") {

reasons.push(`Required check not completed: ${name} (${run.status}).`);

} else if (run.conclusion !== "success") {

reasons.push(`Required check not successful: ${name} (${run.conclusion ?? "no conclusion"}).`);

}

}

return { blocked: reasons.length > 0, reasons };

}

```

Three decisions I specifically want challenged:

  1. **Case 2 bothers me.** If *our* gate route fails to run, the PR blocks in enforce mode — that's the author's PR going red because our tool broke, not because their code failed. I kept it because silently passing when evidence is missing felt dishonest. Is fail-closed right here, or should tool failure be neutral-with-a-loud-warning?
  2. **In report-only mode the check concludes "success" even when blocking evidence exists** (the title and summary state the evidence plainly). That mirrors how our PR Gate Action behaves, but is a green check with "blocking evidence found" in the title honest — or is it exactly the kind of green-washing that makes people distrust checks?
  3. **A malformed repo config falls back to defaults (report-only) and just says so in the summary.** A typo can silently downgrade a team's enforce mode to advisory. Should config defects themselves block?

Roast away — especially if the whole "only failed evidence blocks" premise is wrong.


r/codereview • • 1d ago

PostgreSQL persistent task queue: concurrency, idempotency and restart recovery

1 Upvotes

Hello everyone,

I'm extending an existing Python application that uses PostgreSQL and Supabase for multichain blockchain research.

We have implemented an offline candidate queue with duplicate prevention, retry limits, expiration and restart recovery.

During testing, we identified a potential issue where a stale processing result could affect a newly queued instance of the same candidate.

I would appreciate technical guidance on:

  • Using FOR UPDATE SKIP LOCKED for concurrent processing.
  • Preventing stale worker results through unique claim identifiers.
  • Maintaining idempotency and reliable restart recovery.
  • Choosing appropriate indexes and expiration strategies.

Would a dedicated PostgreSQL queue table be the recommended approach?

Any technical feedback or suggestions would be appreciated. Thank you.


r/codereview • • 1d ago

ts/react: would you review the danger rules on my tribe-card urgency strip?

2 Upvotes

looking for eyes on one ui piece of my open source civ sim (react on top of a rust/wasm worker). this is not the rust action-registry post i made here in october.

when a tribe is in danger, its card grows a strip: a cause (famine, thirst, war, plague, or "in danger"), a body count like "lost 7 of 31 this season", a shrinking bar for the share still alive, and a trend arrow. the rust sim didn't change. the widget reads fields the frame already had (losses this season, who's in peril, food).

danger means any one of: the tribe is marked in peril, average food is under the famine-risk line (0.3), anyone starved this season, or at least 2 deaths and 10% of the tribe from causes other than old age. calm tribes, and tribes only losing elders, stay clean. the strip holds for a day (600 ticks) after the danger lapses, so a tribe on the line doesn't blink. the arrow compares against the body count from about a day ago, because comparing raw population flipped whenever migrants arrived. prefers-reduced-motion turns the transitions and the pulse off.

tests live next to the code, named in PR 1142: game/model/tribe-urgency.test.ts (the rules) and ui/panels/TribeUrgency.test.tsx (the rendering). please confirm those paths on main before reviewing.

what i'd like opinions on:

  • is that priority for picking a "kind" (peril cause, then low food / starvation, then the worst violent cause) sane, or would you flatten it?
  • is a one-day hold the right way to stop blinking, or would you rather fade it or latch until the next season?
  • any smell in keeping this entirely on the ui side so the sim and the save fingerprint stay untouched?

repo (mit): https://github.com/1homsi/thehumanbox/pull/1142 running build if you want context: https://thehumanbox.com/?utm_source=reddit&utm_medium=social&utm_campaign=codereview

built with ai-assisted coding tools: they helped with parts of the code, and an ai assistant helped draft this post.


r/codereview • • 2d ago

GitHub - Vibernt/cupel: Know which tests protect you. CLI and MCP for people and coding agents.

Thumbnail github.com
0 Upvotes

I've been building Cupel in the open: it runs your own tests, records which lines each test runs, plants small faults and reports which tests notice. From that it guards pull requests, audits suites and gives agents evidence. It has no dependencies, no telemetry and no network calls, and it never changes your code.

0.5.0 adds:

  • Rust builds kept between runs and shared across CI slices;
  • likely-catchers-first ordering in every runner;
  • Go and Ruby fault testing on par with the other runners;
  • a docs site and CI on Linux, macOS and Windows.

Every number in the docs says what machine it was measured on, and the release notes list what isn't verified yet.

Contributions and bug reports welcome: https://github.com/Vibernt/cupel · Docs: https://vibernt.github.io/cupel/


r/codereview • • 2d ago

I built a place to roast your rough ideas. Can you roast the app itself?

2 Upvotes

I built Roast & Toast for that awkward stage where you have an idea but don’t know what to test first.

The video example is a shared tool library for apartment buildings. One question makes the pitch immediately more useful: What happens when someone breaks the drill? Now there’s something specific to test in one building.

I’d love feedback on two things. Would you share a genuinely rough idea here? And where would you hesitate in the flow?

Try Roast & Toast


r/codereview • • 2d ago

Python Python RPG tester - constructive criticism welcomed

Post image
1 Upvotes

In the original post the github repository should be accessible, however I will still link towards it. This program is a very simple RPG as just a tester of my coding skills.

https://discord.com/channels/267624335836053506/1574896722449137816/1574896722449137816


r/codereview • • 3d ago

My second R personal project. This time it's based on nuclear energy. Hoping for some feedback. I'm fairly new(only learned R last semester)

Thumbnail github.com
1 Upvotes

r/codereview • • 3d ago

Review in Dependency Order: A Method for Large (and AI-Written) Pull Requests

Thumbnail kiransaidev.hashnode.dev
1 Upvotes

r/codereview • • 3d ago

"Claude Ship" reviews one repo at a time. How are poly-repo teams handling PRs that span repos?

Thumbnail reddit.com
0 Upvotes

r/codereview • • 3d ago

Rust Code review request : multi-tenant isolation & state handling for Telegram back-office (daybook)

2 Upvotes

I'm building Daybook in Rust—a self-hosted Telegram bot, Axum web console, SQLite layer, and MCP endpoint for selling paid-channel access, bookings, and activation codes. It's currently Alpha and not used with real customer funds yet (tracking pre-real-money items in issue #1).

I'd love a second pair of eyes on src/web/finance.rs (payout,reund) execute state handling , src/web/admin_console.rs and src/db.rs

Specifically, I'm looking for feedback on:

  1. Any subtle ways a seller/user could cross tenant or permission boundaries.
  2. Edge cases or race conditions in state transitions / async tasks.
  3. Any Rust/Axum/SQLite patterns that look overly complex or brittle.

Repo: https://github.com/meshdev26/daybook

Even a quick note on one module or pattern would be super helpful.


r/codereview • • 4d ago

T-Bot - Python validation and evidence-integrity toolkits with 141 tests, looking for code revie

Thumbnail github.com
1 Upvotes

I've been independently developing a Solana trading system since June while learning Python and software engineering with AI assistance.

I've started publishing selected standalone components for developers to inspect and challenge.

The GitHub repository currently includes:

- Four Python input validators and 57 tests.

- An evidence-integrity toolkit with 84 tests.

- A standalone educational contributor lab.

- Beginner-friendly tasks and structured review assignments.

I'm especially interested in independent developers who can identify incorrect assumptions, missing edge cases and bugs the existing tests might overlook.

The public components are available to review and improve. The operational trading application remains private.

GitHub: https://github.com/processoverprofit-sys/T-Bot

Starter tasks: https://github.com/processoverprofit-sys/T-Bot/blob/main/community/START_HERE.md

I'd appreciate any constructive technical feedback. Contributions are voluntary and unpaid.


r/codereview • • 4d ago

Building an open-source C# game engine – would love some feedback!

1 Upvotes

Hey everyone!

I've been working on an open-source 3D game engine called Auralis, written in C#/.NET, and I'd love to get some feedback from people with experience in graphics programming and game engine development!

The engine is designed to support multiple graphics APIs. I'm currently working on the OpenGL/OpenGL ES backend using Silk.NET, with Vulkan and DirectX 12 also planned as graphics backends.

Here's the pull request for the current OpenGL implementation:
https://github.com/AuralisEngine/Auralis/pull/11

I'd really appreciate it if some of you could take a look and share your thoughts!

I'm particularly interested in feedback on the architecture, graphics API abstractions, resource management, synchronization, performance, and overall code quality.

I'm still actively developing the engine, so constructive criticism and suggestions are more than welcome. I'd rather catch potential design problems early than build more features on top of a flawed foundation.

Thanks in advance to anyone willing to spend some time looking through the code. I really appreciate it! ❤️


r/codereview • • 5d ago

PhonePe Arnold: self-hosted AI code review platform for GitLab (works with self-managed instances), and support Github

Thumbnail reddit.com
0 Upvotes

r/codereview • • 5d ago

C/C++ The end of manual code review?

Thumbnail leaddev.com
0 Upvotes

JetBrains CEO gives it two years.


r/codereview • • 6d ago

I'm building an open-source research

2 Upvotes

Hi everyone,

​I'm building an open-source research and risk-intelligence platform (Python + PostgreSQL) and looking for an independent volunteer security reviewer before we move toward remote database provisioning.

​What needs review (scoped, ~30–45 min):

​Automated tests are passing, and we've put together a self-contained, reproducible review package—no production access, live credentials, or paid infrastructure required.

​Review issue & checklist: https://github.com/fervent7/ai-meme-radar/issues/4

​If you have experience hardening PostgreSQL with Python and can spare a bit of time—or can point me to someone who might—I'd really appreciate the feedback.

​Thanks!


r/codereview • • 6d ago

Seeking feedback on my niche TS code review tool(PRSense)

Thumbnail reddit.com
0 Upvotes

r/codereview • • 6d ago

Before you trust an AI code reviewer, feed it a clean PR first

Thumbnail reddit.com
0 Upvotes

r/codereview • • 7d ago

The bug that scared me most wasn't an error. It was my AI quietly "cleaning up" my payment code.

Thumbnail reddit.com
0 Upvotes

r/codereview • • 7d ago

Feedback on my python project

Thumbnail reddit.com
1 Upvotes

r/codereview • • 7d ago

Need backend QA engineer / Backend auditor to audit the codebase of my app.

0 Upvotes

Hi ,
I'm working on a social marketplace app. Code has been built.
I need a backend QA engineer to do the database audit , API audit , Payment audit , Refund audit , Security audit , Performance audit .
It will be a paid gig . 50$ .
DM with your experience.