faf-cli 3.0.6 → 3.1.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.
- package/README.md +275 -25
- package/dist/big-orange/compare.d.ts.map +1 -1
- package/dist/big-orange/compare.js +14 -16
- package/dist/big-orange/compare.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +137 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/auto.d.ts.map +1 -1
- package/dist/commands/auto.js +69 -12
- package/dist/commands/auto.js.map +1 -1
- package/dist/commands/bi-sync.d.ts.map +1 -1
- package/dist/commands/bi-sync.js +10 -3
- package/dist/commands/bi-sync.js.map +1 -1
- package/dist/commands/drift.d.ts +16 -0
- package/dist/commands/drift.d.ts.map +1 -0
- package/dist/commands/drift.js +517 -0
- package/dist/commands/drift.js.map +1 -0
- package/dist/commands/git.d.ts +25 -0
- package/dist/commands/git.d.ts.map +1 -0
- package/dist/commands/git.js +355 -0
- package/dist/commands/git.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +11 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +85 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/rename.d.ts +18 -0
- package/dist/commands/rename.d.ts.map +1 -0
- package/dist/commands/rename.js +211 -0
- package/dist/commands/rename.js.map +1 -0
- package/dist/commands/taf-init.d.ts +14 -0
- package/dist/commands/taf-init.d.ts.map +1 -0
- package/dist/commands/taf-init.js +138 -0
- package/dist/commands/taf-init.js.map +1 -0
- package/dist/commands/taf-log.d.ts +30 -0
- package/dist/commands/taf-log.d.ts.map +1 -0
- package/dist/commands/taf-log.js +303 -0
- package/dist/commands/taf-log.js.map +1 -0
- package/dist/commands/taf-stats.d.ts +8 -0
- package/dist/commands/taf-stats.d.ts.map +1 -0
- package/dist/commands/taf-stats.js +133 -0
- package/dist/commands/taf-stats.js.map +1 -0
- package/dist/commands/taf-validate.d.ts +8 -0
- package/dist/commands/taf-validate.d.ts.map +1 -0
- package/dist/commands/taf-validate.js +108 -0
- package/dist/commands/taf-validate.js.map +1 -0
- package/dist/commands/taf.d.ts +13 -0
- package/dist/commands/taf.d.ts.map +1 -0
- package/dist/commands/taf.js +97 -0
- package/dist/commands/taf.js.map +1 -0
- package/dist/compiler/faf-compiler.d.ts.map +1 -1
- package/dist/compiler/faf-compiler.js +18 -0
- package/dist/compiler/faf-compiler.js.map +1 -1
- package/dist/generators/faf-generator-championship.d.ts.map +1 -1
- package/dist/generators/faf-generator-championship.js +1 -0
- package/dist/generators/faf-generator-championship.js.map +1 -1
- package/dist/github/github-extractor.d.ts +56 -0
- package/dist/github/github-extractor.d.ts.map +1 -0
- package/dist/github/github-extractor.js +328 -0
- package/dist/github/github-extractor.js.map +1 -0
- package/dist/github/popular-repos.d.ts +43 -0
- package/dist/github/popular-repos.d.ts.map +1 -0
- package/dist/github/popular-repos.js +205 -0
- package/dist/github/popular-repos.js.map +1 -0
- package/dist/github/repo-selector.d.ts +48 -0
- package/dist/github/repo-selector.d.ts.map +1 -0
- package/dist/github/repo-selector.js +277 -0
- package/dist/github/repo-selector.js.map +1 -0
- package/dist/taf/index.d.ts +17 -0
- package/dist/taf/index.d.ts.map +1 -0
- package/dist/taf/index.js +57 -0
- package/dist/taf/index.js.map +1 -0
- package/dist/taf/logger.d.ts +88 -0
- package/dist/taf/logger.d.ts.map +1 -0
- package/dist/taf/logger.js +137 -0
- package/dist/taf/logger.js.map +1 -0
- package/dist/taf/parser.d.ts +32 -0
- package/dist/taf/parser.d.ts.map +1 -0
- package/dist/taf/parser.js +161 -0
- package/dist/taf/parser.js.map +1 -0
- package/dist/taf/stats.d.ts +31 -0
- package/dist/taf/stats.d.ts.map +1 -0
- package/dist/taf/stats.js +182 -0
- package/dist/taf/stats.js.map +1 -0
- package/dist/taf/types.d.ts +77 -0
- package/dist/taf/types.d.ts.map +1 -0
- package/dist/taf/types.js +9 -0
- package/dist/taf/types.js.map +1 -0
- package/dist/taf/validator.d.ts +18 -0
- package/dist/taf/validator.d.ts.map +1 -0
- package/dist/taf/validator.js +148 -0
- package/dist/taf/validator.js.map +1 -0
- package/dist/utils/file-utils.d.ts +10 -0
- package/dist/utils/file-utils.d.ts.map +1 -1
- package/dist/utils/file-utils.js +196 -33
- package/dist/utils/file-utils.js.map +1 -1
- package/dist/utils/native-file-finder.js +1 -1
- package/dist/utils/native-file-finder.js.map +1 -1
- package/dist/utils/yaml-generator.d.ts +1 -0
- package/dist/utils/yaml-generator.d.ts.map +1 -1
- package/dist/utils/yaml-generator.js +1 -0
- package/dist/utils/yaml-generator.js.map +1 -1
- package/package.json +9 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TAF Parser - MCP-portable YAML parsing
|
|
3
|
+
*
|
|
4
|
+
* Pure functions for reading/writing .taf files
|
|
5
|
+
* No CLI dependencies - ready for MCP extraction
|
|
6
|
+
*/
|
|
7
|
+
import { TAFFile } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Parse .taf file content from YAML string
|
|
10
|
+
* MCP-portable: takes string, returns object
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseTAF(content: string): TAFFile;
|
|
13
|
+
/**
|
|
14
|
+
* Serialize TAF object to YAML string
|
|
15
|
+
* MCP-portable: takes object, returns string
|
|
16
|
+
*/
|
|
17
|
+
export declare function serializeTAF(taf: TAFFile): string;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new TAF file structure
|
|
20
|
+
* MCP-portable: pure function
|
|
21
|
+
*/
|
|
22
|
+
export declare function createTAF(project: string, options?: {
|
|
23
|
+
faf_associated?: boolean;
|
|
24
|
+
faf_location?: string;
|
|
25
|
+
faf_score?: number;
|
|
26
|
+
}): TAFFile;
|
|
27
|
+
/**
|
|
28
|
+
* Format TAF file with proper comments and structure
|
|
29
|
+
* MCP-portable: string transformation
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatTAF(content: string): string;
|
|
32
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/taf/parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAyCjD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAMjD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAeV;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2CjD"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TAF Parser - MCP-portable YAML parsing
|
|
4
|
+
*
|
|
5
|
+
* Pure functions for reading/writing .taf files
|
|
6
|
+
* No CLI dependencies - ready for MCP extraction
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.parseTAF = parseTAF;
|
|
43
|
+
exports.serializeTAF = serializeTAF;
|
|
44
|
+
exports.createTAF = createTAF;
|
|
45
|
+
exports.formatTAF = formatTAF;
|
|
46
|
+
const yaml = __importStar(require("yaml"));
|
|
47
|
+
/**
|
|
48
|
+
* Parse .taf file content from YAML string
|
|
49
|
+
* MCP-portable: takes string, returns object
|
|
50
|
+
*/
|
|
51
|
+
function parseTAF(content) {
|
|
52
|
+
try {
|
|
53
|
+
// Split on document separator and take only first document
|
|
54
|
+
const lines = content.split('\n');
|
|
55
|
+
const yamlLines = [];
|
|
56
|
+
for (const line of lines) {
|
|
57
|
+
// Stop at document separator (but skip initial one if present)
|
|
58
|
+
if (line.trim() === '---' && yamlLines.length > 0) {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
// Skip initial document separator
|
|
62
|
+
if (line.trim() === '---' && yamlLines.length === 0) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
yamlLines.push(line);
|
|
66
|
+
}
|
|
67
|
+
const parsed = yaml.parse(yamlLines.join('\n'));
|
|
68
|
+
// Validate required fields
|
|
69
|
+
if (!parsed.format_version) {
|
|
70
|
+
throw new Error('Missing required field: format_version');
|
|
71
|
+
}
|
|
72
|
+
if (!parsed.project) {
|
|
73
|
+
throw new Error('Missing required field: project');
|
|
74
|
+
}
|
|
75
|
+
if (!parsed.created) {
|
|
76
|
+
throw new Error('Missing required field: created');
|
|
77
|
+
}
|
|
78
|
+
if (!parsed.test_history || !Array.isArray(parsed.test_history)) {
|
|
79
|
+
throw new Error('Missing or invalid field: test_history');
|
|
80
|
+
}
|
|
81
|
+
return parsed;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (error instanceof Error) {
|
|
85
|
+
throw new Error(`Failed to parse .taf file: ${error.message}`);
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Serialize TAF object to YAML string
|
|
92
|
+
* MCP-portable: takes object, returns string
|
|
93
|
+
*/
|
|
94
|
+
function serializeTAF(taf) {
|
|
95
|
+
return yaml.stringify(taf, {
|
|
96
|
+
lineWidth: 0, // No line wrapping
|
|
97
|
+
defaultStringType: 'QUOTE_DOUBLE',
|
|
98
|
+
defaultKeyType: 'PLAIN',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a new TAF file structure
|
|
103
|
+
* MCP-portable: pure function
|
|
104
|
+
*/
|
|
105
|
+
function createTAF(project, options) {
|
|
106
|
+
const now = new Date().toISOString();
|
|
107
|
+
return {
|
|
108
|
+
format_version: '1.0.0',
|
|
109
|
+
project,
|
|
110
|
+
created: now,
|
|
111
|
+
last_updated: now,
|
|
112
|
+
...(options?.faf_associated !== undefined && {
|
|
113
|
+
faf_associated: options.faf_associated,
|
|
114
|
+
faf_location: options.faf_location || '.faf',
|
|
115
|
+
faf_score: options.faf_score,
|
|
116
|
+
}),
|
|
117
|
+
test_history: [],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Format TAF file with proper comments and structure
|
|
122
|
+
* MCP-portable: string transformation
|
|
123
|
+
*/
|
|
124
|
+
function formatTAF(content) {
|
|
125
|
+
const lines = content.split('\n');
|
|
126
|
+
const formatted = [];
|
|
127
|
+
// Add header comment
|
|
128
|
+
formatted.push('# .taf - Testing Activity Feed');
|
|
129
|
+
// Process lines
|
|
130
|
+
let inTestHistory = false;
|
|
131
|
+
for (const line of lines) {
|
|
132
|
+
if (line.startsWith('format_version:')) {
|
|
133
|
+
formatted.push(line);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (line.startsWith('project:') || line.startsWith('created:') || line.startsWith('last_updated:')) {
|
|
137
|
+
formatted.push(line);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (line.startsWith('faf_associated:')) {
|
|
141
|
+
if (!formatted.some(l => l.includes('# FAF Integration'))) {
|
|
142
|
+
formatted.push('');
|
|
143
|
+
formatted.push('# FAF Integration (Optional - Native Reference)');
|
|
144
|
+
}
|
|
145
|
+
formatted.push(line);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (line.startsWith('test_history:')) {
|
|
149
|
+
if (!inTestHistory) {
|
|
150
|
+
formatted.push('');
|
|
151
|
+
formatted.push('# Test execution history (append-only)');
|
|
152
|
+
inTestHistory = true;
|
|
153
|
+
}
|
|
154
|
+
formatted.push(line);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
formatted.push(line);
|
|
158
|
+
}
|
|
159
|
+
return formatted.join('\n');
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingUR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AAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TAF Stats Calculator - MCP-portable statistics
|
|
3
|
+
*
|
|
4
|
+
* Pure functions for calculating test statistics
|
|
5
|
+
* Ready for MCP extraction
|
|
6
|
+
*/
|
|
7
|
+
import { TAFFile, TAFStats, TAFScoreContribution } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Calculate statistics from TAF file
|
|
10
|
+
* MCP-portable: pure function
|
|
11
|
+
*/
|
|
12
|
+
export declare function calculateStats(taf: TAFFile): TAFStats;
|
|
13
|
+
/**
|
|
14
|
+
* Calculate .taf contribution to .faf AI-readiness score
|
|
15
|
+
* MCP-portable: pure function
|
|
16
|
+
*/
|
|
17
|
+
export declare function calculateScoreContribution(taf: TAFFile): TAFScoreContribution;
|
|
18
|
+
/**
|
|
19
|
+
* Get pass rate trend (improving/declining/stable)
|
|
20
|
+
* MCP-portable: pure function
|
|
21
|
+
*/
|
|
22
|
+
export declare function getPassRateTrend(taf: TAFFile, window?: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get failure patterns for WJTTC analysis
|
|
25
|
+
* MCP-portable: pure function
|
|
26
|
+
*/
|
|
27
|
+
export declare function getFailurePatterns(taf: TAFFile): {
|
|
28
|
+
most_common_issues: string[];
|
|
29
|
+
failure_rate_by_hour: Record<number, number>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/taf/stats.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAElE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAsErD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAyB7E;AAcD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,MAAM,CAiB1E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG;IAChD,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C,CAuCA"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TAF Stats Calculator - MCP-portable statistics
|
|
4
|
+
*
|
|
5
|
+
* Pure functions for calculating test statistics
|
|
6
|
+
* Ready for MCP extraction
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.calculateStats = calculateStats;
|
|
10
|
+
exports.calculateScoreContribution = calculateScoreContribution;
|
|
11
|
+
exports.getPassRateTrend = getPassRateTrend;
|
|
12
|
+
exports.getFailurePatterns = getFailurePatterns;
|
|
13
|
+
/**
|
|
14
|
+
* Calculate statistics from TAF file
|
|
15
|
+
* MCP-portable: pure function
|
|
16
|
+
*/
|
|
17
|
+
function calculateStats(taf) {
|
|
18
|
+
const runs = taf.test_history;
|
|
19
|
+
const total_runs = runs.length;
|
|
20
|
+
if (total_runs === 0) {
|
|
21
|
+
return {
|
|
22
|
+
total_runs: 0,
|
|
23
|
+
pass_rate: '0%',
|
|
24
|
+
health_score: '🤍',
|
|
25
|
+
current_streak: 0,
|
|
26
|
+
longest_streak: 0,
|
|
27
|
+
total_failures: 0,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// Calculate pass rate
|
|
31
|
+
const passes = runs.filter(r => r.result === 'PASSED').length;
|
|
32
|
+
const pass_rate_decimal = passes / total_runs;
|
|
33
|
+
const pass_rate = `${Math.round(pass_rate_decimal * 100)}%`;
|
|
34
|
+
// Calculate health score (podium emoji)
|
|
35
|
+
const health_score = getHealthScore(pass_rate_decimal);
|
|
36
|
+
// Calculate streaks
|
|
37
|
+
let current_streak = 0;
|
|
38
|
+
let longest_streak = 0;
|
|
39
|
+
let temp_streak = 0;
|
|
40
|
+
for (let i = runs.length - 1; i >= 0; i--) {
|
|
41
|
+
if (runs[i].result === 'PASSED') {
|
|
42
|
+
temp_streak++;
|
|
43
|
+
if (i === runs.length - 1) {
|
|
44
|
+
current_streak = temp_streak;
|
|
45
|
+
}
|
|
46
|
+
longest_streak = Math.max(longest_streak, temp_streak);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
if (i < runs.length - 1) {
|
|
50
|
+
break; // Stop counting current streak
|
|
51
|
+
}
|
|
52
|
+
temp_streak = 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Count total failures
|
|
56
|
+
const total_failures = runs.filter(r => r.result === 'FAILED').length;
|
|
57
|
+
// Calculate average recovery time
|
|
58
|
+
const recovery_times = [];
|
|
59
|
+
for (const run of runs) {
|
|
60
|
+
if (run.recovery?.time_to_fix_minutes) {
|
|
61
|
+
recovery_times.push(run.recovery.time_to_fix_minutes);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const avg_recovery_time_minutes = recovery_times.length > 0
|
|
65
|
+
? Math.round(recovery_times.reduce((sum, t) => sum + t, 0) / recovery_times.length)
|
|
66
|
+
: undefined;
|
|
67
|
+
// Last run timestamp
|
|
68
|
+
const last_run = runs[runs.length - 1]?.timestamp;
|
|
69
|
+
return {
|
|
70
|
+
total_runs,
|
|
71
|
+
pass_rate,
|
|
72
|
+
health_score,
|
|
73
|
+
last_run,
|
|
74
|
+
current_streak,
|
|
75
|
+
longest_streak,
|
|
76
|
+
total_failures,
|
|
77
|
+
avg_recovery_time_minutes,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Calculate .taf contribution to .faf AI-readiness score
|
|
82
|
+
* MCP-portable: pure function
|
|
83
|
+
*/
|
|
84
|
+
function calculateScoreContribution(taf) {
|
|
85
|
+
let taf_present = 5; // File exists
|
|
86
|
+
let taf_validated = 0;
|
|
87
|
+
let pass_rate_bonus = 0;
|
|
88
|
+
// Validate structure
|
|
89
|
+
if (taf.format_version && taf.project && taf.created && Array.isArray(taf.test_history)) {
|
|
90
|
+
taf_validated = 5;
|
|
91
|
+
}
|
|
92
|
+
// Check pass rate
|
|
93
|
+
if (taf.test_history.length > 0) {
|
|
94
|
+
const stats = calculateStats(taf);
|
|
95
|
+
const pass_rate_num = parseInt(stats.pass_rate.replace('%', ''));
|
|
96
|
+
if (pass_rate_num > 80) {
|
|
97
|
+
pass_rate_bonus = 5;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
taf_present,
|
|
102
|
+
taf_validated,
|
|
103
|
+
pass_rate_bonus,
|
|
104
|
+
total: taf_present + taf_validated + pass_rate_bonus,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get health score emoji based on pass rate
|
|
109
|
+
* MCP-portable: pure function
|
|
110
|
+
*/
|
|
111
|
+
function getHealthScore(pass_rate) {
|
|
112
|
+
if (pass_rate >= 0.95)
|
|
113
|
+
return '🏆'; // Trophy: 95%+
|
|
114
|
+
if (pass_rate >= 0.85)
|
|
115
|
+
return '🥇'; // Gold: 85%+
|
|
116
|
+
if (pass_rate >= 0.70)
|
|
117
|
+
return '🥈'; // Silver: 70%+
|
|
118
|
+
if (pass_rate >= 0.50)
|
|
119
|
+
return '🥉'; // Bronze: 50%+
|
|
120
|
+
return '🤍'; // White heart: <50%
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get pass rate trend (improving/declining/stable)
|
|
124
|
+
* MCP-portable: pure function
|
|
125
|
+
*/
|
|
126
|
+
function getPassRateTrend(taf, window = 10) {
|
|
127
|
+
const runs = taf.test_history;
|
|
128
|
+
if (runs.length < 2)
|
|
129
|
+
return 'stable';
|
|
130
|
+
const recent = runs.slice(-window);
|
|
131
|
+
const older = runs.slice(-window * 2, -window);
|
|
132
|
+
if (older.length === 0)
|
|
133
|
+
return 'stable';
|
|
134
|
+
const recentPassRate = recent.filter(r => r.result === 'PASSED').length / recent.length;
|
|
135
|
+
const olderPassRate = older.filter(r => r.result === 'PASSED').length / older.length;
|
|
136
|
+
const diff = recentPassRate - olderPassRate;
|
|
137
|
+
if (diff > 0.1)
|
|
138
|
+
return 'improving';
|
|
139
|
+
if (diff < -0.1)
|
|
140
|
+
return 'declining';
|
|
141
|
+
return 'stable';
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get failure patterns for WJTTC analysis
|
|
145
|
+
* MCP-portable: pure function
|
|
146
|
+
*/
|
|
147
|
+
function getFailurePatterns(taf) {
|
|
148
|
+
const issues = {};
|
|
149
|
+
const hourCounts = {};
|
|
150
|
+
for (const run of taf.test_history) {
|
|
151
|
+
// Count issues
|
|
152
|
+
if (run.issues) {
|
|
153
|
+
for (const issue of run.issues) {
|
|
154
|
+
issues[issue] = (issues[issue] || 0) + 1;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Count failures by hour
|
|
158
|
+
const hour = new Date(run.timestamp).getHours();
|
|
159
|
+
if (!hourCounts[hour]) {
|
|
160
|
+
hourCounts[hour] = { total: 0, failures: 0 };
|
|
161
|
+
}
|
|
162
|
+
hourCounts[hour].total++;
|
|
163
|
+
if (run.result === 'FAILED') {
|
|
164
|
+
hourCounts[hour].failures++;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// Sort issues by frequency
|
|
168
|
+
const most_common_issues = Object.entries(issues)
|
|
169
|
+
.sort((a, b) => b[1] - a[1])
|
|
170
|
+
.slice(0, 5)
|
|
171
|
+
.map(([issue]) => issue);
|
|
172
|
+
// Calculate failure rate by hour
|
|
173
|
+
const failure_rate_by_hour = {};
|
|
174
|
+
for (const [hour, counts] of Object.entries(hourCounts)) {
|
|
175
|
+
failure_rate_by_hour[parseInt(hour)] = counts.failures / counts.total;
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
most_common_issues,
|
|
179
|
+
failure_rate_by_hour,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/taf/stats.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAQH,wCAsEC;AAMD,gEAyBC;AAkBD,4CAiBC;AAMD,gDA0CC;AA5LD;;;GAGG;AACH,SAAgB,cAAc,CAAC,GAAY;IACzC,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC;IAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;IAE/B,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO;YACL,UAAU,EAAE,CAAC;YACb,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,CAAC;SAClB,CAAC;IACJ,CAAC;IAED,sBAAsB;IACtB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,CAAC;IAC9C,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,GAAG,GAAG,CAAC,GAAG,CAAC;IAE5D,wCAAwC;IACxC,MAAM,YAAY,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAEvD,oBAAoB;IACpB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,cAAc,GAAG,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IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACxD,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;IACxE,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,oBAAoB;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TAF (Testing Activity Feed) Core Types
|
|
3
|
+
*
|
|
4
|
+
* MCP-portable type definitions for .taf format
|
|
5
|
+
* Used by: faf-cli, claude-faf-mcp, claude-taf-mcp (future)
|
|
6
|
+
*/
|
|
7
|
+
export interface TAFFile {
|
|
8
|
+
format_version: string;
|
|
9
|
+
project: string;
|
|
10
|
+
created: string;
|
|
11
|
+
last_updated?: string;
|
|
12
|
+
faf_associated?: boolean;
|
|
13
|
+
faf_location?: string;
|
|
14
|
+
faf_score?: number;
|
|
15
|
+
test_history: TestRun[];
|
|
16
|
+
}
|
|
17
|
+
export interface TestRun {
|
|
18
|
+
timestamp: string;
|
|
19
|
+
run_id?: string;
|
|
20
|
+
command?: string;
|
|
21
|
+
trigger?: string;
|
|
22
|
+
result: TestResult;
|
|
23
|
+
suites?: TestCounts;
|
|
24
|
+
tests: TestCounts;
|
|
25
|
+
duration_ms?: number;
|
|
26
|
+
exit_code?: number;
|
|
27
|
+
issues?: string[];
|
|
28
|
+
root_cause?: string;
|
|
29
|
+
resolution?: string;
|
|
30
|
+
changes_since_last?: string[];
|
|
31
|
+
recovery?: RecoveryInfo;
|
|
32
|
+
environment?: EnvironmentInfo;
|
|
33
|
+
}
|
|
34
|
+
export interface TestCounts {
|
|
35
|
+
total: number;
|
|
36
|
+
passed: number;
|
|
37
|
+
failed: number;
|
|
38
|
+
skipped?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface RecoveryInfo {
|
|
41
|
+
previous_result?: TestResult;
|
|
42
|
+
time_to_fix_minutes?: number;
|
|
43
|
+
fix_summary?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface EnvironmentInfo {
|
|
46
|
+
variance?: EnvironmentVariance[];
|
|
47
|
+
notes?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface EnvironmentVariance {
|
|
50
|
+
type: VarianceType;
|
|
51
|
+
description: string;
|
|
52
|
+
detected_at?: string;
|
|
53
|
+
}
|
|
54
|
+
export type VarianceType = 'background_execution' | 'unstable_cwd' | 'missing_dependencies' | 'parallel_execution' | 'resource_contention' | 'network_unavailable' | 'timing_sensitive' | 'other';
|
|
55
|
+
export type TestResult = 'PASSED' | 'FAILED' | 'IMPROVED' | 'DEGRADED';
|
|
56
|
+
export interface TAFStats {
|
|
57
|
+
total_runs: number;
|
|
58
|
+
pass_rate: string;
|
|
59
|
+
health_score: string;
|
|
60
|
+
last_run?: string;
|
|
61
|
+
current_streak: number;
|
|
62
|
+
longest_streak: number;
|
|
63
|
+
total_failures: number;
|
|
64
|
+
avg_recovery_time_minutes?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface TAFValidationResult {
|
|
67
|
+
valid: boolean;
|
|
68
|
+
errors: string[];
|
|
69
|
+
warnings: string[];
|
|
70
|
+
}
|
|
71
|
+
export interface TAFScoreContribution {
|
|
72
|
+
taf_present: number;
|
|
73
|
+
taf_validated: number;
|
|
74
|
+
pass_rate_bonus: number;
|
|
75
|
+
total: number;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/taf/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,OAAO;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,cAAc,CAAC,EAAE,OAAO,CAAC;IAC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M,MAAM,YAAY,GACpB,sBAAsB,GACtB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,kBAAkB,GAClB,OAAO,CAAC;AAEZ,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TAF (Testing Activity Feed) Core Types
|
|
4
|
+
*
|
|
5
|
+
* MCP-portable type definitions for .taf format
|
|
6
|
+
* Used by: faf-cli, claude-faf-mcp, claude-taf-mcp (future)
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/taf/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TAF Validator - MCP-portable validation logic
|
|
3
|
+
*
|
|
4
|
+
* Pure validation functions with no external dependencies
|
|
5
|
+
* Ready for MCP extraction
|
|
6
|
+
*/
|
|
7
|
+
import { TAFFile, TAFValidationResult } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Validate TAF file structure and content
|
|
10
|
+
* MCP-portable: pure function
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateTAF(taf: TAFFile): TAFValidationResult;
|
|
13
|
+
/**
|
|
14
|
+
* Quick validation check (for MCP tools)
|
|
15
|
+
* Returns true if .taf file is valid, false otherwise
|
|
16
|
+
*/
|
|
17
|
+
export declare function isTAFValid(taf: TAFFile): boolean;
|
|
18
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/taf/validator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAW,MAAM,SAAS,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CA6D7D;AA0ED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGhD"}
|