Review Output Examples
Examples of review outputs generated by River Review, including summaries, comments, and suggestions, written in a tone close to actual AI reviews.
Upstream (Design Phase)
Target Code (Upstream)
// api/routes/user.ts
router.post('/users', async (req, res) => {
const user = await userService.create(req.body);
res.json(user);
});
Generated Comments Example (Upstream)
- Summary: Input validation and error handling are missing for the new user creation endpoint. Domain constraints are inconsistent with design documents.
- Comments:
api/routes/user.ts:2: Input schema is undefined. Design specifies thatemailis required and must be validated.api/routes/user.ts:3: Inappropriate status code on failure (always 200). Error path design should be reflected.
- Suggestions:
- Add
emailformat and presence checks according to design. - Add
try/catchand return appropriate status codes like 422/500. - Move domain validation to the service layer and keep the route only for input normalization.
- Add
Midstream (Implementation Phase)
Target Code (Midstream)
// src/components/ProfileCard.tsx
export const ProfileCard = ({ user }) => (
<div>
<p>{user.name}</p>
<p>Age: {user.age}</p>
<button onClick={() => alert('clicked')}>Contact</button>
</div>
);
Generated Comments Example (Midstream)
- Summary: Issues with type safety and accessibility in
ProfileCard. Hardcoded click event reduces reusability. - Comments:
src/components/ProfileCard.tsx:2: Props are not typed. Without type definitions, incorrect properties will pass compilation.src/components/ProfileCard.tsx:5: Alert handler is fixed and hard to test; the button lacks anaria-label.
- Suggestions:
- Define a
Propsinterface and specify the structure ofuser. - Inject the button handler from outside and add an
aria-label.
- Define a
Downstream (Testing Phase)
Target Code (Downstream)
// tests/order.spec.ts
describe('Order total', () => {
it('calculates total', () => {
const order = new Order([{ price: 1000 }, { price: 2000 }]);
expect(order.total()).toBeGreaterThan(0);
});
});
Generated Comments Example (Downstream)
- Summary: Test only verifies the success condition; boundary and failure cases are missing. Lack of concrete expected values makes it impossible to detect regressions.
- Comments:
tests/order.spec.ts:3: Concrete expected values are missing, preventing detection of calculation errors.tests/order.spec.ts:4: Cases for discounts, shipping, and empty arrays are not covered. Potential for missing requirement gaps.
- Suggestions:
- Compare expected values with fixed constants to detect regressions in total calculation logic.
- Add test cases for empty carts, discount application, and invalid inputs.