Review this AI-assisted change before I open a pull request.
Score the diff against the checklist below. Prioritize correctness, security,
data safety, backward compatibility, tests, and reviewability. Do not comment
on style unless it hides a real bug or makes the diff harder to review.
For each finding, report:
- severity: P0, P1, P2, or P3
- exact file and line if available
- why it matters in production
- The PR has a clear problem statement and success criteria.
- The diff only touches files needed for the requested change.
- The agent did not mix feature work with unrelated refactors.
- Generated names, copy, comments, and examples match the product domain.
- The implementation follows existing local patterns instead of inventing a new architecture.
- New abstractions remove real duplication or complexity, not just make the code look cleaner.
- The PR description explains what was intentionally not changed.
- Any assumptions are written down and easy for a reviewer to challenge.
- The agent read the relevant files before editing.
- The change respects existing module boundaries and ownership.
- Public interfaces remain backward-compatible unless the PR explicitly says otherwise.
- Naming matches surrounding code conventions.
- Error handling style matches the rest of the codebase.
- Logging, telemetry, and analytics use existing helpers.
- The change does not duplicate an existing utility, type, hook, component, or service.
- Happy path behavior is covered by a test or a reproducible manual check.
- Important edge cases are covered: empty input, null/undefined, limits, duplicates, timeouts.
- The implementation handles partial failure instead of assuming every dependency succeeds.
- Async work is awaited or intentionally fire-and-forget with lifecycle handling.
- State transitions are explicit and cannot silently skip required steps.
- Date, currency, locale, and timezone logic is deterministic.
- The code handles retries, idempotency, or duplicate events where relevant.
- The output shape matches existing API contracts.
- The change has been tested against realistic data, not only toy examples.
- Tests describe behavior, not implementation details.
- Each new test would fail if the feature were broken.
- The test suite covers at least one failure path.
- Mocks sit at system boundaries, not inside the logic being tested.
- Snapshot updates are intentional and reviewed.
- Flaky waits, sleeps, or network dependencies were avoided.
- The relevant local check command was run and recorded in the PR.
- New inputs are validated at the boundary.
- Authorization is checked separately from authentication.
- User-controlled values are not interpolated into SQL, shell commands, paths, HTML, or URLs unsafely.
- Secrets are not logged, returned, committed, or exposed to the client bundle.
- The change does not broaden permissions, OAuth scopes, CORS, CSP, or webhook trust without explanation.
- Sensitive data is redacted in logs, analytics, and error messages.
- File uploads, redirects, and callbacks are constrained to expected origins and types.
- Schema changes are backward-compatible during deploy.
- Migrations are idempotent or have a clear rollback strategy.
- Existing data is preserved and transformed intentionally.
- New queries use indexes or bounded scans where volume matters.
- Background jobs and webhooks can tolerate duplicate delivery.
- Deletes are soft, recoverable, or explicitly justified.
Performance and Operations
- The change does not add an unbounded loop, N+1 query, or repeated network call.
- Expensive work is cached, batched, queued, or paginated where needed.
- Client-side bundles do not grow because of avoidable imports.
- Errors include enough context to debug without leaking private data.
- Monitoring, alerting, or analytics exists for new critical paths.
- The feature fails closed for security-sensitive paths and fails gracefully for UX paths.
- The diff is small enough to review in one sitting.
- Generated code was simplified before review.
- Comments explain non-obvious decisions, not what the code plainly does.
- Formatting-only churn is isolated or removed.
- The PR includes screenshots or traces when behavior is visual or operational.
- A human can identify the riskiest part of the change within two minutes.