Skip to content

Remove ROBINS-I manual judgement override; derive judgements like ROB-2 - #522

Merged
InfinityBowman merged 12 commits into
mainfrom
robins-remove-manual-override
Jun 29, 2026
Merged

Remove ROBINS-I manual judgement override; derive judgements like ROB-2#522
InfinityBowman merged 12 commits into
mainfrom
robins-remove-manual-override

Conversation

@InfinityBowman

@InfinityBowman InfinityBowman commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

ROBINS-I let reviewers manually override domain/overall judgements (judgementSource: 'auto' | 'manual') and reconciled judgements as their own pages. Because an auto judgement was computed-but-not-stored, two reviewers who both left a judgement on auto compared as null === null at reconciliation: the UI reported "Reviewers agreed" yet auto-fill no-opped on the null, leaving the Final Judgement "Not set" and blocking save with no way forward. ROB-2 never hit this because it derives judgements and has no judgement reconciliation pages.

This PR aligns ROBINS-I with ROB-2: judgements are always derived from the signalling answers, and only direction is reconciled.

Changes

Checklist editor — judgement display-only, direction stays editable:

  • DomainSection.tsx, OverallSection.tsx: removed the Auto/Manual toggle, judgementSource, and manual-override handlers.
  • ScoringSummary.tsx: dropped the manual * indicator.

Data modeljudgementSource removed everywhere:

  • types.ts, create.ts, answers-schema.ts, scoring.ts (getEffectiveDomainJudgement deleted, scoreAllDomains simplified), handler, and migrate.ts.
  • isROBINSIComplete now derives completion from the answers (it was reading the now-unwritten stored field).

