@eduardbar/drift 0.2.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -27,3 +27,88 @@ export interface DriftReport {
27
27
  byRule: Record<string, number>
28
28
  }
29
29
  }
30
+
31
+ export interface AIOutput {
32
+ summary: {
33
+ score: number
34
+ grade: string
35
+ total_issues: number
36
+ files_affected: number
37
+ files_clean: number
38
+ }
39
+ priority_order: AIIssue[]
40
+ context_for_ai: {
41
+ project_type: string
42
+ scan_path: string
43
+ rules_detected: string[]
44
+ recommended_action: string
45
+ }
46
+ }
47
+
48
+ export interface AIIssue {
49
+ rank: number
50
+ file: string
51
+ line: number
52
+ rule: string
53
+ severity: string
54
+ message: string
55
+ snippet: string
56
+ fix_suggestion: string
57
+ effort: 'low' | 'medium' | 'high'
58
+ }
59
+
60
+ // ---------------------------------------------------------------------------
61
+ // Configuration
62
+ // ---------------------------------------------------------------------------
63
+
64
+ /**
65
+ * Layer definition for architectural boundary enforcement.
66
+ */
67
+ export interface LayerDefinition {
68
+ name: string
69
+ patterns: string[]
70
+ canImportFrom: string[]
71
+ }
72
+
73
+ /**
74
+ * Module boundary definition for cross-boundary enforcement.
75
+ */
76
+ export interface ModuleBoundary {
77
+ name: string
78
+ root: string
79
+ allowedExternalImports?: string[]
80
+ }
81
+
82
+ /**
83
+ * Optional project-level configuration for drift.
84
+ * Place in drift.config.ts (or .js / .json) at the project root.
85
+ */
86
+ export interface DriftConfig {
87
+ layers?: LayerDefinition[]
88
+ modules?: ModuleBoundary[]
89
+ }
90
+
91
+ // ---------------------------------------------------------------------------
92
+ // Diff
93
+ // ---------------------------------------------------------------------------
94
+
95
+ export interface FileDiff {
96
+ path: string // path relativo al project root
97
+ scoreBefore: number
98
+ scoreAfter: number
99
+ scoreDelta: number // positivo = empeoró (más deuda), negativo = mejoró
100
+ newIssues: DriftIssue[]
101
+ resolvedIssues: DriftIssue[]
102
+ }
103
+
104
+ export interface DriftDiff {
105
+ baseRef: string // git ref del baseline (e.g. "HEAD~1", "main")
106
+ projectPath: string // path absoluto del proyecto
107
+ scannedAt: string // ISO timestamp
108
+ files: FileDiff[] // solo archivos con cambios (delta != 0 o issues diff != 0)
109
+ totalScoreBefore: number
110
+ totalScoreAfter: number
111
+ totalDelta: number // positivo = más deuda, negativo = menos deuda
112
+ newIssuesCount: number
113
+ resolvedIssuesCount: number
114
+ }