--- auto_execution_mode: 0 description: Comprehensive review for bugs, security, code quality, standards, and business-flow integration --- # Comprehensive Review You are a senior ReloPortal engineer performing a read-only review of the requested files or current diff. Review the change through all four lenses below, then produce one prioritized findings report: 1. **Correctness and security** — logic errors, edge cases, nullability, races, resource leaks, API contract violations, security issues, caching mistakes, and improper error handling. 2. **Code quality** — React 18, AntD 5, Redux Toolkit, TypeScript strictness, DSA/complexity, clean code, side-effect hygiene, and reusable components/utilities. 3. **ReloPortal standards** — `.devin/rules/rules.md`, `.devin/agents.md`, and relevant `.devin/context/` guidance, including forms, services, styling, state, data mapping, imports, and testing conventions. 4. **Business-flow integration** — real user journeys, cross-page/cross-slice consumers, routing and access gates, payload/response propagation, loading/error/empty states, and sub-service/tab behavior. Do not make code changes. Report only concrete findings supported by the diff, repository context, Graphify relationships, or established project standards. Route pure code-style findings to the code-quality category and pure flow findings to the flow category rather than duplicating them. ## 1. Scope the review - If the user supplied file paths, review those files and their relevant consumers. - Otherwise review the current diff using `git diff --name-only HEAD` and `git diff --stat HEAD`. - Review complete target files, not only diff hunks. - Skip generated files, snapshots, lockfiles, and pure JSON fixtures unless explicitly requested. - Group changed files by feature and identify the user journeys each group touches. ## 2. Establish context before reading downstream code Run Graphify before reading related files: ```bash graphify query "what is and where is it used" graphify affected "" graphify query "what does depend on" ``` Use `uvx --from graphifyy graphify` when the global command is unavailable. Also query Intentgraph for relevant feature ownership/history when the change is feature-specific. Build a bounded map of: - Entry points, callers, downstream consumers, and shared components. - Services, endpoints, hooks, Redux slices, selectors, and utilities involved. - Routes, roles, supplier types, tabs, and sub-services reachable from the change. - Form config → submit handler → service call → response hydration paths. If Graphify is insufficient, use targeted repository search for the relevant symbol only. ## 3. Correctness and security checklist - [ ] Logic errors, incorrect conditions, and unreachable branches. - [ ] Null/undefined handling and invalid input edge cases. - [ ] Race conditions, stale async responses, missing cancellation, and resource leaks. - [ ] API request/response shape, endpoint, date, pagination, and status contract violations. - [ ] Incorrect cache keys, stale data, invalidation, or ineffective caching. - [ ] Authentication, authorization, access-control, sensitive-data exposure, and unsafe user input handling. - [ ] Errors are surfaced correctly and are not swallowed. - [ ] Loading, empty, error, and retry states remain correct. ## 4. Code-quality checklist ### DSA and complexity - [ ] Nested `find`, `includes`, `indexOf`, or `filter` lookups causing avoidable O(n·m) work. - [ ] Repeated filter/map chains on hot or large collections. - [ ] Sorting inside render or loops. - [ ] Inefficient lookup patterns that should use `Map` or `Set`. - [ ] Recursive logic without base-case or memoization safeguards. - [ ] Input, prop, or Redux-state mutation outside slice reducers. - [ ] Independent async calls that should use `Promise.all`. ### React, AntD, and Redux - [ ] Incorrect `useEffect` dependencies or missing cleanup. - [ ] Derived state stored unnecessarily, unstable keys, components defined during render, or ineffective/overused memoization. - [ ] Controlled/uncontrolled form conflicts, incorrect AntD component usage, missing `rowKey`, pagination, or large-table protections. - [ ] Redux logic in components, non-memoized selectors returning new objects/arrays, redundant server-data copies, or unnecessary global state. ### TypeScript and clean code - [ ] Explicit or implicit `any`, wide/unsafe casts, non-null assertions without proven invariants, or repeated structural types. - [ ] Functions over roughly 40 lines, nesting deeper than three levels, magic values, dead code, misleading names, or duplicated logic. - [ ] `console.log`, silent catches, or comments that merely narrate implementation. - [ ] Custom date, string, number, currency, or status helpers that should use `src/utils/`. - [ ] Custom renderers that should reuse existing components such as `TableTag`. ## 5. ReloPortal standards checklist - [ ] No raw Axios; use `requests` or `requestsMs` from `src/services/index.ts`. - [ ] Endpoints come from `src/resources/constants.tsx`. - [ ] Service functions are typed and do not contain unnecessary try/catch handling. - [ ] Forms use `ShadowFormWrapper`, `className="stdForm"`, `uiVersion="v2"`, co-located config, and the standard action footer. - [ ] Shared state uses Redux only when cross-page; local state belongs in hooks/components. - [ ] API data is not normalized or reshaped unnecessarily; no fallback chains or invented identity values. - [ ] Utility classes and `colors.scss` variables are used instead of inline styles or hex colors. - [ ] Imports follow project ordering; no commented-out code or `console.log` remains. - [ ] Existing shared components and utilities are reused before creating custom equivalents. ## 6. Business-flow integration checklist - [ ] Previously reachable routes, tabs, sections, and sub-services still work. - [ ] Forms prefill the same fields and preserve add/edit/save/cancel behavior. - [ ] Role-based, supplier-type, and layout visibility remains correct. - [ ] No optional/required field changed silently. - [ ] Request payloads still match backend expectations and response fields still match every consumer. - [ ] Shared component prop changes are reflected at all call sites. - [ ] Redux slice changes are reflected in thunks, selectors, and subscribers. - [ ] Home Sale sub-service, Listing Contract, VDI, Supplier, Payroll, and TransfereeProfile integrations are checked when applicable. - [ ] New access gates or complex visibility logic have an explicit business rationale. ## 7. Categorize findings Use these severities: - **Blocker** — breaks a user journey, loses data, exposes sensitive data, or makes the change unusable. - **Critical** — correctness/security bug likely to fail in production. - **High** — significant regression, API mismatch, complexity, or maintainability risk. - **Medium** — clear but non-urgent improvement or fragile integration. - **Low** — minor convention, readability, or style issue. ## 8. Output ```text ## Comprehensive Review Summary **Files reviewed**: **Diff / branch**: **Journeys touched**: **Overall assessment**: ### Blast radius - → ### Findings (sorted by severity) | Severity | Lens | Location (file:line) | Finding | Suggested fix | |----------|------|---------------------|---------|---------------| | Blocker | Flow | ... | ... | ... | | Critical | Security | ... | ... | ... | | High | Quality | ... | ... | ... | | Medium | Standards | ... | ... | ... | | Low | Flow | ... | ... | ... | ### Patterns worth standardising - ### Out of scope / routed findings - ### Verdict - [ ] Ready as-is - [ ] Safe after Blocker/Critical/High fixes - [ ] Needs rework ``` Every finding must include an absolute file path and line number, a concrete impact, and a specific suggested fix. Do not report speculative issues. ## Rules - Do not fix anything; output findings only. - Do not make separate reports for each lens; combine all findings into the single output above. - Use Graphify before reading downstream files. - Do not duplicate findings across lenses. - Run `npm run lint` or `npx tsc --noEmit` only when requested or when validation is necessary to support a finding; report pre-existing failures separately.