@vibe-validate/cli 0.17.6 → 0.18.0-rc.1

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.
Files changed (81) hide show
  1. package/dist/bin/vibe-validate +4 -0
  2. package/dist/bin/vibe-validate.js +4 -0
  3. package/dist/bin/vibe-validate.js.map +1 -1
  4. package/dist/bin/vv +4 -0
  5. package/dist/commands/cleanup.d.ts.map +1 -1
  6. package/dist/commands/cleanup.js +5 -2
  7. package/dist/commands/cleanup.js.map +1 -1
  8. package/dist/commands/config.d.ts.map +1 -1
  9. package/dist/commands/config.js +3 -1
  10. package/dist/commands/config.js.map +1 -1
  11. package/dist/commands/create-extractor.d.ts.map +1 -1
  12. package/dist/commands/create-extractor.js +3 -1
  13. package/dist/commands/create-extractor.js.map +1 -1
  14. package/dist/commands/doctor.d.ts.map +1 -1
  15. package/dist/commands/doctor.js +11 -5
  16. package/dist/commands/doctor.js.map +1 -1
  17. package/dist/commands/generate-workflow.d.ts.map +1 -1
  18. package/dist/commands/generate-workflow.js +6 -2
  19. package/dist/commands/generate-workflow.js.map +1 -1
  20. package/dist/commands/history.d.ts.map +1 -1
  21. package/dist/commands/history.js +19 -9
  22. package/dist/commands/history.js.map +1 -1
  23. package/dist/commands/init.d.ts.map +1 -1
  24. package/dist/commands/init.js +3 -1
  25. package/dist/commands/init.js.map +1 -1
  26. package/dist/commands/pre-commit.d.ts.map +1 -1
  27. package/dist/commands/pre-commit.js +3 -1
  28. package/dist/commands/pre-commit.js.map +1 -1
  29. package/dist/commands/run.d.ts.map +1 -1
  30. package/dist/commands/run.js +11 -9
  31. package/dist/commands/run.js.map +1 -1
  32. package/dist/commands/state.d.ts.map +1 -1
  33. package/dist/commands/state.js +11 -6
  34. package/dist/commands/state.js.map +1 -1
  35. package/dist/commands/watch-pr.d.ts +16 -0
  36. package/dist/commands/watch-pr.d.ts.map +1 -1
  37. package/dist/commands/watch-pr.js +574 -320
  38. package/dist/commands/watch-pr.js.map +1 -1
  39. package/dist/schemas/watch-pr-result.schema.d.ts +2010 -0
  40. package/dist/schemas/watch-pr-result.schema.d.ts.map +1 -0
  41. package/dist/schemas/watch-pr-result.schema.js +335 -0
  42. package/dist/schemas/watch-pr-result.schema.js.map +1 -0
  43. package/dist/schemas/watch-pr-schema.d.ts +6 -6
  44. package/dist/services/cache-manager.d.ts +113 -0
  45. package/dist/services/cache-manager.d.ts.map +1 -0
  46. package/dist/services/cache-manager.js +211 -0
  47. package/dist/services/cache-manager.js.map +1 -0
  48. package/dist/services/ci-providers/github-actions.d.ts.map +1 -1
  49. package/dist/services/ci-providers/github-actions.js +10 -16
  50. package/dist/services/ci-providers/github-actions.js.map +1 -1
  51. package/dist/services/external-check-extractor.d.ts +66 -0
  52. package/dist/services/external-check-extractor.d.ts.map +1 -0
  53. package/dist/services/external-check-extractor.js +114 -0
  54. package/dist/services/external-check-extractor.js.map +1 -0
  55. package/dist/services/extraction-mode-detector.d.ts +85 -0
  56. package/dist/services/extraction-mode-detector.d.ts.map +1 -0
  57. package/dist/services/extraction-mode-detector.js +200 -0
  58. package/dist/services/extraction-mode-detector.js.map +1 -0
  59. package/dist/services/github-fetcher.d.ts +210 -0
  60. package/dist/services/github-fetcher.d.ts.map +1 -0
  61. package/dist/services/github-fetcher.js +412 -0
  62. package/dist/services/github-fetcher.js.map +1 -0
  63. package/dist/services/history-summary-builder.d.ts +74 -0
  64. package/dist/services/history-summary-builder.d.ts.map +1 -0
  65. package/dist/services/history-summary-builder.js +199 -0
  66. package/dist/services/history-summary-builder.js.map +1 -0
  67. package/dist/services/watch-pr-orchestrator.d.ts +119 -0
  68. package/dist/services/watch-pr-orchestrator.d.ts.map +1 -0
  69. package/dist/services/watch-pr-orchestrator.js +420 -0
  70. package/dist/services/watch-pr-orchestrator.js.map +1 -0
  71. package/dist/utils/command-name.d.ts +21 -0
  72. package/dist/utils/command-name.d.ts.map +1 -0
  73. package/dist/utils/command-name.js +45 -0
  74. package/dist/utils/command-name.js.map +1 -0
  75. package/dist/utils/pid-lock.d.ts.map +1 -1
  76. package/dist/utils/pid-lock.js +3 -3
  77. package/dist/utils/pid-lock.js.map +1 -1
  78. package/dist/utils/temp-files.d.ts.map +1 -1
  79. package/dist/utils/temp-files.js +2 -2
  80. package/dist/utils/temp-files.js.map +1 -1
  81. package/package.json +7 -7
