Skip to content

Refine reviewer rules based on automated tracker feedback #90591

Closed

Description

@kacper-mikolajczak

Refinements to two Claude reviewer rules based on accept/reject feedback gathered via the automated tracker. Each refinement narrows the rule's firing condition so reviewers stop dismissing technically-wrong suggestions, which was eroding trust in unrelated rules.

The originally scoped PERF-9 refinement was dropped during implementation - the cases the new carve-out would have permitted (intermediate state that is render-driving) are exactly the cases PERF-14 already wants migrated to useSyncExternalStore. Adding the carve-out would have contradicted PERF-14, and legitimate chains that fall outside PERF-14's contract (timer- or Promise-based) are already covered by the existing "external events that can't be combined" bullet on PERF-9.


CLEAN-REACT-PATTERNS-4

Background
Claude reviewer enforces CLEAN-REACT-PATTERNS-4, flagging any internal helper function in a component that returns JSX. Stated rationale: React Compiler cannot independently memoize JSX created inside a parent's closure. Internal render helpers are common in this codebase, especially as switch/conditional dispatchers to already-extracted child components. Across the sampled PR threads (88691, 85949, 85426) all three suggestions were rejected by reviewers citing RC behavior or code-move context.

Problem
When the rule fires on thin delegation wrappers that React Compiler already memoizes correctly, developers reject the suggestion as technically wrong, which erodes trust in every other rule the reviewer emits.

Solution
Scope CLEAN-REACT-PATTERNS-4 to fire only when the helper (a) contains hooks, side effects, or non-trivial business logic, (b) builds deeply nested JSX inline, or (c) closes over mutable parent state. Add explicit carve-outs: (1) switch/conditional helpers that delegate to already-extracted child components, (2) .map() over already-extracted components. Correct the rule's docs claim about RC memoization to reflect that RC handles thin wrappers without issue. Skip the "code merely moved" carve-out - too fuzzy and indirectly covered by (1) and (2).


CLEAN-REACT-PATTERNS-1

Background
Claude reviewer enforces CLEAN-REACT-PATTERNS-1, flagging components on prop count (monolithic interface), mixed responsibilities, and config-array rendering (Case 4). Sampled feedback: 3 violations, 1 thumbs-down, 2 substantive developer replies pushing back on legitimate React patterns (88344, 86663).

Problem
When the rule counts props that exist solely to coordinate shared state or callbacks across sibling children, components with legitimately-lifted state get flagged as monolithic, which forces developers into unnatural decompositions or rule-ignoring habits.

Solution
Exempt props from the monolithic-interface prop count when they exist to coordinate shared state or callbacks across sibling children whose state must live in the common parent - the coordination role must be structurally detectable (state setter passed to multiple children, or callback consumed by multiple children) to prevent argument-shaped escape hatches. Defer the Case 4 (config-array rendering) threshold change until evidence reaches ~10+ thumbs-down; n=1 is insufficient signal and "~6-8 items" is arbitrary and gameable.

Activity

  1. kacper-mikolajczak commented on May 18, 2026

    @kacper-mikolajczak
    ContributorAuthor
  2. Julesssss commented on May 18, 2026

    @Julesssss
    Contributor

    Agree, not sure how exactly to tighten the prompt though.

    BTW once we figure out a good workflow for analysing and actioning these improvement me and Rodrigo are thinking about making this an automated weekly chore assigned to the internal engineering team. So any promp you used to generate this issue analysis, or other tips would be very helpful.

  3. kacper-mikolajczak commented on May 19, 2026

    @kacper-mikolajczak
    ContributorAuthor

    Thanks @Julesssss! Quick note - the rule changes already shipped in #90590, so for these two rules "tightening" turned into concrete edits.

    I do pick up those improvements proposals from the analyzer sometimes in order to check how it's performing, but I definitely agree automating steps further and thus moving human-in-the-loop checkpoint into later stages in the process would be a good way forwards that reduces maintenance burden.

    For the prompt, those issues were gathered from the analyzer run and passed through quick verification + Exfy's P/S hourglass prompt. Later on, there was one refinement after Adam's review. How have you guys been working so far with analyzer improvements?

  4. Julesssss commented on May 19, 2026

    @Julesssss
    Contributor

    We simply looked through the 3 top level issues listed in here and manually looked into the highly reported rules.

  5. kacper-mikolajczak commented on May 19, 2026

    @kacper-mikolajczak
    ContributorAuthor

    Sounds like a good starting point. Are you satisfied with this flow for now and test it more or you'd like start thinking about next iteration?

  6. changed the title [-]Refine reviewer rules based on automated tracker feedback[/-] [+][Due for payment 2026-05-26] Refine reviewer rules based on automated tracker feedback[/+] on May 19, 2026
  7. melvin-bot commented on May 19, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  8. melvin-bot commented on May 19, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.77-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-05-26. 🎊

    For reference, here are some details about the assignees on this issue:

  9. changed the title [-][Due for payment 2026-05-26] Refine reviewer rules based on automated tracker feedback[/-] [+]Refine reviewer rules based on automated tracker feedback[/+] on May 19, 2026
  10. Julesssss commented on May 19, 2026

    @Julesssss
    Contributor

    Open to ideas for further iterations!

  11. melvin-bot commented on May 25, 2026

    @melvin-bot

    @rlinoz, @Julesssss, @kacper-mikolajczak Huh... This is 4 days overdue. Who can take care of this?

  12. kacper-mikolajczak commented on May 26, 2026

    @kacper-mikolajczak
    ContributorAuthor

    I think we can close this and continue the exploration for further automation separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions