Skip to content

PM-5203 approval phase ai only#1899

Merged
vas3a merged 21 commits into
devfrom
PM-5203_approval-phase-ai-only
Jun 5, 2026
Merged

PM-5203 approval phase ai only#1899
vas3a merged 21 commits into
devfrom
PM-5203_approval-phase-ai-only

Conversation

@vas3a
Copy link
Copy Markdown
Collaborator

@vas3a vas3a commented Jun 4, 2026

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:

  • Added support for manager score overrides and comments to the AiReviewDecisionBreakdownWorkflow model, enabling storage and retrieval of override data.
  • Updated AiReviewsTable and CollapsibleAiReviewsRow components to support edit mode, allowing managers to input override scores inline and display override indicators in the UI. [1] [2] [3] [4] [5]
  • Added new styles for override input fields, override indicators, and related UI elements in AiReviewsTable.module.scss.

Status and Score Logic Improvements:

  • Enhanced the normalizeDecisionStatus logic to correctly reflect pass/fail status after a human override, using the overridden score and minimum threshold. [1] [2] [3] [4] [5]
  • Updated score display logic to show both original and overridden scores where appropriate, and to indicate when a score has been overridden. [1] [2] [3]

AI-Only Approval Phase UI:

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 thread src/apps/work/src/lib/services/submissions.service.ts
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[]
}
@vas3a vas3a merged commit 40eaae2 into dev Jun 5, 2026
8 checks passed
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