Implement rejection handling for tasks that fail quality gates after all continuation attempts are exhausted. Schema: - Add TaskRejection model for tracking rejections - Store failures, attempts, escalation state Service: - handleRejection: Main entry point for rejection handling - logRejection: Database logging - determineEscalation: Rule-based escalation determination - executeEscalation: Execute escalation actions - sendNotification: Notification dispatch - markForManualReview: Flag tasks for human review - getRejectionHistory: Query rejection history - generateRejectionReport: Markdown report generation Escalation rules: - max-attempts: Trigger after 3+ attempts - time-exceeded: Trigger after 2+ hours - critical-failure: Trigger on security/critical issues Actions: notify, block, reassign, cancel Tests: 16 passing with 80% statement coverage Fixes #139 Co-Authored-By: Claude Opus 4.5 <[email protected]>
11 lines
326 B
TypeScript
11 lines
326 B
TypeScript
import { Module } from "@nestjs/common";
|
|
import { RejectionHandlerService } from "./rejection-handler.service";
|
|
import { PrismaModule } from "../prisma/prisma.module";
|
|
|
|
@Module({
|
|
imports: [PrismaModule],
|
|
providers: [RejectionHandlerService],
|
|
exports: [RejectionHandlerService],
|
|
})
|
|
export class RejectionHandlerModule {}
|