82 lines
1.6 KiB
TypeScript
82 lines
1.6 KiB
TypeScript
/**
|
|
* 계획 계약 타입 정의
|
|
*/
|
|
|
|
/** 계약 등급 */
|
|
export type ContractGrade = 'A' | 'B' | 'C' | 'D' | 'F';
|
|
|
|
/** 조항 검증 결과 */
|
|
export interface ClauseResult {
|
|
passed: boolean;
|
|
issues: string[];
|
|
}
|
|
|
|
/** 목표 정의 */
|
|
export interface Goal {
|
|
description: string;
|
|
criteria: string[];
|
|
produces?: string[];
|
|
subGoals?: string[];
|
|
}
|
|
|
|
/** 계획 단계 */
|
|
export interface PlanStep {
|
|
id: string;
|
|
description: string;
|
|
command?: string;
|
|
dependencies?: string[];
|
|
requiredResources?: string[];
|
|
timeout?: number;
|
|
expectedOutcome?: string;
|
|
assertions?: string[];
|
|
produces?: string[];
|
|
}
|
|
|
|
/** 리스크 정의 */
|
|
export interface Risk {
|
|
id: string;
|
|
description: string;
|
|
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
mitigation?: string;
|
|
alternativePath?: string;
|
|
}
|
|
|
|
/** 롤백 명령 */
|
|
export interface RollbackCommand {
|
|
id: string;
|
|
command: string;
|
|
order: number;
|
|
verification?: string;
|
|
}
|
|
|
|
/** 계획 */
|
|
export interface Plan {
|
|
id: string;
|
|
goal: Goal;
|
|
steps: PlanStep[];
|
|
risks?: Risk[];
|
|
estimatedDuration?: number;
|
|
timeoutStrategy?: string;
|
|
rollbackCommands?: RollbackCommand[];
|
|
}
|
|
|
|
/** 에피타이드 (실행 결과 기록) */
|
|
export interface Epitaph {
|
|
planId: string;
|
|
timestamp: string;
|
|
grade: ContractGrade;
|
|
clauses: {
|
|
goalClarity: ClauseResult;
|
|
stepCompleteness: ClauseResult;
|
|
executability: ClauseResult;
|
|
riskAssessment: ClauseResult;
|
|
verifiability: ClauseResult;
|
|
temporalConstraints: ClauseResult;
|
|
rollbackCapability: ClauseResult;
|
|
};
|
|
executionResult: {
|
|
status: 'success' | 'partial' | 'failure';
|
|
duration: number;
|
|
deviationFromPlan?: string | null;
|
|
};
|
|
}
|