qfai 0.4.9 → 0.5.2
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 +10 -3
- package/assets/init/.qfai/README.md +9 -0
- package/assets/init/.qfai/contracts/README.md +2 -2
- package/assets/init/.qfai/promptpack/commands/implement.md +2 -0
- package/assets/init/.qfai/promptpack/commands/plan.md +2 -0
- package/assets/init/.qfai/promptpack/commands/review.md +1 -0
- package/assets/init/.qfai/promptpack/steering/traceability.md +8 -2
- package/assets/init/.qfai/prompts/README.md +16 -0
- package/assets/init/.qfai/prompts/qfai-classify-change.md +33 -0
- package/assets/init/.qfai/prompts/qfai-maintain-contracts.md +35 -0
- package/assets/init/.qfai/prompts/qfai-maintain-traceability.md +36 -0
- package/assets/init/.qfai/specs/README.md +3 -1
- package/assets/init/.qfai/specs/spec-0001/scenario.md +2 -1
- package/assets/init/root/qfai.config.yaml +1 -1
- package/dist/cli/index.cjs +551 -211
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +556 -216
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +364 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.mjs +368 -160
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
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
|
-
|
|
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
|
|
|
@@ -119,7 +126,12 @@ type ReportContractCoverage = {
|
|
|
119
126
|
};
|
|
120
127
|
type ReportSpecCoverage = {
|
|
121
128
|
contractRefMissing: number;
|
|
122
|
-
|
|
129
|
+
missingRefSpecs: string[];
|
|
130
|
+
specToContracts: Record<string, ReportSpecContractRefs>;
|
|
131
|
+
};
|
|
132
|
+
type ReportSpecContractRefs = {
|
|
133
|
+
status: "missing" | "declared";
|
|
134
|
+
ids: string[];
|
|
123
135
|
};
|
|
124
136
|
type ReportTraceability = {
|
|
125
137
|
upstreamIdsFound: number;
|
|
@@ -164,4 +176,4 @@ declare function validateSpecContent(text: string, file: string, requiredSection
|
|
|
164
176
|
|
|
165
177
|
declare function validateTraceability(root: string, config: QfaiConfig): Promise<Issue[]>;
|
|
166
178
|
|
|
167
|
-
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 };
|
|
179
|
+
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
|
-
|
|
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
|
|
|
@@ -119,7 +126,12 @@ type ReportContractCoverage = {
|
|
|
119
126
|
};
|
|
120
127
|
type ReportSpecCoverage = {
|
|
121
128
|
contractRefMissing: number;
|
|
122
|
-
|
|
129
|
+
missingRefSpecs: string[];
|
|
130
|
+
specToContracts: Record<string, ReportSpecContractRefs>;
|
|
131
|
+
};
|
|
132
|
+
type ReportSpecContractRefs = {
|
|
133
|
+
status: "missing" | "declared";
|
|
134
|
+
ids: string[];
|
|
123
135
|
};
|
|
124
136
|
type ReportTraceability = {
|
|
125
137
|
upstreamIdsFound: number;
|
|
@@ -164,4 +176,4 @@ declare function validateSpecContent(text: string, file: string, requiredSection
|
|
|
164
176
|
|
|
165
177
|
declare function validateTraceability(root: string, config: QfaiConfig): Promise<Issue[]>;
|
|
166
178
|
|
|
167
|
-
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 };
|
|
179
|
+
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 };
|