PM-5203 approval phase ai only#1899
Merged
Merged
Conversation
…M-5203_approval-phase-ai-only
…M-5203_approval-phase-ai-only
There was a problem hiding this comment.
Pull request overview
This PR adds manager override support for AI review scores (including inline editing and comments) and introduces an AI-only Approval tab so AI-only challenges can be reviewed/overridden consistently across the review UI.
Changes:
- Added manager override fields to AI review decision models and introduced a PATCH API client to persist overrides.
- Updated AI review status normalization to reflect pass/fail based on overridden totals + minimum thresholds.
- Added a new AI-only Approval tab UI with editable AI workflow scores and manager comment confirmation.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/apps/work/src/lib/utils/challenge.utils.ts | Prefer submission.initialScore/finalScore (string) when computing displayed scores. |
| src/apps/work/src/lib/services/submissions.service.ts | Plumbs initialScore/finalScore through submission normalization. |
| src/apps/work/src/lib/models/Submission.model.ts | Adds initialScore/finalScore fields to the Work app submission model. |
| src/apps/review/src/pages/reviews/components/ReviewsSidebar/ReviewsSidebar.tsx | Uses threshold-aware decision status normalization for the “Overall Score” status. |
| src/apps/review/src/lib/services/aiReview.service.ts | Adds patchAiReviewDecision and override payload typing. |
| src/apps/review/src/lib/models/AiReview.model.ts | Adds manager override/comment fields to AI decision breakdown + decision-level manager comment. |
| src/apps/review/src/lib/hooks/useFetchAiWorkflowRuns.ts | Extends AI workflow run model with initialScore. |
| src/apps/review/src/lib/components/SubmissionHistoryModal/SubmissionHistoryModal.tsx | Makes decision status normalization threshold-aware for HUMAN_OVERRIDE. |
| src/apps/review/src/lib/components/CollapsibleAiReviewsRow/CollapsibleAiReviewsRow.tsx | Adds edit-mode plumbing to AiReviewsTable and threshold-aware status normalization. |
| src/apps/review/src/lib/components/ChallengeDetailsContent/TabContentAiApproval.tsx | New AI-only Approval tab with inline override editing + confirm modal workflow. |
| src/apps/review/src/lib/components/ChallengeDetailsContent/TabContentAiApproval.module.scss | Styles for the new AI-only Approval tab UI. |
| src/apps/review/src/lib/components/ChallengeDetailsContent/ChallengeDetailsContent.tsx | Switches Approval tab to AI-only Approval content when aiReviewConfig.mode === 'AI_ONLY'. |
| src/apps/review/src/lib/components/AiReviewsTable/AiReviewsTable.tsx | Adds override score rendering/edit inputs and attempts to show override indicators. |
| src/apps/review/src/lib/components/AiReviewsTable/AiReviewsTable.module.scss | Adds styles for inline override input + override indicator label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+416
to
+424
| const status = row.decision?.status ?? 'PENDING' | ||
| const statusMap: Record<string, { label: string; className: string }> = { | ||
| ERROR: { className: styles.statusError, label: 'Error' }, | ||
| FAILED: { className: styles.statusFailed, label: 'Failed' }, | ||
| HUMAN_OVERRIDE: { className: styles.statusOverride, label: 'Override' }, | ||
| PASSED: { className: styles.statusPassed, label: 'Passed' }, | ||
| PENDING: { className: styles.statusPending, label: 'Pending' }, | ||
| } | ||
| const config = statusMap[status] ?? statusMap.PENDING |
Comment on lines
+509
to
+513
| <CollapsibleAiReviewsRow | ||
| className={styles.aiReviews} | ||
| aiReviewers={aiReviewers} | ||
| submission={row.submission as any} | ||
| defaultOpen |
Comment on lines
+24
to
+33
| export interface WorkflowManagerOverride { | ||
| workflowId: string | ||
| managerScore?: number | null | ||
| workflowComment?: string | null | ||
| } | ||
|
|
||
| export interface PatchAiReviewDecisionPayload { | ||
| managerComment?: string | null | ||
| workflowOverrides?: WorkflowManagerOverride[] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-5203
What's in this PR?
This pull request introduces a manager override feature for AI review scores in the review application. It allows managers to override AI-generated scores with their own values and comments, which are then displayed throughout the review UI. The changes also improve the handling and display of AI review statuses, especially when overrides are involved, and add a new tab for AI-only approval phases.
Key changes include:
Manager Score Override Functionality:
AiReviewDecisionBreakdownWorkflowmodel, enabling storage and retrieval of override data.AiReviewsTableandCollapsibleAiReviewsRowcomponents to support edit mode, allowing managers to input override scores inline and display override indicators in the UI. [1] [2] [3] [4] [5]AiReviewsTable.module.scss.Status and Score Logic Improvements:
normalizeDecisionStatuslogic to correctly reflect pass/fail status after a human override, using the overridden score and minimum threshold. [1] [2] [3] [4] [5]AI-Only Approval Phase UI:
TabContentAiApprovalcomponent (and styles) for challenges in AI-only approval mode, displaying AI review results and override controls. (F02da68bL35R35, src/apps/review/src/lib/components/ChallengeDetailsContent/TabContentAiApproval.module.scssR1-R202)ChallengeDetailsContentto use the new AI approval tab when the challenge is in AI-only approval mode, including logic to handle future phases. [1] [2]These changes collectively enable a more flexible and transparent review process by allowing manager intervention in AI scoring and making such interventions visible in the user interface.