docs: Add overlap analysis for non-AI coordinator patterns
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Detailed comparison showing: - Existing doc addresses L-015 (premature completion) - New doc addresses context exhaustion (multi-issue orchestration) - ~20% overlap (both use non-AI coordinator, mechanical gates) - 80% complementary (different problems, different solutions) Recommends merging into comprehensive document (already done). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
25
apps/api/src/token-budget/dto/allocate-budget.dto.ts
Normal file
25
apps/api/src/token-budget/dto/allocate-budget.dto.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { IsString, IsUUID, IsInt, IsIn, Min } from "class-validator";
|
||||
import type { TaskComplexity } from "../interfaces";
|
||||
|
||||
/**
|
||||
* DTO for allocating a token budget for a task
|
||||
*/
|
||||
export class AllocateBudgetDto {
|
||||
@IsUUID("4", { message: "taskId must be a valid UUID" })
|
||||
taskId!: string;
|
||||
|
||||
@IsUUID("4", { message: "workspaceId must be a valid UUID" })
|
||||
workspaceId!: string;
|
||||
|
||||
@IsString({ message: "agentId must be a string" })
|
||||
agentId!: string;
|
||||
|
||||
@IsIn(["low", "medium", "high", "critical"], {
|
||||
message: "complexity must be one of: low, medium, high, critical",
|
||||
})
|
||||
complexity!: TaskComplexity;
|
||||
|
||||
@IsInt({ message: "allocatedTokens must be an integer" })
|
||||
@Min(1, { message: "allocatedTokens must be at least 1" })
|
||||
allocatedTokens!: number;
|
||||
}
|
||||
33
apps/api/src/token-budget/dto/budget-analysis.dto.ts
Normal file
33
apps/api/src/token-budget/dto/budget-analysis.dto.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* DTO for budget analysis results
|
||||
*/
|
||||
export class BudgetAnalysisDto {
|
||||
taskId: string;
|
||||
allocatedTokens: number;
|
||||
usedTokens: number;
|
||||
remainingTokens: number;
|
||||
utilizationPercentage: number;
|
||||
suspiciousPattern: boolean;
|
||||
suspiciousReason: string | null;
|
||||
recommendation: "accept" | "continue" | "review";
|
||||
|
||||
constructor(data: {
|
||||
taskId: string;
|
||||
allocatedTokens: number;
|
||||
usedTokens: number;
|
||||
remainingTokens: number;
|
||||
utilizationPercentage: number;
|
||||
suspiciousPattern: boolean;
|
||||
suspiciousReason: string | null;
|
||||
recommendation: "accept" | "continue" | "review";
|
||||
}) {
|
||||
this.taskId = data.taskId;
|
||||
this.allocatedTokens = data.allocatedTokens;
|
||||
this.usedTokens = data.usedTokens;
|
||||
this.remainingTokens = data.remainingTokens;
|
||||
this.utilizationPercentage = data.utilizationPercentage;
|
||||
this.suspiciousPattern = data.suspiciousPattern;
|
||||
this.suspiciousReason = data.suspiciousReason;
|
||||
this.recommendation = data.recommendation;
|
||||
}
|
||||
}
|
||||
3
apps/api/src/token-budget/dto/index.ts
Normal file
3
apps/api/src/token-budget/dto/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./allocate-budget.dto";
|
||||
export * from "./update-usage.dto";
|
||||
export * from "./budget-analysis.dto";
|
||||
14
apps/api/src/token-budget/dto/update-usage.dto.ts
Normal file
14
apps/api/src/token-budget/dto/update-usage.dto.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { IsInt, Min } from "class-validator";
|
||||
|
||||
/**
|
||||
* DTO for updating token usage for a task
|
||||
*/
|
||||
export class UpdateUsageDto {
|
||||
@IsInt({ message: "inputTokens must be an integer" })
|
||||
@Min(0, { message: "inputTokens must be non-negative" })
|
||||
inputTokens!: number;
|
||||
|
||||
@IsInt({ message: "outputTokens must be an integer" })
|
||||
@Min(0, { message: "outputTokens must be non-negative" })
|
||||
outputTokens!: number;
|
||||
}
|
||||
Reference in New Issue
Block a user