qfai 0.3.6 → 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.
Files changed (47) hide show
  1. package/README.md +7 -0
  2. package/assets/init/.qfai/README.md +4 -0
  3. package/assets/init/.qfai/prompts/makeBusinessFlow.md +1 -1
  4. package/assets/init/.qfai/prompts/makeOverview.md +1 -1
  5. package/assets/init/.qfai/rules/conventions.md +1 -1
  6. package/assets/init/.qfai/specs/README.md +1 -1
  7. package/assets/init/root/qfai.config.yaml +2 -0
  8. package/assets/init/root/tests/qfai-traceability.sample.test.ts +2 -0
  9. package/dist/cli/commands/report.d.ts.map +1 -1
  10. package/dist/cli/commands/report.js +0 -7
  11. package/dist/cli/commands/report.js.map +1 -1
  12. package/dist/cli/index.cjs +351 -218
  13. package/dist/cli/index.cjs.map +1 -1
  14. package/dist/cli/index.mjs +350 -217
  15. package/dist/cli/index.mjs.map +1 -1
  16. package/dist/core/config.d.ts +2 -0
  17. package/dist/core/config.d.ts.map +1 -1
  18. package/dist/core/config.js +4 -0
  19. package/dist/core/config.js.map +1 -1
  20. package/dist/core/report.d.ts +2 -0
  21. package/dist/core/report.d.ts.map +1 -1
  22. package/dist/core/report.js +34 -0
  23. package/dist/core/report.js.map +1 -1
  24. package/dist/core/traceability.d.ts +12 -0
  25. package/dist/core/traceability.d.ts.map +1 -0
  26. package/dist/core/traceability.js +70 -0
  27. package/dist/core/traceability.js.map +1 -0
  28. package/dist/core/types.d.ts +0 -2
  29. package/dist/core/types.d.ts.map +1 -1
  30. package/dist/core/types.js +1 -1
  31. package/dist/core/types.js.map +1 -1
  32. package/dist/core/validate.d.ts.map +1 -1
  33. package/dist/core/validate.js +0 -2
  34. package/dist/core/validate.js.map +1 -1
  35. package/dist/core/validators/scenario.d.ts.map +1 -1
  36. package/dist/core/validators/scenario.js +3 -0
  37. package/dist/core/validators/scenario.js.map +1 -1
  38. package/dist/core/validators/traceability.d.ts.map +1 -1
  39. package/dist/core/validators/traceability.js +11 -1
  40. package/dist/core/validators/traceability.js.map +1 -1
  41. package/dist/index.cjs +344 -205
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +12 -3
  44. package/dist/index.mjs +348 -208
  45. package/dist/index.mjs.map +1 -1
  46. package/dist/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  type IssueSeverity = "info" | "warning" | "error";
2
- declare const VALIDATION_SCHEMA_VERSION: "0.2";
3
2
  type IssueLocation = {
4
3
  line: number;
5
4
  column?: number;
@@ -19,7 +18,6 @@ type ValidationCounts = {
19
18
  error: number;
20
19
  };
21
20
  type ValidationResult = {
22
- schemaVersion: typeof VALIDATION_SCHEMA_VERSION;
23
21
  toolVersion: string;
24
22
  issues: Issue[];
25
23
  counts: ValidationCounts;
@@ -45,6 +43,8 @@ type QfaiValidationConfig = {
45
43
  traceability: {
46
44
  brMustHaveSc: boolean;
47
45
  scMustTouchContracts: boolean;
46
+ scMustHaveTest: boolean;
47
+ scNoTestSeverity: TraceabilitySeverity;
48
48
  allowOrphanContracts: boolean;
49
49
  unknownContractIdSeverity: TraceabilitySeverity;
50
50
  };
@@ -74,6 +74,14 @@ declare function extractIds(text: string, prefix: IdPrefix): string[];
74
74
  declare function extractAllIds(text: string): string[];
75
75
  declare function extractInvalidIds(text: string, prefixes: IdFormatPrefix[]): string[];
76
76
 
77
+ type ScCoverage = {
78
+ total: number;
79
+ covered: number;
80
+ missing: number;
81
+ missingIds: string[];
82
+ refs: Record<string, string[]>;
83
+ };
84
+
77
85
  type ReportSummary = {
78
86
  specs: number;
79
87
  scenarios: number;
@@ -95,6 +103,7 @@ type ReportIds = {
95
103
  type ReportTraceability = {
96
104
  upstreamIdsFound: number;
97
105
  referencedInCodeOrTests: boolean;
106
+ sc: ScCoverage;
98
107
  };
99
108
  type ReportData = {
100
109
  tool: "qfai";
@@ -130,4 +139,4 @@ declare function validateSpecContent(text: string, file: string, requiredSection
130
139
 
131
140
  declare function validateTraceability(root: string, config: QfaiConfig): Promise<Issue[]>;
132
141
 
133
- 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 ReportData, type ReportIds, type ReportSummary, type ReportTraceability, type TraceabilitySeverity, VALIDATION_SCHEMA_VERSION, type ValidationCounts, type ValidationResult, createReportData, defaultConfig, extractAllIds, extractIds, extractInvalidIds, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, resolvePath, resolveToolVersion, validateContracts, validateDefinedIds, validateDeltas, validateProject, validateScenarioContent, validateScenarios, validateSpecContent, validateSpecs, validateTraceability };
142
+ 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 ReportData, type ReportIds, type ReportSummary, type ReportTraceability, type TraceabilitySeverity, type ValidationCounts, type ValidationResult, createReportData, defaultConfig, extractAllIds, extractIds, extractInvalidIds, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, resolvePath, resolveToolVersion, validateContracts, validateDefinedIds, validateDeltas, validateProject, validateScenarioContent, validateScenarios, validateSpecContent, validateSpecs, validateTraceability };