Reconciliation — mirrors ROB-2:

  • New DomainDirectionPage / OverallDirectionPage (judgement read-only/derived); deleted DomainJudgementPage, OverallJudgementPage, and the manual JudgementPanel.
  • navbar-utils.ts, adapter.tsx, NavbarDomainPill.tsx, RobinsISummaryView.tsx updated (judgement nav items -> direction). Direction is non-gating (optional; ROBINS-I has no "not applicable" option, so it can't block save).

Tests: updated unit/migration fixtures; the e2e dual-reviewer workflow now passes without manually selecting an agreed judgement, proving the bug is structurally gone.

Breaking change

Any ROBINS-I checklist previously saved with a manual judgement override now shows the derived judgement instead. The stored override is ignored (no migration), per discussion.

Verification

  • Typecheck: web, shared, workers
  • Unit: shared 212, web 316, workers 113
  • E2E: 25/25 (ROB-2 and ROBINS-I both pass)
  • Lint + Prettier clean

Summary by CodeRabbit

  • New Features
    • Enhanced ROBINS-I reconciliation to review direction per domain and overall, with an updated flow and UI.
  • Bug Fixes
    • Standardized ROBINS-I scoring/completion so domain and overall judgements are always auto-derived from signalling answers (no manual override state).
    • Updated reconciliation/status logic to use stored direction values consistently.
  • Documentation
    • Refreshed the Plan Configuration example snippet formatting in the shared README.
  • Tests / QA
    • Updated and expanded ROBINS-I and scoring E2E coverage, plus adjusted related unit tests and mocks.

ROBINS-I let reviewers manually override domain/overall judgements
(judgementSource: auto | manual) and reconciled judgements as their own
pages. Because an auto judgement was computed-but-not-stored, two reviewers
who both left a judgement on auto compared as null === null at
reconciliation: the UI reported "Reviewers agreed" yet auto-fill no-opped on
the null, leaving the Final Judgement "Not set" and blocking save with no way
forward. ROB-2 never hit this because it derives judgements and has no
judgement reconciliation pages.

Align ROBINS-I with ROB-2: judgements are always derived from the signalling
answers, and only direction is reconciled.

- Editor: judgement is display-only; drop the Auto/Manual toggle and all
  manual-override handlers. Direction stays editable.
- Data model: remove judgementSource from types, schema, create, handler, and
  migration; getEffectiveDomainJudgement deleted; scoreAllDomains simplified.
  isROBINSIComplete now derives completion from the answers.
- Reconciliation: replace the domain/overall judgement pages with direction
  pages (judgement shown read-only/derived). Direction is optional and never
  blocks save (ROBINS-I has no "not applicable" direction option).
- Tests: update unit/migration fixtures; the e2e dual-reviewer workflow now
  passes without manually selecting an agreed judgement.

Existing checklists saved with a manual override now show the derived
judgement; the stored override is ignored (no migration).
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4d2a7acb-e177-4c87-a5d1-6543686df253

📥 Commits

Reviewing files that changed from the base of the PR and between 8aef716 and f229e72.

📒 Files selected for processing (4)
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/workers/src/durable-objects/dev-handlers.ts
  • packages/workers/src/lib/mock-templates.ts
✅ Files skipped from review due to trivial changes (2)
  • packages/workers/src/durable-objects/dev-handlers.ts
  • packages/workers/src/lib/mock-templates.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts

📝 Walkthrough

Walkthrough

Removes judgementSource from ROBINS-I checklist state and scoring, updates persistence and migration to stop storing it, and replaces reconciliation judgement pages and nav items with direction-based pages and values.

Changes

Remove ROBINS-I manual judgement override

Layer / File(s) Summary
Shared contracts and auto-scoring
packages/shared/src/checklists/types.ts, packages/shared/src/checklists/robins-i/answers-schema.ts, packages/shared/src/checklists/robins-i/scoring.ts, packages/shared/src/checklists/robins-i/answers.ts, packages/shared/src/checklists/robins-i/create.ts, packages/shared/src/checklists/robins-i/schema.ts, packages/shared/src/checklists/rob2/schema.ts, packages/shared/src/errors/types.ts
Removes judgementSource from ROBINS-I shared types and update schemas, changes scoreAllDomains/isROBINSIComplete to use auto-derived judgements only, updates checklist creation defaults, removes 'NA' from BIAS_DIRECTIONS, and reformats related shared type unions.
Checklist persistence and migration
packages/web/src/primitives/useProject/checklists/handlers/robins-i.ts, packages/web/src/primitives/useProject/reactor/migrate.ts, packages/web/src/primitives/useProject/reactor/migrate.test.ts
Stops writing judgementSource in the ROBINS-I Yjs handler, removes it from flattened migration output, and updates the migration test expectations.
Checklist UI and scoring display
packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx, packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx, packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx, packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
Removes manual ROBINS-I judgement editing from the domain and overall sections, makes overall judgement read-only, and simplifies scoring summary display to use the auto-derived judgement directly.
ROBINS-I reconciliation pages and navigation
packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainJudgementPage.tsx, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallJudgementPage.tsx, packages/web/src/components/project/reconcile-tab/robins-i-reconcile/panels/JudgementPanel.tsx
Switches ROBINS-I reconciliation from judgement items to direction items, adds direction reconciliation pages, removes the judgement pages and panel, and updates the summary view and adapter to use direction values and direction-based matching.
ROB2 reconciliation direction handling
packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts, packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx, packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx, packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx, packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx, packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
Updates ROB2 reconciliation helpers, pages, and adapter behavior so direction items are treated as always complete, value checks distinguish stored direction from completion, and optional unset directions can be propagated through reconciliation.
Tests, workflow helpers, and support wiring
packages/shared/src/checklists/__tests__/robins-i.test.ts, packages/web/e2e/shared-steps.ts, packages/web/e2e/robins-i-workflow.spec.ts, packages/web/e2e/rob2-workflow.spec.ts, packages/web/src/components/checklist/ROBINSIChecklist/__tests__/robins-scoring.test.ts, packages/web/src/components/checklist/ROBINSIChecklist/scoring/robins-scoring.ts, packages/web/package.json, packages/web/vite.config.ts, packages/web/vite.config.e2e.ts, packages/web/src/lib/export-pdf.ts, packages/web/src/lib/inter-rater-reliability.ts, packages/web/src/components/dashboard/LocalAppraisalsSection.tsx, packages/web/src/project/connectionReducer.ts, packages/web/src/server/functions/billing.server.ts, packages/web/src/server/guards/requireProjectAccess.ts, packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx, packages/workers/worker-configuration.d.ts, packages/workers/src/durable-objects/__tests__/UserSession.test.ts, .prettierignore, knip.config.ts, packages/shared/README.md, packages/shared/src/errors/types.ts, packages/workers/src/durable-objects/dev-handlers.ts, packages/workers/src/lib/mock-templates.ts
Updates ROBINS-I unit tests and e2e workflow helpers for answer-based completeness and direction reconciliation, alongside config, formatting, and generated type updates across the repo.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • InfinityBowman/corates#208: Introduced getEffectiveDomainJudgement and the manual/auto override UI that this PR removes entirely.
  • InfinityBowman/corates#243: Added the ROBINS-I reconciliation pages and JudgementPanel/DomainJudgementPage/OverallJudgementPage components that this PR deletes.
  • InfinityBowman/corates#496: Modified the same reconciliation adapter (autoFillFromReviewer1) and navbar item typing files that this PR rewrites for direction-based reconciliation.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 65.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: removing ROBINS-I manual judgement overrides and deriving judgements like ROB-2.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch robins-remove-manual-override

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (5)
packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx (1)

40-41: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Import the new pages through the @/ alias.

Proposed fix
-import { DomainDirectionPage } from './pages/DomainDirectionPage';
-import { OverallDirectionPage } from './pages/OverallDirectionPage';
+import { DomainDirectionPage } from '`@/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage`';
+import { OverallDirectionPage } from '`@/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage`';

As per coding guidelines, packages/web/src/**/*.{ts,tsx}: Path aliases: @/ maps to packages/web/src/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx`
around lines 40 - 41, The imports in adapter.tsx should use the `@/` alias instead
of relative paths. Update the DomainDirectionPage and OverallDirectionPage
imports in the adapter module to reference their locations through `@/` so they
follow the packages/web/src path-alias guideline and stay consistent with the
rest of the codebase.

Source: Coding guidelines

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx (2)

5-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the web source alias for the local panel import.

Proposed fix
-import { DirectionPanel } from '../panels/DirectionPanel';
+import { DirectionPanel } from '`@/components/project/reconcile-tab/robins-i-reconcile/panels/DirectionPanel`';

As per coding guidelines, packages/web/src/**/*.{ts,tsx}: Path aliases: @/ maps to packages/web/src/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx`
at line 5, The local panel import in OverallDirectionPage should use the web
source alias instead of a relative path. Update the DirectionPanel import to
follow the project’s `@/` alias convention for `packages/web/src/**/*.{ts,tsx}`,
keeping the component reference the same while changing only the import source
path.

Source: Coding guidelines


1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Drop useMemo around overall scoring.

This follows the package guidance to let React Compiler handle memoization.

Proposed fix
-import { useMemo } from 'react';
 import { CheckIcon, XIcon, InfoIcon } from 'lucide-react';
@@
-  const reviewer1Scoring = useMemo(() => scoreAllDomains(checklist1), [checklist1]);
-  const reviewer2Scoring = useMemo(() => scoreAllDomains(checklist2), [checklist2]);
-  const finalScoring = useMemo(() => scoreAllDomains(finalChecklist), [finalChecklist]);
+  const reviewer1Scoring = scoreAllDomains(checklist1);
+  const reviewer2Scoring = scoreAllDomains(checklist2);
+  const finalScoring = scoreAllDomains(finalChecklist);

As per coding guidelines, packages/web/src/**/*.{tsx,ts}: Avoid useMemo or useCallback - let the React Compiler handle memoization.

Also applies to: 52-54

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx`
at line 1, Remove the manual memoization from OverallDirectionPage by dropping
the useMemo import and any useMemo wrapping around the overall scoring logic,
since the React Compiler should handle memoization here. Update the component to
compute the score directly in OverallDirectionPage (and any related scoring
helpers in the same block) without useMemo/useCallback, keeping the existing
behavior unchanged while following the packages/web coding guideline.

Source: Coding guidelines

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx (2)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the web source alias for the local panel import.

This new import bypasses the configured @/ alias.

Proposed fix
-import { DirectionPanel } from '../panels/DirectionPanel';
+import { DirectionPanel } from '`@/components/project/reconcile-tab/robins-i-reconcile/panels/DirectionPanel`';

As per coding guidelines, packages/web/src/**/*.{ts,tsx}: Path aliases: @/ maps to packages/web/src/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx`
at line 9, The local panel import in DomainDirectionPage should use the
configured web source alias instead of a relative path. Update the
DirectionPanel import to come through the `@/` alias so it matches the
packages/web/src convention and keeps imports consistent across the web
codebase.

Source: Coding guidelines


1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Drop useMemo around the scoring calls.

These calculations are pure render-derived values, and this package guideline asks React Compiler to handle memoization.

Proposed fix
-import { useMemo } from 'react';
 import { CheckIcon, XIcon, InfoIcon } from 'lucide-react';
@@
-  const reviewer1Scoring = useMemo(
-    () => scoreRobinsDomain(domainKey, reviewer1Answers),
-    [domainKey, reviewer1Answers],
-  );
-  const reviewer2Scoring = useMemo(
-    () => scoreRobinsDomain(domainKey, reviewer2Answers),
-    [domainKey, reviewer2Answers],
-  );
-  const finalScoring = useMemo(
-    () => scoreRobinsDomain(domainKey, finalAnswers),
-    [domainKey, finalAnswers],
-  );
+  const reviewer1Scoring = scoreRobinsDomain(domainKey, reviewer1Answers);
+  const reviewer2Scoring = scoreRobinsDomain(domainKey, reviewer2Answers);
+  const finalScoring = scoreRobinsDomain(domainKey, finalAnswers);

As per coding guidelines, packages/web/src/**/*.{tsx,ts}: Avoid useMemo or useCallback - let the React Compiler handle memoization.

Also applies to: 62-73

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx`
at line 1, Remove the useMemo wrapper around the scoring calculations in
DomainDirectionPage and let the values be computed directly during render, since
they are pure derived values and the package guideline prefers React Compiler
memoization. Also drop the useMemo import from the component if it is no longer
used, and keep the existing scoring logic/identifiers intact so the calculations
remain functionally the same.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/web/e2e/robins-i-workflow.spec.ts`:
- Line 44: The option locator in the e2e workflow test is building a RegExp
directly from raw outcome text, which can mis-match or fail when the text
contains regex metacharacters. Update the locator in the robins-i workflow spec
to escape the outcome value before passing it into page.getByRole('option',
...), so the match is treated as literal text rather than a pattern.

In `@packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx`:
- Around line 140-149: The read-only DomainSection still renders interactive
judgement buttons through DomainJudgement by passing a no-op onJudgementChange,
which leaves inert focusable controls. Update the DomainSection usage of
DomainJudgement so the judgement row is hidden or disabled in display-only mode
while preserving the editable direction controls via handleDirectionChange and
the existing direction props. Use the DomainJudgement component’s
judgement-related props and rendering logic to enforce the new display-only
contract instead of relying on an empty callback.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx`:
- Around line 155-165: The “Use This” flow in adapter.tsx is skipping reviewer
directions when they are null because of truthy checks in the DOMAIN_DIRECTION
and OVERALL_DIRECTION cases. Update the handling in the affected reconciliation
path (including the related logic around the other referenced block) so it
copies the reviewer’s direction whenever the reviewer scope exists, even if that
value is null, and only skips when the reviewer data itself is missing. Use the
existing updateDomainDirection and updateOverallDirection helpers to preserve an
unset final direction instead of leaving stale reconciled data in place.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts`:
- Around line 201-214: The current hasNavItemAnswer helper in navbar-utils.ts
treats DOMAIN_DIRECTION and OVERALL_DIRECTION as always answered, which is
mixing completion logic with value presence. Split this into two checks: keep a
completion-focused path for blocking rules, and add a separate helper for
whether a direction actually has a set value. Update the navbar and summary
answer indicators to use the value-presence helper so unset directions do not
render as answered while still remaining non-blocking.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx`:
- Around line 75-95: The agreement status in DomainDirectionPage should be
direction-only, not tied to judgement equality. Update the header logic in
DomainDirectionPage so the green/amber state and icon depend on directionMatch
alone, matching the nav and summary behavior, and keep judgementMatch only for
any separate judgement-specific display if needed. Use the existing
directionMatch and judgementMatch symbols to locate the conditional rendering
and remove judgementMatch from the page status condition.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx`:
- Around line 56-76: The OverallDirectionPage header is using both
directionMatch and judgementMatch to decide the status, but this screen should
be direction-only. Update the status logic in OverallDirectionPage so the header
styling and icon are driven only by directionMatch, and remove or stop using
judgementMatch in this component’s success/failure state. Make sure the
displayed status stays consistent with the OVERALL_DIRECTION evaluation used
elsewhere.

---

Nitpick comments:
In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx`:
- Around line 40-41: The imports in adapter.tsx should use the `@/` alias instead
of relative paths. Update the DomainDirectionPage and OverallDirectionPage
imports in the adapter module to reference their locations through `@/` so they
follow the packages/web/src path-alias guideline and stay consistent with the
rest of the codebase.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx`:
- Line 9: The local panel import in DomainDirectionPage should use the
configured web source alias instead of a relative path. Update the
DirectionPanel import to come through the `@/` alias so it matches the
packages/web/src convention and keeps imports consistent across the web
codebase.
- Line 1: Remove the useMemo wrapper around the scoring calculations in
DomainDirectionPage and let the values be computed directly during render, since
they are pure derived values and the package guideline prefers React Compiler
memoization. Also drop the useMemo import from the component if it is no longer
used, and keep the existing scoring logic/identifiers intact so the calculations
remain functionally the same.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx`:
- Line 5: The local panel import in OverallDirectionPage should use the web
source alias instead of a relative path. Update the DirectionPanel import to
follow the project’s `@/` alias convention for `packages/web/src/**/*.{ts,tsx}`,
keeping the component reference the same while changing only the import source
path.
- Line 1: Remove the manual memoization from OverallDirectionPage by dropping
the useMemo import and any useMemo wrapping around the overall scoring logic,
since the React Compiler should handle memoization here. Update the component to
compute the score directly in OverallDirectionPage (and any related scoring
helpers in the same block) without useMemo/useCallback, keeping the existing
behavior unchanged while following the packages/web coding guideline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 64809555-21f2-4a8a-993c-0305f70cbbcd

📥 Commits

Reviewing files that changed from the base of the PR and between 8fa1424 and 107cdd5.

📒 Files selected for processing (40)
  • packages/shared/README.md
  • packages/shared/src/checklists/__tests__/robins-i.test.ts
  • packages/shared/src/checklists/amstar2/score.ts
  • packages/shared/src/checklists/robins-i/answers-schema.ts
  • packages/shared/src/checklists/robins-i/answers.ts
  • packages/shared/src/checklists/robins-i/create.ts
  • packages/shared/src/checklists/robins-i/schema.ts
  • packages/shared/src/checklists/robins-i/scoring.ts
  • packages/shared/src/checklists/types.ts
  • packages/shared/src/errors/types.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/__tests__/robins-scoring.test.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/scoring/robins-scoring.ts
  • packages/web/src/components/dashboard/LocalAppraisalsSection.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainJudgementPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallJudgementPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/panels/JudgementPanel.tsx
  • packages/web/src/lib/export-pdf.ts
  • packages/web/src/lib/inter-rater-reliability.ts
  • packages/web/src/primitives/useProject/checklists/handlers/robins-i.ts
  • packages/web/src/primitives/useProject/reactor/migrate.test.ts
  • packages/web/src/primitives/useProject/reactor/migrate.ts
  • packages/web/src/primitives/useProject/reconciliation.ts
  • packages/web/src/project/connectionReducer.ts
  • packages/web/src/routeTree.gen.ts
  • packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx
  • packages/web/src/server/functions/billing.server.ts
  • packages/web/src/server/guards/requireProjectAccess.ts
  • packages/workers/src/durable-objects/__tests__/UserSession.test.ts
  • packages/workers/worker-configuration.d.ts
💤 Files with no reviewable changes (9)
  • packages/web/src/primitives/useProject/checklists/handlers/robins-i.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/scoring/robins-scoring.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallJudgementPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainJudgementPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/panels/JudgementPanel.tsx
  • packages/web/src/primitives/useProject/reactor/migrate.ts
  • packages/shared/src/checklists/robins-i/create.ts
  • packages/shared/src/checklists/robins-i/answers-schema.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/tests/robins-scoring.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: checks
🧰 Additional context used
📓 Path-based instructions (8)
**/*

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*: NEVER use emojis anywhere - not in code, comments, documentation, plan files, commit messages, or examples. This includes unicode symbols.
Never use emojis or unicode symbols - not in code, comments, docs, or commits

Files:

  • packages/shared/src/checklists/robins-i/schema.ts
  • packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx
  • packages/workers/src/durable-objects/__tests__/UserSession.test.ts
  • packages/web/src/components/dashboard/LocalAppraisalsSection.tsx
  • packages/web/src/server/functions/billing.server.ts
  • packages/web/src/primitives/useProject/reactor/migrate.test.ts
  • packages/web/src/server/guards/requireProjectAccess.ts
  • packages/web/src/project/connectionReducer.ts
  • packages/web/src/primitives/useProject/reconciliation.ts
  • packages/shared/README.md
  • packages/shared/src/checklists/amstar2/score.ts
  • packages/shared/src/checklists/__tests__/robins-i.test.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/shared/src/errors/types.ts
  • packages/web/src/lib/inter-rater-reliability.ts
  • packages/shared/src/checklists/robins-i/answers.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx
  • packages/web/src/lib/export-pdf.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
  • packages/shared/src/checklists/types.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/shared/src/checklists/robins-i/scoring.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
  • packages/workers/worker-configuration.d.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

For UI icons, use lucide-react library or SVGs only (never emojis)

Files:

  • packages/shared/src/checklists/robins-i/schema.ts
  • packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx
  • packages/workers/src/durable-objects/__tests__/UserSession.test.ts
  • packages/web/src/components/dashboard/LocalAppraisalsSection.tsx
  • packages/web/src/server/functions/billing.server.ts
  • packages/web/src/primitives/useProject/reactor/migrate.test.ts
  • packages/web/src/server/guards/requireProjectAccess.ts
  • packages/web/src/project/connectionReducer.ts
  • packages/web/src/primitives/useProject/reconciliation.ts
  • packages/shared/src/checklists/amstar2/score.ts
  • packages/shared/src/checklists/__tests__/robins-i.test.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/shared/src/errors/types.ts
  • packages/web/src/lib/inter-rater-reliability.ts
  • packages/shared/src/checklists/robins-i/answers.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx
  • packages/web/src/lib/export-pdf.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
  • packages/shared/src/checklists/types.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/shared/src/checklists/robins-i/scoring.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
  • packages/workers/worker-configuration.d.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx}: Use import aliases from tsconfig.json
Code comments should explain why something is being done or provide context, not repeat what the code is saying
Use TODO(agent) pattern for incomplete work or flagging items for future attention, with brief description and optional doc reference

Files:

  • packages/shared/src/checklists/robins-i/schema.ts
  • packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx
  • packages/workers/src/durable-objects/__tests__/UserSession.test.ts
  • packages/web/src/components/dashboard/LocalAppraisalsSection.tsx
  • packages/web/src/server/functions/billing.server.ts
  • packages/web/src/primitives/useProject/reactor/migrate.test.ts
  • packages/web/src/server/guards/requireProjectAccess.ts
  • packages/web/src/project/connectionReducer.ts
  • packages/web/src/primitives/useProject/reconciliation.ts
  • packages/shared/src/checklists/amstar2/score.ts
  • packages/shared/src/checklists/__tests__/robins-i.test.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/shared/src/errors/types.ts
  • packages/web/src/lib/inter-rater-reliability.ts
  • packages/shared/src/checklists/robins-i/answers.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx
  • packages/web/src/lib/export-pdf.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
  • packages/shared/src/checklists/types.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/shared/src/checklists/robins-i/scoring.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
  • packages/workers/worker-configuration.d.ts
packages/web/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

packages/web/src/**/*.{tsx,ts}: Use lucide-react for the icon library
Use TanStack Query for server state management (useQuery, useMutation)
Import Zustand stores directly from @/stores/ instead of prop-drilling shared state
Avoid useMemo or useCallback - let the React Compiler handle memoization
Prefer newer React primitives where possible, always on the latest version
Use useEffectEvent for stable event handler references inside effects
Use useLayoutEffect for DOM measurements before paint
Use startTransition / useTransition for non-urgent state updates
Use useDeferredValue for deferring expensive re-renders
Use useSyncExternalStore for external store subscriptions (e.g., Yjs awareness)
Use useId() for unique IDs on form elements (radio buttons, checkboxes)
Never prop-drill shared state - import Zustand stores directly

Files:

  • packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx
  • packages/web/src/components/dashboard/LocalAppraisalsSection.tsx
  • packages/web/src/server/functions/billing.server.ts
  • packages/web/src/primitives/useProject/reactor/migrate.test.ts
  • packages/web/src/server/guards/requireProjectAccess.ts
  • packages/web/src/project/connectionReducer.ts
  • packages/web/src/primitives/useProject/reconciliation.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/lib/inter-rater-reliability.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx
  • packages/web/src/lib/export-pdf.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
packages/web/src/routes/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use TanStack Router with file-based routing (createFileRoute)

Files:

  • packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx
packages/web/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Path aliases: @/ maps to packages/web/src/

Files:

  • packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx
  • packages/web/src/components/dashboard/LocalAppraisalsSection.tsx
  • packages/web/src/server/functions/billing.server.ts
  • packages/web/src/primitives/useProject/reactor/migrate.test.ts
  • packages/web/src/server/guards/requireProjectAccess.ts
  • packages/web/src/project/connectionReducer.ts
  • packages/web/src/primitives/useProject/reconciliation.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/lib/inter-rater-reliability.ts
  • packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx
  • packages/web/src/lib/export-pdf.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
packages/workers/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

packages/workers/**/*.{ts,tsx}: Use Zod for schema and input validation (backend)
Use Drizzle ORM for ALL database interactions and migrations
Use Better-Auth for authentication and user management
Never bypass Drizzle for database access

Files:

  • packages/workers/src/durable-objects/__tests__/UserSession.test.ts
  • packages/workers/worker-configuration.d.ts
packages/web/src/components/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use shadcn/ui for UI components (Radix-based, in @/components/ui/)

Files:

  • packages/web/src/components/dashboard/LocalAppraisalsSection.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
🪛 ast-grep (0.44.0)
packages/web/e2e/robins-i-workflow.spec.ts

[warning] 43-43: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(outcome, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity

(regexp-from-variable)


[warning] 43-43: Do not use variable for regular expressions
Context: new RegExp(outcome, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity. Security best practice.

(regexp-non-literal-typescript)

🔇 Additional comments (49)
packages/web/src/routes/_app/_protected/admin/billing.stuck-states.tsx (1)

87-88: LGTM!

packages/workers/src/durable-objects/__tests__/UserSession.test.ts (1)

106-106: LGTM!

packages/web/src/components/dashboard/LocalAppraisalsSection.tsx (1)

130-131: LGTM!

packages/web/src/server/functions/billing.server.ts (1)

458-459: LGTM!

packages/shared/src/errors/types.ts (1)

39-44: LGTM!

packages/web/src/lib/export-pdf.ts (1)

348-348: LGTM!

Also applies to: 529-529, 545-545

packages/web/src/server/guards/requireProjectAccess.ts (1)

18-19: LGTM!

packages/web/src/project/connectionReducer.ts (1)

5-6: LGTM!

packages/web/src/primitives/useProject/reconciliation.ts (3)

115-116: LGTM!


171-172: LGTM!


235-236: LGTM!

packages/shared/README.md (1)

254-255: LGTM!

packages/shared/src/checklists/amstar2/score.ts (1)

70-71: LGTM!

packages/web/src/lib/inter-rater-reliability.ts (1)

37-38: LGTM!

packages/workers/worker-configuration.d.ts (18)

193-194: LGTM!


688-689: LGTM!


920-921: LGTM!


1984-1985: LGTM!


3740-3743: LGTM!


4609-4610: LGTM!


4637-4638: LGTM!


4748-4749: LGTM!


5080-5081: LGTM!


5268-5269: LGTM!


6566-6567: LGTM!


7363-7364: LGTM!


10285-10292: LGTM!


11108-11109: LGTM!


11611-11612: LGTM!


12394-12395: LGTM!


12598-12599: LGTM!


13716-13717: LGTM!

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts (1)

17-21: LGTM!

Also applies to: 31-48, 115-116, 134-155, 235-240

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx (1)

168-177: LGTM!

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx (1)

11-61: LGTM!

Also applies to: 96-174

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx (1)

7-51: LGTM!

Also applies to: 77-152

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx (1)

5-7: LGTM!

Also applies to: 68-80, 226-234, 250-250, 266-266, 340-360, 373-388

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx (1)

46-50: LGTM!

Also applies to: 65-69, 77-102, 214-216

packages/shared/src/checklists/types.ts (1)

88-88: LGTM!

Also applies to: 101-105, 151-154

packages/shared/src/checklists/robins-i/schema.ts (1)

582-582: LGTM!

packages/shared/src/checklists/robins-i/scoring.ts (1)

84-86: LGTM!

Also applies to: 96-97, 111-137

packages/shared/src/checklists/robins-i/answers.ts (1)

186-201: LGTM!

packages/shared/src/checklists/__tests__/robins-i.test.ts (1)

8-31: LGTM!

Also applies to: 181-200

packages/web/e2e/robins-i-workflow.spec.ts (1)

4-7: LGTM!

Also applies to: 20-43, 45-174

packages/web/e2e/shared-steps.ts (1)

59-136: LGTM!

packages/web/src/primitives/useProject/reactor/migrate.test.ts (1)

399-404: LGTM!

packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx (1)

35-55: LGTM!

Also applies to: 90-91

packages/web/src/components/checklist/ROBINSIChecklist/OverallSection.tsx (1)

14-25: LGTM!

Also applies to: 68-72, 81-97, 106-117

packages/web/src/components/checklist/ROBINSIChecklist/ScoringSummary.tsx (1)

113-140: LGTM!

Comment thread packages/web/e2e/robins-i-workflow.spec.ts Outdated
Comment on lines +140 to +149
<DomainJudgement
domainId={domainKey}
judgement={autoJudgement}
direction={direction}
onJudgementChange={() => {}}
onDirectionChange={handleDirectionChange}
showDirection={true}
isDomain1={domainKey === 'domain1a' || domainKey === 'domain1b'}
disabled={disabled}
isAutoMode={true}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not leave inert judgement buttons in the read-only section.

DomainJudgement still renders the full judgement button row, so passing a no-op onJudgementChange leaves focusable controls that look enabled but cannot do anything. That conflicts with the new display-only contract. Please hide or disable just the judgement row here and keep only the direction controls editable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/web/src/components/checklist/ROBINSIChecklist/DomainSection.tsx`
around lines 140 - 149, The read-only DomainSection still renders interactive
judgement buttons through DomainJudgement by passing a no-op onJudgementChange,
which leaves inert focusable controls. Update the DomainSection usage of
DomainJudgement so the judgement row is hidden or disabled in display-only mode
while preserving the editable direction controls via handleDirectionChange and
the existing direction props. Use the DomainJudgement component’s
judgement-related props and rendering logic to enforce the new display-only
contract instead of relying on an empty callback.

Comment thread packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx Outdated
Apply CodeRabbit feedback from PR #522, fixing both ROBINS-I and the
ROB-2 mirror files (the same patterns exist on both sides since this PR
aligned them):

- DomainJudgement: disable the read-only judgement buttons in auto mode
  so they are no longer inert-but-clickable (ROBINS-I; ROB-2 already did)
- adapter: Use This / autofill now copies a reviewer's direction even
  when unset, so adopting a "Not set" reviewer clears stale final data
- navbar-utils: add hasNavItemValue for visual answered indicators,
  keeping hasNavItemAnswer for non-blocking completion gating, so an
  unset optional direction no longer renders as filled
- direction pages: header agreement status keyed on directionMatch only,
  consistent with the nav pills and summary
- e2e: escape outcome text before building the option locator regex

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx (1)

62-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the manual memoization for derived scoring.

These values are cheap render-time derivations, and this package's React guideline prefers relying on the React Compiler over useMemo. A plain assignment keeps this page consistent with the repo standard.

As per coding guidelines, "Avoid useMemo or useCallback - let the React Compiler handle memoization."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx`
around lines 62 - 72, The three scoring values in DomainDirectionPage are simple
derived computations, so remove the manual useMemo wrappers around
reviewer1Scoring, reviewer2Scoring, and finalScoring. Replace them with plain
assignments that call scoreRobinsDomain directly, keeping the same inputs
(domainKey and the corresponding answers) so the page follows the repo guideline
of letting the React Compiler handle memoization.

Source: Coding guidelines

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx (1)

52-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Drop the useMemo wrappers around the overall scoring.

This is derived render data, and the web-package guideline prefers the React Compiler over manual memoization here. Using direct assignments will keep the component aligned with the repo standard.

As per coding guidelines, "Avoid useMemo or useCallback - let the React Compiler handle memoization."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx`
around lines 52 - 54, Remove the manual useMemo wrappers in OverallDirectionPage
and assign the results of scoreAllDomains(checklist1),
scoreAllDomains(checklist2), and scoreAllDomains(finalChecklist) directly to
reviewer1Scoring, reviewer2Scoring, and finalScoring. Keep the scoring logic in
the same component, but rely on the React Compiler instead of explicit
memoization.

Source: Coding guidelines

packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx (1)

181-200: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove these useMemo wrappers.

These values are cheap to derive, and this package's React guidance explicitly asks not to use useMemo or useCallback here. Inline them and let the React Compiler handle memoization. As per coding guidelines, "Avoid useMemo or useCallback - let the React Compiler handle memoization".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx`
around lines 181 - 200, Remove the unnecessary useMemo wrappers in
NavbarDomainPill by computing pillStyle and tooltip inline instead of memoizing
them. The logic in the pillStyle and tooltip derivations is cheap and should
follow the package React guidance to avoid useMemo/useCallback, so keep the same
conditional behavior but assign the values directly within the component body.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx`:
- Around line 188-200: The tooltip fallback in NavbarDomainPill is treating
unset direction pills as mandatory work by showing "Needs reconciliation" for
optional fields. Update the tooltip logic in the useMemo block to special-case
DOMAIN_DIRECTION and OVERALL_DIRECTION so when they are unset and reviewers
differ, the status reads as optional/not set instead of needing reconciliation.
Keep the existing behavior for other item types and preserve the current
branches for isSkipped, hasValue, and agreement.

---

Nitpick comments:
In
`@packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx`:
- Around line 181-200: Remove the unnecessary useMemo wrappers in
NavbarDomainPill by computing pillStyle and tooltip inline instead of memoizing
them. The logic in the pillStyle and tooltip derivations is cheap and should
follow the package React guidance to avoid useMemo/useCallback, so keep the same
conditional behavior but assign the values directly within the component body.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx`:
- Around line 62-72: The three scoring values in DomainDirectionPage are simple
derived computations, so remove the manual useMemo wrappers around
reviewer1Scoring, reviewer2Scoring, and finalScoring. Replace them with plain
assignments that call scoreRobinsDomain directly, keeping the same inputs
(domainKey and the corresponding answers) so the page follows the repo guideline
of letting the React Compiler handle memoization.

In
`@packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx`:
- Around line 52-54: Remove the manual useMemo wrappers in OverallDirectionPage
and assign the results of scoreAllDomains(checklist1),
scoreAllDomains(checklist2), and scoreAllDomains(finalChecklist) directly to
reviewer1Scoring, reviewer2Scoring, and finalScoring. Keep the scoring logic in
the same component, but rely on the React Compiler instead of explicit
memoization.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad9fb220-9d09-4f5d-b16f-b89eda14226a

📥 Commits

Reviewing files that changed from the base of the PR and between 107cdd5 and 8aef716.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • .prettierignore
  • knip.config.ts
  • packages/shared/src/checklists/rob2/schema.ts
  • packages/web/e2e/rob2-workflow.spec.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/package.json
  • packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/vite.config.e2e.ts
  • packages/web/vite.config.ts
💤 Files with no reviewable changes (3)
  • knip.config.ts
  • packages/shared/src/checklists/rob2/schema.ts
  • packages/web/package.json
✅ Files skipped from review due to trivial changes (1)
  • .prettierignore
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/RobinsISummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/adapter.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: checks
🧰 Additional context used
📓 Path-based instructions (6)
**/*

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*: NEVER use emojis anywhere - not in code, comments, documentation, plan files, commit messages, or examples. This includes unicode symbols.
Never use emojis or unicode symbols - not in code, comments, docs, or commits

Files:

  • packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/e2e/rob2-workflow.spec.ts
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/vite.config.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/vite.config.e2e.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

For UI icons, use lucide-react library or SVGs only (never emojis)

Files:

  • packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/e2e/rob2-workflow.spec.ts
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/vite.config.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/vite.config.e2e.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx}: Use import aliases from tsconfig.json
Code comments should explain why something is being done or provide context, not repeat what the code is saying
Use TODO(agent) pattern for incomplete work or flagging items for future attention, with brief description and optional doc reference

Files:

  • packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/e2e/rob2-workflow.spec.ts
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/vite.config.ts
  • packages/web/e2e/shared-steps.ts
  • packages/web/vite.config.e2e.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
  • packages/web/e2e/robins-i-workflow.spec.ts
packages/web/src/components/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use shadcn/ui for UI components (Radix-based, in @/components/ui/)

Files:

  • packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
packages/web/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

packages/web/src/**/*.{tsx,ts}: Use lucide-react for the icon library
Use TanStack Query for server state management (useQuery, useMutation)
Import Zustand stores directly from @/stores/ instead of prop-drilling shared state
Avoid useMemo or useCallback - let the React Compiler handle memoization
Prefer newer React primitives where possible, always on the latest version
Use useEffectEvent for stable event handler references inside effects
Use useLayoutEffect for DOM measurements before paint
Use startTransition / useTransition for non-urgent state updates
Use useDeferredValue for deferring expensive re-renders
Use useSyncExternalStore for external store subscriptions (e.g., Yjs awareness)
Use useId() for unique IDs on form elements (radio buttons, checkboxes)
Never prop-drill shared state - import Zustand stores directly

Files:

  • packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
packages/web/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Path aliases: @/ maps to packages/web/src/

Files:

  • packages/web/src/components/checklist/ROBINSIChecklist/DomainJudgement.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/ROB2SummaryView.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/DomainDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx
  • packages/web/src/components/project/reconcile-tab/rob2-reconcile/adapter.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/pages/OverallDirectionPage.tsx
  • packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts
🪛 ast-grep (0.44.0)
packages/web/e2e/robins-i-workflow.spec.ts

[warning] 45-45: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(escapedOutcome, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity

(regexp-from-variable)


[warning] 45-45: Do not use variable for regular expressions
Context: new RegExp(escapedOutcome, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity. Security best practice.

(regexp-non-literal-typescript)

🔇 Additional comments (7)
packages/web/e2e/robins-i-workflow.spec.ts (1)

45-46: Still use an exact-match locator here.

Escaping fixed the metacharacter issue, but this regex still matches substrings, so similarly named outcomes can select the wrong option. The previous review already called out anchoring this with ^ and $.

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/navbar-utils.ts (1)

218-240: LGTM!

packages/web/src/components/project/reconcile-tab/rob2-reconcile/navbar-utils.ts (1)

227-265: LGTM!

packages/web/src/components/project/reconcile-tab/robins-i-reconcile/NavbarDomainPill.tsx (1)

6-6: LGTM!

Also applies to: 155-158, 168-177, 197-197

packages/web/e2e/rob2-workflow.spec.ts (1)

151-152: LGTM!

packages/web/e2e/shared-steps.ts (1)

138-154: LGTM!

packages/web/vite.config.ts (1)

14-20: 🎯 Functional Correctness

No action needed

InfinityBowman and others added 3 commits June 29, 2026 11:40
Follow-up to the value-presence indicator change: an unset direction
where reviewers differ was falling through to the "Needs reconciliation"
/ "Reviewers disagree" tooltip, making an optional field look mandatory.
Special-case DOMAIN_DIRECTION and OVERALL_DIRECTION so an unset one reads
as "Optional (not set)" in both the ROB-2 pill tooltip and the shared
ROBINS-I tooltip helper.
@InfinityBowman
InfinityBowman merged commit fef5cdd into main Jun 29, 2026
1 check passed
@InfinityBowman
InfinityBowman deleted the robins-remove-manual-override branch June 29, 2026 18:59
InfinityBowman added a commit that referenced this pull request Jul 6, 2026
…alog to all three reconcile screens via shared ResourcesDialog with per-tool link configs, show study name in the reconcile header, give nav pills their own full-width header row to fix clipping, exclude pre-domain items (ROB2 preliminary, ROBINS-I Section B) from the agreement rate, port ROB2 pill slide animation to ROBINS-I, and drop judgement-override copy from resources and tool pages after #522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants