PM-5203 approval phase ai only#44
Merged
Merged
Conversation
…nto PM-5203_approval-phase-ai-only
There was a problem hiding this comment.
Pull request overview
This PR tightens the AI Review/Approval phase lifecycle in the challenge workflow so phases don’t close (and AI-only challenges don’t finalize) until required AI decisions and approval conditions are satisfied.
Changes:
- Block closing the AI Review phase when there are pending AI decisions, in both the API-driven phase advance path and the scheduler-driven closure path.
- Adjust AI-only Approval phase closure behavior to skip human reviewer coverage/completion checks and close on schedule.
- Refine AI decision passing logic by applying
minPassingThresholdchecks forHUMAN_OVERRIDE, and add tests around the new AI Review closure blocking.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/review/review.service.ts |
Adds pending-AI-decision counting and updates AI decision summary logic to incorporate minPassingThreshold. |
src/challenge/challenge-api.service.ts |
Blocks API phase closure for AI Review when pending AI decisions exist (via a new DB query helper). |
src/challenge/challenge-api.service.spec.ts |
Adds unit tests for the AI Review closure blocking behavior. |
src/autopilot/services/scheduler.service.ts |
Extends scheduler phase-closure gating for AI Review (pending decisions) and adjusts Approval closure rules for AI-only challenges. |
src/autopilot/services/challenge-completion.service.ts |
Defers AI-only finalization until Approval is closed and reorders summation finalization calls. |
package.json |
Adds a deploy:dev script for pushing a branch-based dev-* tag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1049
to
+1050
| const minPassingThreshold = Number(row.minPassingThreshold); | ||
| const hasValidThreshold = Number.isFinite(minPassingThreshold); |
Comment on lines
+837
to
+841
| // Also check for pending AI decisions | ||
| const pendingAiDecisions = | ||
| await this.reviewService.getPendingAiDecisionsCount( | ||
| data.challengeId, | ||
| ); |
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.
This pull request introduces several important changes to improve the handling and reliability of AI Review and Approval phases in the challenge workflow. The main focus is to ensure that phases are only closed when all necessary AI decisions are finalized, and to correctly handle the Approval phase for AI-only challenges. Additional improvements include more robust passing score logic and enhanced test coverage.
AI Review and Approval Phase Handling:
ChallengeApiServiceandSchedulerService, ensuring that all AI decisions are finalized before phase closure. [1] [2] [3] [4]Review and Passing Score Logic:
Challenge Finalization Logic:
ChallengeCompletionService, finalization is now deferred if the Approval phase is still open or incomplete, ensuring winners are only determined after all manager overrides are applied. Also,finalizeSummationsis now called after these checks. [1] [2] [3]Testing Improvements:
Other:
deploy:devscript topackage.jsonfor streamlined development deployments.