initial commit

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic08e7c4b5b4f4072de9e2f9a701e977b6a6a6964
This commit is contained in:
raf 2026-01-30 16:46:39 +03:00
commit f8db097ba9
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
21 changed files with 4924 additions and 0 deletions

122
src/types.ts Normal file
View file

@ -0,0 +1,122 @@
export interface Config {
server: ServerConfig;
repositories: RepoConfig[];
filters: FiltersConfig;
engine: EngineConfig;
response: ResponseConfig;
logging: LoggingConfig;
}
export interface ServerConfig {
port: number;
rateLimit?: number;
}
export interface RepoConfig {
owner: string;
repo: string;
}
export interface FiltersConfig {
labels: {
include: string[];
exclude: string[];
};
authors: {
include?: string[];
exclude: string[];
};
branches: {
include: string[];
};
}
export interface EngineConfig {
backends: BackendsConfig;
weights: BackendWeights;
confidenceThreshold: number;
}
export interface BackendsConfig {
checks: ChecksBackendConfig;
diff: DiffBackendConfig;
quality: QualityBackendConfig;
}
export interface ChecksBackendConfig {
enabled: boolean;
}
export interface DiffBackendConfig {
enabled: boolean;
maxChanges: number;
requireTests: boolean;
}
export interface QualityBackendConfig {
enabled: boolean;
minBodyLength: number;
}
export interface BackendWeights {
checks: number;
diff: number;
quality: number;
}
export interface ResponseConfig {
includeConfidence: boolean;
includeReasoning: boolean;
messages: {
positive: string[];
negative: string[];
neutral: string[];
};
commentMarker: string;
allowUpdates: boolean;
}
export interface LoggingConfig {
level: string;
file: string;
}
export type Impact = 'positive' | 'negative' | 'neutral';
export interface AnalysisResult {
impact: Impact;
confidence: number;
reasoning: string;
}
export interface EngineBackend {
name: string;
analyze(event: WebhookEvent): Promise<AnalysisResult>;
}
export interface WebhookEvent {
action: string;
type: 'issue' | 'pull_request';
number: number;
title: string;
body: string;
owner: string;
repo: string;
author: string;
labels: string[];
branch?: string;
sha?: string;
}
export interface CheckRun {
name: string;
status: string;
conclusion: string | null;
}
export interface PRFile {
filename: string;
additions: number;
deletions: number;
changes: number;
}