mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 08:53:36 +00:00
Merge pull request #250 from AutoMaker-Org/feat/convert-issues-to-task
feat: abbility to analyze github issues with ai with confidence / task creation
This commit is contained in:
@@ -13,6 +13,9 @@ export {
|
||||
getImagesDir,
|
||||
getContextDir,
|
||||
getWorktreesDir,
|
||||
getValidationsDir,
|
||||
getValidationDir,
|
||||
getValidationPath,
|
||||
getAppSpecPath,
|
||||
getBranchTrackingPath,
|
||||
ensureAutomakerDir,
|
||||
|
||||
@@ -111,6 +111,44 @@ export function getWorktreesDir(projectPath: string): string {
|
||||
return path.join(getAutomakerDir(projectPath), 'worktrees');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validations directory for a project
|
||||
*
|
||||
* Stores GitHub issue validation results, organized by issue number.
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @returns Absolute path to {projectPath}/.automaker/validations
|
||||
*/
|
||||
export function getValidationsDir(projectPath: string): string {
|
||||
return path.join(getAutomakerDir(projectPath), 'validations');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the directory for a specific issue validation
|
||||
*
|
||||
* Contains validation result and metadata for a GitHub issue.
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @param issueNumber - GitHub issue number
|
||||
* @returns Absolute path to {projectPath}/.automaker/validations/{issueNumber}
|
||||
*/
|
||||
export function getValidationDir(projectPath: string, issueNumber: number): string {
|
||||
return path.join(getValidationsDir(projectPath), String(issueNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation result file path for a GitHub issue
|
||||
*
|
||||
* Stores the JSON validation result including verdict, analysis, and metadata.
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @param issueNumber - GitHub issue number
|
||||
* @returns Absolute path to {projectPath}/.automaker/validations/{issueNumber}/validation.json
|
||||
*/
|
||||
export function getValidationPath(projectPath: string, issueNumber: number): string {
|
||||
return path.join(getValidationDir(projectPath, issueNumber), 'validation.json');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the app spec file path for a project
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@ export type EventType =
|
||||
| 'project:analysis-completed'
|
||||
| 'project:analysis-error'
|
||||
| 'suggestions:event'
|
||||
| 'spec-regeneration:event';
|
||||
| 'spec-regeneration:event'
|
||||
| 'issue-validation:event';
|
||||
|
||||
export type EventCallback = (type: EventType, payload: unknown) => void;
|
||||
|
||||
@@ -81,3 +81,17 @@ export {
|
||||
THINKING_LEVEL_LABELS,
|
||||
getModelDisplayName,
|
||||
} from './model-display.js';
|
||||
|
||||
// Issue validation types
|
||||
export type {
|
||||
IssueValidationVerdict,
|
||||
IssueValidationConfidence,
|
||||
IssueComplexity,
|
||||
IssueValidationInput,
|
||||
IssueValidationRequest,
|
||||
IssueValidationResult,
|
||||
IssueValidationResponse,
|
||||
IssueValidationErrorResponse,
|
||||
IssueValidationEvent,
|
||||
StoredValidation,
|
||||
} from './issue-validation.js';
|
||||
|
||||
135
libs/types/src/issue-validation.ts
Normal file
135
libs/types/src/issue-validation.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* Issue Validation Types
|
||||
*
|
||||
* Types for validating GitHub issues against the codebase using Claude SDK.
|
||||
*/
|
||||
|
||||
import type { AgentModel } from './model.js';
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Events emitted during async issue validation
|
||||
*/
|
||||
export type IssueValidationEvent =
|
||||
| {
|
||||
type: 'issue_validation_start';
|
||||
issueNumber: number;
|
||||
issueTitle: string;
|
||||
projectPath: string;
|
||||
}
|
||||
| {
|
||||
type: 'issue_validation_progress';
|
||||
issueNumber: number;
|
||||
content: string;
|
||||
projectPath: string;
|
||||
}
|
||||
| {
|
||||
type: 'issue_validation_complete';
|
||||
issueNumber: number;
|
||||
issueTitle: string;
|
||||
result: IssueValidationResult;
|
||||
projectPath: string;
|
||||
/** Model used for validation (opus, sonnet, haiku) */
|
||||
model: AgentModel;
|
||||
}
|
||||
| {
|
||||
type: 'issue_validation_error';
|
||||
issueNumber: number;
|
||||
error: string;
|
||||
projectPath: string;
|
||||
}
|
||||
| {
|
||||
type: 'issue_validation_viewed';
|
||||
issueNumber: number;
|
||||
projectPath: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stored validation data with metadata for cache
|
||||
*/
|
||||
export interface StoredValidation {
|
||||
/** GitHub issue number */
|
||||
issueNumber: number;
|
||||
/** Issue title at time of validation */
|
||||
issueTitle: string;
|
||||
/** ISO timestamp when validation was performed */
|
||||
validatedAt: string;
|
||||
/** Model used for validation (opus, sonnet, haiku) */
|
||||
model: AgentModel;
|
||||
/** The validation result */
|
||||
result: IssueValidationResult;
|
||||
/** ISO timestamp when user viewed this validation (undefined = not yet viewed) */
|
||||
viewedAt?: string;
|
||||
}
|
||||
@@ -261,6 +261,8 @@ export interface GlobalSettings {
|
||||
// AI Model Selection
|
||||
/** Which model to use for feature name/description enhancement */
|
||||
enhancementModel: AgentModel;
|
||||
/** Which model to use for GitHub issue validation */
|
||||
validationModel: AgentModel;
|
||||
|
||||
// Input Configuration
|
||||
/** User's keyboard shortcut bindings */
|
||||
@@ -437,6 +439,7 @@ export const DEFAULT_GLOBAL_SETTINGS: GlobalSettings = {
|
||||
defaultAIProfileId: null,
|
||||
muteDoneSound: false,
|
||||
enhancementModel: 'sonnet',
|
||||
validationModel: 'opus',
|
||||
keyboardShortcuts: DEFAULT_KEYBOARD_SHORTCUTS,
|
||||
aiProfiles: [],
|
||||
projects: [],
|
||||
|
||||
Reference in New Issue
Block a user