@@ -0,0 +1,200 @@
1
+ /**
2
+ * ExtractionModeDetector - Detect and extract errors from GitHub Actions logs
3
+ *
4
+ * Supports two modes:
5
+ * 1. Matrix mode: Validate YAML output with extraction field (pass through faithfully)
6
+ * 2. Non-matrix mode: Raw test output (detect extractor and extract errors)
7
+ *
8
+ * Try matrix first, fall back to non-matrix if YAML not found.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import { autoDetectAndExtract } from '@vibe-validate/extractors';
13
+ import YAML from 'yaml';
14
+ /**
15
+ * ExtractionModeDetector - Detect extraction mode and extract errors
16
+ *
17
+ * Tries matrix mode first (YAML with extraction field), falls back to non-matrix mode.
18
+ */
19
+ export class ExtractionModeDetector {
20
+ /**
21
+ * Detect extraction mode and extract errors
22
+ *
23
+ * @param check - GitHub Actions check
24
+ * @param logs - Raw log output
25
+ * @returns ErrorExtractorResult or null if extraction failed
26
+ */
27
+ async detectAndExtract(check, logs) {
28
+ // Handle empty logs
29
+ if (!logs || logs.trim().length === 0) {
30
+ return null;
31
+ }
32
+ // Try matrix mode first
33
+ const matrixResult = await this.extractFromMatrixMode(logs);
34
+ if (matrixResult) {
35
+ return matrixResult;
36
+ }
37
+ // Fall back to non-matrix mode
38
+ return await this.extractFromNonMatrixMode(check.name, logs);
39
+ }
40
+ /**
41
+ * Extract from matrix mode (validate YAML output)
42
+ *
43
+ * Looks for YAML markers (---...---) and extracts the "extraction" field.
44
+ *
45
+ * @param logs - Raw log output
46
+ * @returns ErrorExtractorResult or null if not matrix mode
47
+ */
48
+ async extractFromMatrixMode(logs) {
49
+ try {
50
+ // Strip GitHub Actions log prefixes from each line
51
+ // Format: <job-name>\t<step-name>\t[BOM]<timestamp> <content>
52
+ // Where BOM is optional UTF-8 BOM (U+FEFF)
53
+ const cleanedLogs = logs
54
+ .split('\n')
55
+ .map((line) => this.stripLogPrefix(line))
56
+ .join('\n');
57
+ // Find YAML document between --- markers (using RegExp.exec for sonarjs compliance)
58
+ // eslint-disable-next-line sonarjs/slow-regex -- NOSONAR: False positive - regex is safe for YAML markers
59
+ const yamlRegex = /^---\s*\n([\s\S]*?)\n---\s*$/m;
60
+ const yamlMatch = yamlRegex.exec(cleanedLogs);
61
+ if (!yamlMatch) {
62
+ return null;
63
+ }
64
+ // Parse and extract from YAML
65
+ const yamlContent = yamlMatch[1];
66
+ const parsed = YAML.parse(yamlContent);
67
+ if (!parsed || typeof parsed !== 'object') {
68
+ return null;
69
+ }
70
+ // Try extracting from root level first, then nested
71
+ return this.extractFromYAML(parsed);
72
+ }
73
+ catch {
74
+ // YAML parsing failed - not matrix mode
75
+ return null;
76
+ }
77
+ }
78
+ /**
79
+ * Extract from non-matrix mode (raw test output)
80
+ *
81
+ * Detects extractor from check name or logs, then runs extraction.
82
+ *
83
+ * @param _checkName - Check name (unused - autoDetectAndExtract handles detection)
84
+ * @param logs - Raw log output
85
+ * @returns ErrorExtractorResult or null if extraction failed
86
+ */
87
+ async extractFromNonMatrixMode(_checkName, logs) {
88
+ try {
89
+ // Strip GitHub Actions log prefixes (same cleaning as matrix mode)
90
+ const cleanedLogs = logs
91
+ .split('\n')
92
+ .map((line) => this.stripLogPrefix(line))
93
+ .join('\n');
94
+ // Use autoDetectAndExtract from @vibe-validate/extractors
95
+ // It handles extractor detection and extraction automatically
96
+ return autoDetectAndExtract(cleanedLogs);
97
+ }
98
+ catch {
99
+ // Extraction failed
100
+ return null;
101
+ }
102
+ }
103
+ /**
104
+ * Strip GitHub Actions log prefix from a single line
105
+ *
106
+ * @param line - Log line
107
+ * @returns Cleaned line
108
+ */
109
+ stripLogPrefix(line) {
110
+ // Match GitHub Actions log prefix (job name + step name + timestamp with optional BOM)
111
+ // Example: "Run job\tStep name\t2025-12-16T16:33:10.1212265Z content"
112
+ const githubActionsRegex = /^[^\t]+\t[^\t]+\t\uFEFF?\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z\s(.*)$/;
113
+ const githubMatch = githubActionsRegex.exec(line);
114
+ if (githubMatch) {
115
+ return githubMatch[1]; // Return content after prefix
116
+ }
117
+ // Fall back to simple timestamp stripping (for non-GitHub Actions logs)
118
+ const timestampRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z\s(.*)$/;
119
+ const timestampMatch = timestampRegex.exec(line);
120
+ if (timestampMatch) {
121
+ return timestampMatch[1]; // Return content after timestamp and space
122
+ }
123
+ return line; // Return line as-is if no prefix matched
124
+ }
125
+ /**
126
+ * Extract ErrorExtractorResult from parsed YAML
127
+ *
128
+ * Tries root level first (vibe-validate run output), then nested (vibe-validate validate output)
129
+ *
130
+ * @param parsed - Parsed YAML object
131
+ * @returns ErrorExtractorResult or null
132
+ */
133
+ extractFromYAML(parsed) {
134
+ // Check if extraction field exists at root (vibe-validate run output)
135
+ if ('extraction' in parsed) {
136
+ const extraction = this.validateExtraction(parsed.extraction);
137
+ if (extraction) {
138
+ return extraction;
139
+ }
140
+ }
141
+ // Check if extraction is nested in phases/steps (vibe-validate validate output)
142
+ if ('phases' in parsed && Array.isArray(parsed.phases)) {
143
+ return this.extractFromPhases(parsed.phases);
144
+ }
145
+ return null;
146
+ }
147
+ /**
148
+ * Extract ErrorExtractorResult from phases array (validate output)
149
+ *
150
+ * @param phases - Phases array
151
+ * @returns ErrorExtractorResult or null
152
+ */
153
+ extractFromPhases(phases) {
154
+ for (const phase of phases) {
155
+ const extraction = this.extractFromPhaseSteps(phase);
156
+ if (extraction) {
157
+ return extraction;
158
+ }
159
+ }
160
+ return null;
161
+ }
162
+ /**
163
+ * Extract ErrorExtractorResult from a single phase's steps
164
+ *
165
+ * @param phase - Phase object
166
+ * @returns ErrorExtractorResult or null
167
+ */
168
+ extractFromPhaseSteps(phase) {
169
+ if (!phase || typeof phase !== 'object' || !('steps' in phase) || !Array.isArray(phase.steps)) {
170
+ return null;
171
+ }
172
+ for (const step of phase.steps) {
173
+ if (step && typeof step === 'object' && 'extraction' in step) {
174
+ const extraction = this.validateExtraction(step.extraction);
175
+ if (extraction) {
176
+ // Return first extraction found (usually the failed step)
177
+ return extraction;
178
+ }
179
+ }
180
+ }
181
+ return null;
182
+ }
183
+ /**
184
+ * Validate extraction structure
185
+ *
186
+ * @param extraction - Extraction object
187
+ * @returns ErrorExtractorResult or null
188
+ */
189
+ validateExtraction(extraction) {
190
+ if (extraction &&
191
+ typeof extraction === 'object' &&
192
+ 'summary' in extraction &&
193
+ 'totalErrors' in extraction &&
194
+ 'errors' in extraction) {
195
+ return extraction;
196
+ }
197
+ return null;
198
+ }
199
+ }
200
+ //# sourceMappingURL=extraction-mode-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction-mode-detector.js","sourceRoot":"","sources":["../../src/services/extraction-mode-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,gBAAgB,CAAC,KAAwB,EAAE,IAAY;QAC3D,oBAAoB;QACpB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,wBAAwB;QACxB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,+BAA+B;QAC/B,OAAO,MAAM,IAA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
+ * Uses `gh` CLI to fetch:
5
+ * - Complete PR metadata (title, author, labels, linked issues, etc.)
6
+ * - Check results (GitHub Actions + external status checks)
7
+ * - Run logs from GitHub Actions
8
+ * - File changes from git diff
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import type { ChangesContext, CheckConclusion, CheckStatus, PRMetadata } from '../schemas/watch-pr-result.schema.js';
13
+ /**
14
+ * Check result (internal type for classification)
15
+ */
16
+ export interface CheckResult {
17
+ /** Check type (github_action or external) */
18
+ type: 'github_action' | 'external';
19
+ /** Check name */
20
+ name: string;
21
+ /** Check status */
22
+ status: CheckStatus;
23
+ /** Check conclusion (if completed) */
24
+ conclusion?: CheckConclusion;
25
+ /** GitHub run ID (for GitHub Actions) */
26
+ run_id?: number;
27
+ /** Workflow name (for GitHub Actions) */
28
+ workflow?: string;
29
+ /** Started at (ISO 8601) */
30
+ started_at?: string;
31
+ /** Duration (human-readable) */
32
+ duration?: string;
33
+ /** URL (for external checks) */
34
+ url?: string;
35
+ /** Provider name (for external checks) */
36
+ provider?: string;
37
+ }
38
+ /**
39
+ * Run details (returned by fetchRunDetails)
40
+ */
41
+ export interface RunDetails {
42
+ /** GitHub run ID */
43
+ run_id: number;
44
+ /** Check/job name */
45
+ name: string;
46
+ /** Workflow name */
47
+ workflow: string;
48
+ /** Run status */
49
+ status: CheckStatus;
50
+ /** Run conclusion (if completed) */
51
+ conclusion?: CheckConclusion;
52
+ /** Started at (ISO 8601) */
53
+ started_at: string;
54
+ /** Duration (human-readable) */
55
+ duration: string;
56
+ /** Run URL */
57
+ url: string;
58
+ }
59
+ /**
60
+ * GitHubFetcher - Fetch PR data from GitHub API via gh CLI
61
+ */
62
+ export declare class GitHubFetcher {
63
+ private readonly owner?;
64
+ private readonly repo?;
65
+ /**
66
+ * Create GitHubFetcher
67
+ *
68
+ * @param owner - Repository owner (optional, defaults to current repo)
69
+ * @param repo - Repository name (optional, defaults to current repo)
70
+ */
71
+ constructor(owner?: string, repo?: string);
72
+ /**
73
+ * Fetch complete PR metadata
74
+ *
75
+ * @param prNumber - PR number
76
+ * @returns PR metadata
77
+ */
78
+ fetchPRDetails(prNumber: number): Promise<PRMetadata>;
79
+ /**
80
+ * Fetch check results (GitHub Actions + external)
81
+ *
82
+ * @param prNumber - PR number
83
+ * @returns Check results
84
+ */
85
+ fetchChecks(prNumber: number): Promise<CheckResult[]>;
86
+ /**
87
+ * Fetch run logs for a GitHub Actions run
88
+ *
89
+ * @param runId - GitHub run ID
90
+ * @returns Raw log output
91
+ */
92
+ fetchRunLogs(runId: number): Promise<string>;
93
+ /**
94
+ * Fetch details for a specific GitHub Actions run
95
+ *
96
+ * Useful for watching specific failed runs to test extraction.
97
+ *
98
+ * @param runId - GitHub run ID
99
+ * @returns Run details
100
+ */
101
+ fetchRunDetails(runId: number): Promise<RunDetails>;
102
+ /**
103
+ * Fetch all workflow runs for a PR
104
+ *
105
+ * @param prNumber - PR number
106
+ * @returns List of workflow runs
107
+ */
108
+ fetchRunsForPR(prNumber: number): Promise<Array<{
109
+ run_id: number;
110
+ workflow_name: string;
111
+ status: string;
112
+ conclusion: string | null;
113
+ started_at: string;
114
+ }>>;
115
+ /**
116
+ * Fetch file changes for a PR
117
+ *
118
+ * Uses git diff --numstat to get file change statistics.
119
+ *
120
+ * @param _prNumber - PR number (unused - we use git diff from current branch)
121
+ * @returns File change context
122
+ */
123
+ fetchFileChanges(_prNumber: number): Promise<ChangesContext>;
124
+ /**
125
+ * Classify check type
126
+ *
127
+ * @param check - Check object from GitHub API
128
+ * @returns 'CheckRun' or 'StatusContext'
129
+ */
130
+ private classifyCheck;
131
+ /**
132
+ * Map CheckRun to internal CheckResult
133
+ *
134
+ * @param check - CheckRun from GitHub API
135
+ * @returns CheckResult
136
+ */
137
+ private mapCheckRun;
138
+ /**
139
+ * Map StatusContext to internal CheckResult
140
+ *
141
+ * @param check - StatusContext from GitHub API
142
+ * @returns CheckResult
143
+ */
144
+ private mapStatusContext;
145
+ /**
146
+ * Extract run ID from GitHub Actions URL
147
+ *
148
+ * @param url - GitHub Actions URL
149
+ * @returns Run ID or null
150
+ */
151
+ private extractRunId;
152
+ /**
153
+ * Extract workflow name from check name
154
+ *
155
+ * @param checkName - Check name (e.g., "CI / Build")
156
+ * @returns Workflow name
157
+ */
158
+ private extractWorkflowName;
159
+ /**
160
+ * Calculate duration between two timestamps
161
+ *
162
+ * @param start - Start time (ISO 8601)
163
+ * @param end - End time (ISO 8601, optional - defaults to now)
164
+ * @returns Human-readable duration (e.g., "2m30s")
165
+ */
166
+ private calculateDuration;
167
+ /**
168
+ * Normalize GitHub status to CheckStatus
169
+ *
170
+ * @param status - GitHub status
171
+ * @returns CheckStatus
172
+ */
173
+ private normalizeStatus;
174
+ /**
175
+ * Normalize GitHub conclusion to CheckConclusion
176
+ *
177
+ * @param conclusion - GitHub conclusion
178
+ * @returns CheckConclusion
179
+ */
180
+ private normalizeConclusion;
181
+ /**
182
+ * Normalize StatusContext state to CheckConclusion
183
+ *
184
+ * @param state - StatusContext state
185
+ * @returns CheckConclusion
186
+ */
187
+ private normalizeStatusContextState;
188
+ /**
189
+ * Normalize merge state status
190
+ *
191
+ * @param status - GitHub merge state status
192
+ * @returns MergeStateStatus
193
+ */
194
+ private normalizeMergeStateStatus;
195
+ /**
196
+ * Extract linked issues from closing issues references
197
+ *
198
+ * @param closingIssuesReferences - Closing issues references from GitHub API
199
+ * @returns Linked issues
200
+ */
201
+ private extractLinkedIssues;
202
+ /**
203
+ * Detect provider from check name
204
+ *
205
+ * @param checkName - Check name
206
+ * @returns Provider name
207
+ */
208
+ private detectProvider;
209
+ }
210
+ //# sourceMappingURL=github-fetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-fetcher.d.ts","sourceRoot":"","sources":["../../src/services/github-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EAIX,UAAU,EACX,MAAM,sCAAsC,CAAC;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