feat: Implement GitHub issue validation endpoint and UI integration

- Added a new endpoint for validating GitHub issues using the Claude SDK.
- Introduced validation schema and logic to handle issue validation requests.
- Updated GitHub routes to include the new validation route.
- Enhanced the UI with a validation dialog and button to trigger issue validation.
- Mapped issue complexity to feature priority for better task management.
- Integrated validation results display in the UI, allowing users to convert validated issues into tasks.
This commit is contained in:
Kacper
2025-12-23 15:50:10 +01:00
parent d4d4b8fb3d
commit a881d175bc
9 changed files with 835 additions and 5 deletions

View File

@@ -81,3 +81,15 @@ export {
THINKING_LEVEL_LABELS,
getModelDisplayName,
} from './model-display.js';
// Issue validation types
export type {
IssueValidationVerdict,
IssueValidationConfidence,
IssueComplexity,
IssueValidationInput,
IssueValidationRequest,
IssueValidationResult,
IssueValidationResponse,
IssueValidationErrorResponse,
} from './issue-validation.js';

View File

@@ -0,0 +1,78 @@
/**
* Issue Validation Types
*
* Types for validating GitHub issues against the codebase using Claude SDK.
*/
/**
* Verdict from issue validation
*/
export type IssueValidationVerdict = 'valid' | 'invalid' | 'needs_clarification';
/**
* Confidence level of the validation
*/
export type IssueValidationConfidence = 'high' | 'medium' | 'low';
/**
* Complexity estimation for valid issues
*/
export type IssueComplexity = 'trivial' | 'simple' | 'moderate' | 'complex' | 'very_complex';
/**
* Issue data for validation (without projectPath)
* Used by UI when calling the validation API
*/
export interface IssueValidationInput {
issueNumber: number;
issueTitle: string;
issueBody: string;
issueLabels?: string[];
}
/**
* Full request payload for issue validation endpoint
* Includes projectPath for server-side handling
*/
export interface IssueValidationRequest extends IssueValidationInput {
projectPath: string;
}
/**
* Result from Claude's issue validation analysis
*/
export interface IssueValidationResult {
/** Whether the issue is valid, invalid, or needs clarification */
verdict: IssueValidationVerdict;
/** How confident the AI is in its assessment */
confidence: IssueValidationConfidence;
/** Detailed explanation of the verdict */
reasoning: string;
/** For bug reports: whether the bug was confirmed in the codebase */
bugConfirmed?: boolean;
/** Files related to the issue found during analysis */
relatedFiles?: string[];
/** Suggested approach to fix or implement */
suggestedFix?: string;
/** Information that's missing and needed for validation (when verdict = needs_clarification) */
missingInfo?: string[];
/** Estimated effort to address the issue */
estimatedComplexity?: IssueComplexity;
}
/**
* Successful response from validate-issue endpoint
*/
export interface IssueValidationResponse {
success: true;
issueNumber: number;
validation: IssueValidationResult;
}
/**
* Error response from validate-issue endpoint
*/
export interface IssueValidationErrorResponse {
success: false;
error: string;
}