qfai 0.5.0 → 0.6.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/dist/index.d.cts CHANGED
@@ -44,6 +44,7 @@ type ValidationResult = {
44
44
  type FailOn = "never" | "warning" | "error";
45
45
  type OutputFormat = "text" | "github";
46
46
  type TraceabilitySeverity = "warning" | "error";
47
+ type OrphanContractsPolicy = "error" | "warning" | "allow";
47
48
  type QfaiPaths = {
48
49
  contractsDir: string;
49
50
  specsDir: string;
@@ -64,7 +65,7 @@ type QfaiValidationConfig = {
64
65
  testFileGlobs: string[];
65
66
  testFileExcludeGlobs: string[];
66
67
  scNoTestSeverity: TraceabilitySeverity;
67
- allowOrphanContracts: boolean;
68
+ orphanContractsPolicy: OrphanContractsPolicy;
68
69
  unknownContractIdSeverity: TraceabilitySeverity;
69
70
  };
70
71
  };
@@ -82,8 +83,14 @@ type ConfigLoadResult = {
82
83
  issues: Issue[];
83
84
  configPath: string;
84
85
  };
86
+ type ConfigSearchResult = {
87
+ root: string;
88
+ configPath: string;
89
+ found: boolean;
90
+ };
85
91
  declare const defaultConfig: QfaiConfig;
86
92
  declare function getConfigPath(root: string): string;
93
+ declare function findConfigRoot(startDir: string): Promise<ConfigSearchResult>;
87
94
  declare function loadConfig(root: string): Promise<ConfigLoadResult>;
88
95
  declare function resolvePath(root: string, config: QfaiConfig, key: ConfigPathKey): string;
89
96
 
@@ -120,7 +127,11 @@ type ReportContractCoverage = {
120
127
  type ReportSpecCoverage = {
121
128
  contractRefMissing: number;
122
129
  missingRefSpecs: string[];
123
- specToContractIds: Record<string, string[]>;
130
+ specToContracts: Record<string, ReportSpecContractRefs>;
131
+ };
132
+ type ReportSpecContractRefs = {
133
+ status: "missing" | "declared";
134
+ ids: string[];
124
135
  };
125
136
  type ReportTraceability = {
126
137
  upstreamIdsFound: number;
@@ -134,6 +145,7 @@ type ReportTraceability = {
134
145
  type ReportData = {
135
146
  tool: "qfai";
136
147
  version: string;
148
+ reportFormatVersion: number;
137
149
  generatedAt: string;
138
150
  root: string;
139
151
  configPath: string;
@@ -165,4 +177,4 @@ declare function validateSpecContent(text: string, file: string, requiredSection
165
177
 
166
178
  declare function validateTraceability(root: string, config: QfaiConfig): Promise<Issue[]>;
167
179
 
168
- export { type ConfigLoadResult, type ConfigPathKey, type FailOn, type IdFormatPrefix, type IdPrefix, type Issue, type IssueLocation, type IssueSeverity, type OutputFormat, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiValidationConfig, type ReportContractCoverage, type ReportData, type ReportIds, type ReportSpecCoverage, type ReportSummary, type ReportTraceability, type TraceabilitySeverity, type ValidationCounts, type ValidationResult, type ValidationTraceability, createReportData, defaultConfig, extractAllIds, extractIds, extractInvalidIds, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, resolvePath, resolveToolVersion, validateContracts, validateDefinedIds, validateDeltas, validateProject, validateScenarioContent, validateScenarios, validateSpecContent, validateSpecs, validateTraceability };
180
+ export { type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, type FailOn, type IdFormatPrefix, type IdPrefix, type Issue, type IssueLocation, type IssueSeverity, type OrphanContractsPolicy, type OutputFormat, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiValidationConfig, type ReportContractCoverage, type ReportData, type ReportIds, type ReportSpecContractRefs, type ReportSpecCoverage, type ReportSummary, type ReportTraceability, type TraceabilitySeverity, type ValidationCounts, type ValidationResult, type ValidationTraceability, createReportData, defaultConfig, extractAllIds, extractIds, extractInvalidIds, findConfigRoot, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, resolvePath, resolveToolVersion, validateContracts, validateDefinedIds, validateDeltas, validateProject, validateScenarioContent, validateScenarios, validateSpecContent, validateSpecs, validateTraceability };
package/dist/index.d.ts CHANGED
@@ -44,6 +44,7 @@ type ValidationResult = {
44
44
  type FailOn = "never" | "warning" | "error";
45
45
  type OutputFormat = "text" | "github";
46
46
  type TraceabilitySeverity = "warning" | "error";
47
+ type OrphanContractsPolicy = "error" | "warning" | "allow";
47
48
  type QfaiPaths = {
48
49
  contractsDir: string;
49
50
  specsDir: string;
@@ -64,7 +65,7 @@ type QfaiValidationConfig = {
64
65
  testFileGlobs: string[];
65
66
  testFileExcludeGlobs: string[];
66
67
  scNoTestSeverity: TraceabilitySeverity;
67
- allowOrphanContracts: boolean;
68
+ orphanContractsPolicy: OrphanContractsPolicy;
68
69
  unknownContractIdSeverity: TraceabilitySeverity;
69
70
  };
70
71
  };
@@ -82,8 +83,14 @@ type ConfigLoadResult = {
82
83
  issues: Issue[];
83
84
  configPath: string;
84
85
  };
86
+ type ConfigSearchResult = {
87
+ root: string;
88
+ configPath: string;
89
+ found: boolean;
90
+ };
85
91
  declare const defaultConfig: QfaiConfig;
86
92
  declare function getConfigPath(root: string): string;
93
+ declare function findConfigRoot(startDir: string): Promise<ConfigSearchResult>;
87
94
  declare function loadConfig(root: string): Promise<ConfigLoadResult>;
88
95
  declare function resolvePath(root: string, config: QfaiConfig, key: ConfigPathKey): string;
89
96
 
@@ -120,7 +127,11 @@ type ReportContractCoverage = {
120
127
  type ReportSpecCoverage = {
121
128
  contractRefMissing: number;
122
129
  missingRefSpecs: string[];
123
- specToContractIds: Record<string, string[]>;
130
+ specToContracts: Record<string, ReportSpecContractRefs>;
131
+ };
132
+ type ReportSpecContractRefs = {
133
+ status: "missing" | "declared";
134
+ ids: string[];
124
135
  };
125
136
  type ReportTraceability = {
126
137
  upstreamIdsFound: number;
@@ -134,6 +145,7 @@ type ReportTraceability = {
134
145
  type ReportData = {
135
146
  tool: "qfai";
136
147
  version: string;
148
+ reportFormatVersion: number;
137
149
  generatedAt: string;
138
150
  root: string;
139
151
  configPath: string;
@@ -165,4 +177,4 @@ declare function validateSpecContent(text: string, file: string, requiredSection
165
177
 
166
178
  declare function validateTraceability(root: string, config: QfaiConfig): Promise<Issue[]>;
167
179
 
168
- export { type ConfigLoadResult, type ConfigPathKey, type FailOn, type IdFormatPrefix, type IdPrefix, type Issue, type IssueLocation, type IssueSeverity, type OutputFormat, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiValidationConfig, type ReportContractCoverage, type ReportData, type ReportIds, type ReportSpecCoverage, type ReportSummary, type ReportTraceability, type TraceabilitySeverity, type ValidationCounts, type ValidationResult, type ValidationTraceability, createReportData, defaultConfig, extractAllIds, extractIds, extractInvalidIds, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, resolvePath, resolveToolVersion, validateContracts, validateDefinedIds, validateDeltas, validateProject, validateScenarioContent, validateScenarios, validateSpecContent, validateSpecs, validateTraceability };
180
+ export { type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, type FailOn, type IdFormatPrefix, type IdPrefix, type Issue, type IssueLocation, type IssueSeverity, type OrphanContractsPolicy, type OutputFormat, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiValidationConfig, type ReportContractCoverage, type ReportData, type ReportIds, type ReportSpecContractRefs, type ReportSpecCoverage, type ReportSummary, type ReportTraceability, type TraceabilitySeverity, type ValidationCounts, type ValidationResult, type ValidationTraceability, createReportData, defaultConfig, extractAllIds, extractIds, extractInvalidIds, findConfigRoot, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, resolvePath, resolveToolVersion, validateContracts, validateDefinedIds, validateDeltas, validateProject, validateScenarioContent, validateScenarios, validateSpecContent, validateSpecs, validateTraceability };