@pactosigna/trace 0.1.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 (101) hide show
  1. package/dist/cli.d.ts +8 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +7391 -0
  4. package/dist/commands/check.d.ts +11 -0
  5. package/dist/commands/check.d.ts.map +1 -0
  6. package/dist/commands/context.d.ts +9 -0
  7. package/dist/commands/context.d.ts.map +1 -0
  8. package/dist/commands/drm-check.d.ts +9 -0
  9. package/dist/commands/drm-check.d.ts.map +1 -0
  10. package/dist/commands/impact.d.ts +17 -0
  11. package/dist/commands/impact.d.ts.map +1 -0
  12. package/dist/commands/report.d.ts +8 -0
  13. package/dist/commands/report.d.ts.map +1 -0
  14. package/dist/commands/risk.d.ts +8 -0
  15. package/dist/commands/risk.d.ts.map +1 -0
  16. package/dist/commands/rtm.d.ts +8 -0
  17. package/dist/commands/rtm.d.ts.map +1 -0
  18. package/dist/commands/validate.d.ts +8 -0
  19. package/dist/commands/validate.d.ts.map +1 -0
  20. package/dist/commands/vsr.d.ts +9 -0
  21. package/dist/commands/vsr.d.ts.map +1 -0
  22. package/dist/config/load-config.d.ts +14 -0
  23. package/dist/config/load-config.d.ts.map +1 -0
  24. package/dist/config/types.d.ts +52 -0
  25. package/dist/config/types.d.ts.map +1 -0
  26. package/dist/formatters/format-check.d.ts +28 -0
  27. package/dist/formatters/format-check.d.ts.map +1 -0
  28. package/dist/formatters/format-impact.d.ts +37 -0
  29. package/dist/formatters/format-impact.d.ts.map +1 -0
  30. package/dist/formatters/format-risk.d.ts +21 -0
  31. package/dist/formatters/format-risk.d.ts.map +1 -0
  32. package/dist/impact/baseline-scan.d.ts +18 -0
  33. package/dist/impact/baseline-scan.d.ts.map +1 -0
  34. package/dist/impact/diff-gaps.d.ts +20 -0
  35. package/dist/impact/diff-gaps.d.ts.map +1 -0
  36. package/dist/index.d.ts +28 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +4794 -0
  39. package/dist/loaders/filesystem-document-loader.d.ts +40 -0
  40. package/dist/loaders/filesystem-document-loader.d.ts.map +1 -0
  41. package/dist/test-report/build-report.d.ts +6 -0
  42. package/dist/test-report/build-report.d.ts.map +1 -0
  43. package/dist/test-report/format-str.d.ts +6 -0
  44. package/dist/test-report/format-str.d.ts.map +1 -0
  45. package/dist/test-report/index.d.ts +24 -0
  46. package/dist/test-report/index.d.ts.map +1 -0
  47. package/dist/test-report/parse-results.d.ts +10 -0
  48. package/dist/test-report/parse-results.d.ts.map +1 -0
  49. package/dist/test-report/types.d.ts +112 -0
  50. package/dist/test-report/types.d.ts.map +1 -0
  51. package/dist/traceability/context.d.ts +24 -0
  52. package/dist/traceability/context.d.ts.map +1 -0
  53. package/dist/traceability/cross-reference.d.ts +15 -0
  54. package/dist/traceability/cross-reference.d.ts.map +1 -0
  55. package/dist/traceability/drm-check.d.ts +29 -0
  56. package/dist/traceability/drm-check.d.ts.map +1 -0
  57. package/dist/traceability/format-report.d.ts +6 -0
  58. package/dist/traceability/format-report.d.ts.map +1 -0
  59. package/dist/traceability/format-rtm.d.ts +7 -0
  60. package/dist/traceability/format-rtm.d.ts.map +1 -0
  61. package/dist/traceability/graph/build-graph.d.ts +10 -0
  62. package/dist/traceability/graph/build-graph.d.ts.map +1 -0
  63. package/dist/traceability/graph/coverage-query.d.ts +20 -0
  64. package/dist/traceability/graph/coverage-query.d.ts.map +1 -0
  65. package/dist/traceability/graph/format.d.ts +21 -0
  66. package/dist/traceability/graph/format.d.ts.map +1 -0
  67. package/dist/traceability/graph/parse-docs.d.ts +12 -0
  68. package/dist/traceability/graph/parse-docs.d.ts.map +1 -0
  69. package/dist/traceability/graph/parse-tests.d.ts +14 -0
  70. package/dist/traceability/graph/parse-tests.d.ts.map +1 -0
  71. package/dist/traceability/graph/resolve.d.ts +35 -0
  72. package/dist/traceability/graph/resolve.d.ts.map +1 -0
  73. package/dist/traceability/graph/types.d.ts +68 -0
  74. package/dist/traceability/graph/types.d.ts.map +1 -0
  75. package/dist/traceability/graph/walk.d.ts +10 -0
  76. package/dist/traceability/graph/walk.d.ts.map +1 -0
  77. package/dist/traceability/impact.d.ts +43 -0
  78. package/dist/traceability/impact.d.ts.map +1 -0
  79. package/dist/traceability/index.d.ts +10 -0
  80. package/dist/traceability/index.d.ts.map +1 -0
  81. package/dist/traceability/load-rules.d.ts +43 -0
  82. package/dist/traceability/load-rules.d.ts.map +1 -0
  83. package/dist/traceability/lookups.d.ts +25 -0
  84. package/dist/traceability/lookups.d.ts.map +1 -0
  85. package/dist/traceability/parse-compliance.d.ts +7 -0
  86. package/dist/traceability/parse-compliance.d.ts.map +1 -0
  87. package/dist/traceability/parse-frontmatter.d.ts +13 -0
  88. package/dist/traceability/parse-frontmatter.d.ts.map +1 -0
  89. package/dist/traceability/parse-requirements.d.ts +19 -0
  90. package/dist/traceability/parse-requirements.d.ts.map +1 -0
  91. package/dist/traceability/scan-e2e.d.ts +14 -0
  92. package/dist/traceability/scan-e2e.d.ts.map +1 -0
  93. package/dist/traceability/scan-unit.d.ts +7 -0
  94. package/dist/traceability/scan-unit.d.ts.map +1 -0
  95. package/dist/traceability/trace-cli.d.ts +20 -0
  96. package/dist/traceability/trace-cli.d.ts.map +1 -0
  97. package/dist/traceability/types.d.ts +50 -0
  98. package/dist/traceability/types.d.ts.map +1 -0
  99. package/dist/validation-report/index.d.ts +13 -0
  100. package/dist/validation-report/index.d.ts.map +1 -0
  101. package/package.json +48 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * FilesystemDocumentLoader
3
+ *
4
+ * Reads markdown files from a git repository on disk, parses their YAML
5
+ * frontmatter via gray-matter, and translates document types using
6
+ * inferDocumentType() from @pactosigna/schemas.
7
+ *
8
+ * Produces DocumentRef[] + LinkRef[] + body Map — the exact shapes that
9
+ * detectAllGaps() from @pactosigna/domain accepts.
10
+ */
11
+ import type { DocumentRef, LinkRef } from '@pactosigna/domain';
12
+ import type { TraceConfig } from '../config/types.js';
13
+ /**
14
+ * Loads markdown documents from a filesystem git repository and produces
15
+ * the DocumentRef[], LinkRef[], and body Map shapes that detectAllGaps() expects.
16
+ */
17
+ export declare class FilesystemDocumentLoader {
18
+ private readonly rootDir;
19
+ private readonly folderOverrides;
20
+ private cachedFiles;
21
+ constructor(rootDir: string, config?: TraceConfig);
22
+ /**
23
+ * Load and return all valid DocumentRef[] from the repository.
24
+ */
25
+ loadDocuments(): DocumentRef[];
26
+ /**
27
+ * Extract all LinkRef[] from frontmatter link fields across all documents.
28
+ */
29
+ loadLinks(): LinkRef[];
30
+ /**
31
+ * Return a Map of documentId to markdown body content (without frontmatter).
32
+ */
33
+ loadBodies(): Map<string, string>;
34
+ /**
35
+ * Parse all markdown files from scan directories. Results are cached
36
+ * so repeated calls to loadDocuments/loadLinks/loadBodies are cheap.
37
+ */
38
+ private getParsedFiles;
39
+ }
40
+ //# sourceMappingURL=filesystem-document-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem-document-loader.d.ts","sourceRoot":"","sources":["../../src/loaders/filesystem-document-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AA2MtE;;;GAGG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmB;IACnD,OAAO,CAAC,WAAW,CAA6B;gBAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW;IAKjD;;OAEG;IACH,aAAa,IAAI,WAAW,EAAE;IAS9B;;OAEG;IACH,SAAS,IAAI,OAAO,EAAE;IAQtB;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAQjC;;;OAGG;IACH,OAAO,CAAC,cAAc;CAsBvB"}
@@ -0,0 +1,6 @@
1
+ import type { STRReport, TestSuiteResult } from './types.js';
2
+ /**
3
+ * Build the STR report from parsed test suite results.
4
+ */
5
+ export declare function buildSTRReport(unitSuites: TestSuiteResult[], e2eSuites: TestSuiteResult[]): STRReport;
6
+ //# sourceMappingURL=build-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-report.d.ts","sourceRoot":"","sources":["../../src/test-report/build-report.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAwC,MAAM,YAAY,CAAC;AAEnG;;GAEG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,eAAe,EAAE,EAC7B,SAAS,EAAE,eAAe,EAAE,GAC3B,SAAS,CA0EX"}
@@ -0,0 +1,6 @@
1
+ import type { STRReport } from './types.js';
2
+ /**
3
+ * Format the STR report as IEC 62304 §5.7 compliant markdown.
4
+ */
5
+ export declare function formatSTR(report: STRReport): string;
6
+ //# sourceMappingURL=format-str.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-str.d.ts","sourceRoot":"","sources":["../../src/test-report/format-str.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CA+GnD"}
@@ -0,0 +1,24 @@
1
+ export type { TestResult, TestSuiteResult, STRReport, STRSummary, STREnvironment, RequirementCoverageEntry, } from './types.js';
2
+ export { buildSTRReport } from './build-report.js';
3
+ export { formatSTR } from './format-str.js';
4
+ export { parseVitestResults, parsePlaywrightResults } from './parse-results.js';
5
+ export interface TestReportOptions {
6
+ /** Path to Vitest JSON output. Default: `<rootDir>/test-results/vitest-results.json` */
7
+ vitestJsonPath?: string;
8
+ /** Path to Playwright JSON output. Default: `<rootDir>/test-results/playwright-results.json` */
9
+ playwrightJsonPath?: string;
10
+ /** Root directory for resolving default paths. Default: `process.cwd()` */
11
+ rootDir?: string;
12
+ }
13
+ /**
14
+ * Generate a Software Test Report (STR) per IEC 62304 section 5.7.
15
+ *
16
+ * Reads Vitest and/or Playwright JSON result files, parses them,
17
+ * builds the STR data model, and returns formatted markdown.
18
+ *
19
+ * Gracefully handles missing files: if only one source exists,
20
+ * the report includes only that source. Returns `null` when
21
+ * neither file exists.
22
+ */
23
+ export declare function generateTestReport(options?: TestReportOptions): string | null;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-report/index.ts"],"names":[],"mappings":"AAMA,YAAY,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,cAAc,EACd,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,MAAM,WAAW,iBAAiB;IAChC,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gGAAgG;IAChG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,GAAG,IAAI,CAwBjF"}
@@ -0,0 +1,10 @@
1
+ import type { TestSuiteResult } from './types.js';
2
+ /**
3
+ * Parse Vitest JSON reporter output into TestSuiteResults.
4
+ */
5
+ export declare function parseVitestResults(jsonPath: string): TestSuiteResult[];
6
+ /**
7
+ * Parse Playwright JSON reporter output into TestSuiteResults.
8
+ */
9
+ export declare function parsePlaywrightResults(jsonPath: string): TestSuiteResult[];
10
+ //# sourceMappingURL=parse-results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-results.d.ts","sourceRoot":"","sources":["../../src/test-report/parse-results.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,eAAe,EAEhB,MAAM,YAAY,CAAC;AAcpB;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,CAgCtE;AA4CD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,CAkB1E"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Software Test Report (STR) types per IEC 62304 §5.7
3
+ */
4
+ export interface TestResult {
5
+ name: string;
6
+ file: string;
7
+ status: 'passed' | 'failed' | 'skipped';
8
+ duration: number;
9
+ errorMessage?: string;
10
+ requirementIds: string[];
11
+ }
12
+ export interface TestSuiteResult {
13
+ name: string;
14
+ file: string;
15
+ tests: TestResult[];
16
+ duration: number;
17
+ }
18
+ export interface VitestJsonResult {
19
+ numTotalTests: number;
20
+ numPassedTests: number;
21
+ numFailedTests: number;
22
+ numPendingTests: number;
23
+ startTime: number;
24
+ success: boolean;
25
+ testResults: VitestFileResult[];
26
+ }
27
+ export interface VitestFileResult {
28
+ name: string;
29
+ status: string;
30
+ startTime: number;
31
+ endTime: number;
32
+ assertionResults: VitestAssertionResult[];
33
+ }
34
+ export interface VitestAssertionResult {
35
+ ancestorTitles: string[];
36
+ title: string;
37
+ status: 'passed' | 'failed' | 'pending';
38
+ duration: number;
39
+ failureMessages: string[];
40
+ }
41
+ export interface PlaywrightJsonResult {
42
+ config: {
43
+ testDir: string;
44
+ };
45
+ suites: PlaywrightSuite[];
46
+ stats: {
47
+ startTime: string;
48
+ duration: number;
49
+ expected: number;
50
+ unexpected: number;
51
+ flaky: number;
52
+ skipped: number;
53
+ };
54
+ }
55
+ export interface PlaywrightSuite {
56
+ title: string;
57
+ file: string;
58
+ suites?: PlaywrightSuite[];
59
+ specs: PlaywrightSpec[];
60
+ }
61
+ export interface PlaywrightSpec {
62
+ title: string;
63
+ ok: boolean;
64
+ tags: string[];
65
+ tests: PlaywrightTest[];
66
+ }
67
+ export interface PlaywrightTest {
68
+ timeout: number;
69
+ status: 'expected' | 'unexpected' | 'flaky' | 'skipped';
70
+ results: {
71
+ duration: number;
72
+ status: string;
73
+ error?: {
74
+ message: string;
75
+ };
76
+ }[];
77
+ }
78
+ export interface STRReport {
79
+ title: string;
80
+ generatedAt: string;
81
+ environment: STREnvironment;
82
+ summary: STRSummary;
83
+ suites: TestSuiteResult[];
84
+ requirementCoverage: RequirementCoverageEntry[];
85
+ failures: TestResult[];
86
+ }
87
+ export interface STREnvironment {
88
+ nodeVersion: string;
89
+ platform: string;
90
+ gitCommit: string;
91
+ gitBranch: string;
92
+ }
93
+ export interface STRSummary {
94
+ totalTests: number;
95
+ passed: number;
96
+ failed: number;
97
+ skipped: number;
98
+ passRate: number;
99
+ totalDuration: number;
100
+ unitTestCount: number;
101
+ e2eTestCount: number;
102
+ }
103
+ export interface RequirementCoverageEntry {
104
+ requirementId: string;
105
+ tests: {
106
+ name: string;
107
+ file: string;
108
+ status: 'passed' | 'failed' | 'skipped';
109
+ }[];
110
+ allPassed: boolean;
111
+ }
112
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/test-report/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI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K,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;KAAE,EAAE,CAAC;IACjF,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,24 @@
1
+ import type { ImpactConfig } from './load-rules.js';
2
+ import type { DocumentFrontmatter } from './parse-frontmatter.js';
3
+ export interface DomainContext {
4
+ domain: string;
5
+ fallback?: boolean;
6
+ userNeeds: DocumentFrontmatter[];
7
+ productRequirements: DocumentFrontmatter[];
8
+ softwareRequirements: Array<DocumentFrontmatter & {
9
+ testCoverage?: {
10
+ covered: string[];
11
+ uncovered: string[];
12
+ };
13
+ }>;
14
+ risks: DocumentFrontmatter[];
15
+ architecture: DocumentFrontmatter[];
16
+ gaps: string[];
17
+ }
18
+ /**
19
+ * Build domain context from a parsed ImpactConfig object.
20
+ * Accepts the config directly instead of a file path.
21
+ */
22
+ export declare function buildDomainContext(domain: string, rulesOrPath: string | ImpactConfig, root: string): DomainContext;
23
+ export declare function formatContext(ctx: DomainContext): string;
24
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/traceability/context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAOlE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;IAC3C,oBAAoB,EAAE,KAAK,CACzB,mBAAmB,GAAG;QACpB,YAAY,CAAC,EAAE;YAAE,OAAO,EAAE,MAAM,EAAE,CAAC;YAAC,SAAS,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;KAC3D,CACF,CAAC;IACF,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,YAAY,EAAE,mBAAmB,EAAE,CAAC;IACpC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAkDD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,YAAY,EAClC,IAAI,EAAE,MAAM,GACX,aAAa,CA+Cf;AAwFD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAyFxD"}
@@ -0,0 +1,15 @@
1
+ import type { Requirement, TestReference, ComplianceEntry, TraceabilityReport, Gap, DocumentLink, RiskEntry } from './types.js';
2
+ /**
3
+ * Cross-reference requirements, test references, and compliance entries
4
+ * to produce a full traceability report with gap detection.
5
+ */
6
+ export declare function buildTraceabilityReport(requirements: Requirement[], testRefs: TestReference[], compliance: ComplianceEntry[], orphanScenarios: {
7
+ file: string;
8
+ name: string;
9
+ }[]): TraceabilityReport;
10
+ /**
11
+ * Detect document chain gaps: broken traces, orphan requirements,
12
+ * and unanalyzed SRS requirements.
13
+ */
14
+ export declare function buildDocumentChainGaps(documentLinks: DocumentLink[], _riskEntries: RiskEntry[], knownDocIds: Set<string>, _requirements: Requirement[]): Gap[];
15
+ //# sourceMappingURL=cross-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-reference.d.ts","sourceRoot":"","sources":["../../src/traceability/cross-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,GAAG,EACH,YAAY,EACZ,SAAS,EACV,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,WAAW,EAAE,EAC3B,QAAQ,EAAE,aAAa,EAAE,EACzB,UAAU,EAAE,eAAe,EAAE,EAC7B,eAAe,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,GAChD,kBAAkB,CAuEpB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,YAAY,EAAE,EAC7B,YAAY,EAAE,SAAS,EAAE,EACzB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,aAAa,EAAE,WAAW,EAAE,GAC3B,GAAG,EAAE,CA0DP"}
@@ -0,0 +1,29 @@
1
+ export interface DrmItem {
2
+ category: 'ARCH' | 'DOCS' | 'TESTS';
3
+ action: 'CREATE' | 'UPDATE';
4
+ target: string;
5
+ description: string;
6
+ }
7
+ export interface DrmCheckResult {
8
+ item: DrmItem;
9
+ status: 'met' | 'unmet';
10
+ reason: string;
11
+ }
12
+ /**
13
+ * Parses DRM marker blocks from a GitHub issue/PR body.
14
+ *
15
+ * Looks for `<!-- DRM:<CATEGORY>_START -->` / `<!-- DRM:<CATEGORY>_END -->`
16
+ * pairs, extracts the markdown table rows within, and returns structured items.
17
+ * Rows with Action = "NONE" are filtered out.
18
+ */
19
+ export declare function parseDrmMarkers(body: string): DrmItem[];
20
+ /**
21
+ * Checks whether DRM-required actions have been satisfied by the PR diff.
22
+ *
23
+ * - `CREATE` items: check if target exists in `existingFiles` set
24
+ * (uses endsWith matching since DRM targets may be basenames)
25
+ * - `UPDATE` items: check if target appears in `changedFiles` array
26
+ * (uses endsWith matching for partial paths)
27
+ */
28
+ export declare function checkDrmAdherence(items: DrmItem[], changedFiles: string[], existingFiles: Set<string>): DrmCheckResult[];
29
+ //# sourceMappingURL=drm-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drm-check.d.ts","sourceRoot":"","sources":["../../src/traceability/drm-check.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACpC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAYD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAgDvD;AAMD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EAAE,EAChB,YAAY,EAAE,MAAM,EAAE,EACtB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GACzB,cAAc,EAAE,CAmBlB"}
@@ -0,0 +1,6 @@
1
+ import type { TraceabilityReport } from './types.js';
2
+ /**
3
+ * Format a traceability report as a human-readable markdown string.
4
+ */
5
+ export declare function formatReport(report: TraceabilityReport): string;
6
+ //# sourceMappingURL=format-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-report.d.ts","sourceRoot":"","sources":["../../src/traceability/format-report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAyD/D"}
@@ -0,0 +1,7 @@
1
+ import type { TraceabilityReport } from './types.js';
2
+ /**
3
+ * Format a full Requirements Traceability Matrix (RTM) document.
4
+ * Links: User Need → Product Requirement → Software Requirement → Test
5
+ */
6
+ export declare function formatRTM(report: TraceabilityReport, rootDir: string): string;
7
+ //# sourceMappingURL=format-rtm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-rtm.d.ts","sourceRoot":"","sources":["../../src/traceability/format-rtm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAgFrD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsF7E"}
@@ -0,0 +1,10 @@
1
+ import type { GraphNode, Edge, Graph } from './types.js';
2
+ /**
3
+ * Assembles pre-parsed nodes and edges into a Graph with adjacency lists.
4
+ *
5
+ * Pure function — no I/O, no side effects.
6
+ * Duplicate node IDs are resolved by last-write-wins.
7
+ * Edges referencing non-existent nodes are still stored and indexed.
8
+ */
9
+ export declare function buildGraph(nodes: GraphNode[], edges: Edge[]): Graph;
10
+ //# sourceMappingURL=build-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-graph.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/build-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CASnE"}
@@ -0,0 +1,20 @@
1
+ import type { Graph } from './types.js';
2
+ export interface CoverageResult {
3
+ /** Requirement IDs that have at least one TestRefNode */
4
+ covered: string[];
5
+ /** Requirement IDs that need tests but have none */
6
+ uncovered: string[];
7
+ /** Total requirement count (only testable requirements) */
8
+ total: number;
9
+ }
10
+ /**
11
+ * Query test coverage for all requirements belonging to a document.
12
+ *
13
+ * Only requirements whose `verificationMethod` includes "Test"
14
+ * (Unit Test, E2E Test, Integration Test) are counted.
15
+ * Requirements verified by Code Review, Inspection, etc. are excluded.
16
+ */
17
+ export declare function queryCoverage(graph: Graph, documentId: string): CoverageResult;
18
+ /** Check if any TestRefNode in the graph covers a specific requirement. */
19
+ export declare function isRequirementCovered(graph: Graph, requirementId: string): boolean;
20
+ //# sourceMappingURL=coverage-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage-query.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/coverage-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAC;AAIzD,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oDAAoD;IACpD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAgB9E;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAOjF"}
@@ -0,0 +1,21 @@
1
+ import type { Graph, GraphNode } from './types.js';
2
+ import type { ResolvedSoftwareItem } from './resolve.js';
3
+ import type { Gap } from '../types.js';
4
+ export interface FormatInput {
5
+ graph: Graph;
6
+ resolvedItems: ResolvedSoftwareItem[];
7
+ walkedNodes: GraphNode[];
8
+ domain?: string;
9
+ }
10
+ export interface GapReportInput extends FormatInput {
11
+ gaps: Gap[];
12
+ }
13
+ /** Design phase: rich context for AI reasoning. */
14
+ export declare function formatContext(input: FormatInput): string;
15
+ /** Implement phase: list of docs to update. */
16
+ export declare function formatUpdateList(input: FormatInput): string;
17
+ /** Assess phase: impact table with DRM markers. */
18
+ export declare function formatImpactTable(input: FormatInput): string;
19
+ /** Verify phase: gap report matching the existing trace:check format. */
20
+ export declare function formatGapReport(input: GapReportInput): string;
21
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAgB,MAAM,YAAY,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAIvC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,SAAS,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AA4GD,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAgCxD;AAwED,+CAA+C;AAC/C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CA4B3D;AAsBD,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAY5D;AAoDD,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CA8B7D"}
@@ -0,0 +1,12 @@
1
+ import type { DocumentNode, RequirementNode, Edge } from './types.js';
2
+ export interface ParseDocsResult {
3
+ documentNodes: DocumentNode[];
4
+ requirementNodes: RequirementNode[];
5
+ edges: Edge[];
6
+ }
7
+ /**
8
+ * Scans the repository for QMS documents, extracts graph nodes and
9
+ * traceability edges from frontmatter and content tables.
10
+ */
11
+ export declare function parseAllDocuments(rootDir: string): ParseDocsResult;
12
+ //# sourceMappingURL=parse-docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-docs.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/parse-docs.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAY,MAAM,YAAY,CAAC;AAIhF,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAsBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAKlE"}
@@ -0,0 +1,14 @@
1
+ import type { TestRefNode } from './types.js';
2
+ export interface ParseTestsResult {
3
+ testRefNodes: TestRefNode[];
4
+ orphanScenarios: {
5
+ file: string;
6
+ name: string;
7
+ }[];
8
+ }
9
+ /**
10
+ * Scans the repository for E2E feature files and unit/spec test files,
11
+ * extracts @req tags, and converts them to TestRefNodes.
12
+ */
13
+ export declare function parseAllTests(rootDir: string): ParseTestsResult;
14
+ //# sourceMappingURL=parse-tests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-tests.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/parse-tests.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,eAAe,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnD;AAID;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAQ/D"}
@@ -0,0 +1,35 @@
1
+ export interface ResolvedSoftwareItem {
2
+ /** Bounded context key, e.g. "release-management" */
3
+ softwareItem: string;
4
+ /** Domain identifier, e.g. "releases" */
5
+ domain: string;
6
+ /** Architecture document IDs, e.g. ["HLD-001", "SDD-PLAT"] */
7
+ architecture: string[];
8
+ }
9
+ interface SoftwareItemEntry {
10
+ code_paths: string[];
11
+ architecture: string[];
12
+ domain: string;
13
+ }
14
+ interface SoftwareItemsConfig {
15
+ software_items: Record<string, SoftwareItemEntry>;
16
+ }
17
+ /**
18
+ * Maps changed code files to the bounded context software items they belong to.
19
+ *
20
+ * Each changed file is matched against glob patterns from the software items config.
21
+ * Results are deduplicated -- multiple files in the same software item produce one entry.
22
+ *
23
+ * @param changedFiles List of changed file paths to resolve.
24
+ * @param config Software items configuration (from pactosigna-trace.yaml).
25
+ */
26
+ export declare function resolveChangedFiles(changedFiles: string[], config: SoftwareItemsConfig): ResolvedSoftwareItem[];
27
+ /**
28
+ * Returns the list of changed files by comparing against the merge base.
29
+ *
30
+ * On a feature branch: `git diff --name-only main...HEAD`
31
+ * On main (or detached): `git diff --name-only HEAD~1`
32
+ */
33
+ export declare function getChangedFilesFromGit(): string[];
34
+ export {};
35
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/resolve.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CACnD;AAID;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EAAE,EACtB,MAAM,EAAE,mBAAmB,GAC1B,oBAAoB,EAAE,CAUxB;AA2BD;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CASjD"}
@@ -0,0 +1,68 @@
1
+ /** All frontmatter link types used in traceability relationships. */
2
+ export type LinkType = 'derives_from' | 'implements' | 'verified_by' | 'mitigates' | 'parent_of' | 'related_to' | 'leads_to' | 'results_in' | 'analyzes' | 'traces_from' | 'traces_to' | 'software_item';
3
+ /** One node per markdown file in the QMS repository. */
4
+ export interface DocumentNode {
5
+ nodeKind: 'document';
6
+ /** Document identifier, e.g. "SRS-REL-001" */
7
+ id: string;
8
+ /** Document type prefix, e.g. "SRS", "PRS", "UN", "HLD", "HAZ-SW", "RISK" */
9
+ type: string;
10
+ title: string;
11
+ /** Relative path from repo root */
12
+ filePath: string;
13
+ /** Raw YAML frontmatter, unparsed beyond key-value */
14
+ frontmatter: Record<string, unknown>;
15
+ }
16
+ /** One node per numbered requirement within a document. */
17
+ export interface RequirementNode {
18
+ nodeKind: 'requirement';
19
+ /** Requirement identifier, e.g. "SRS-REL-001.3" */
20
+ id: string;
21
+ /** Parent document identifier, e.g. "SRS-REL-001" */
22
+ documentId: string;
23
+ /** How this requirement is verified, e.g. "E2E Test", "Unit Test" */
24
+ verificationMethod: string;
25
+ /** Acceptance criteria text */
26
+ criteria: string;
27
+ }
28
+ /** One node per @req tag found in a test file. */
29
+ export interface TestRefNode {
30
+ nodeKind: 'test_ref';
31
+ /** Generated id: `test:${file}:${requirementId}:${name}` */
32
+ id: string;
33
+ /** The requirement this test covers */
34
+ requirementId: string;
35
+ testType: 'e2e' | 'unit';
36
+ /** Relative file path of the test */
37
+ file: string;
38
+ /** Test/scenario name */
39
+ name: string;
40
+ }
41
+ /** Discriminated union of all graph node types. */
42
+ export type GraphNode = DocumentNode | RequirementNode | TestRefNode;
43
+ /** A directed edge between two nodes. */
44
+ export interface Edge {
45
+ /** Source node ID */
46
+ from: string;
47
+ /** Target node ID */
48
+ to: string;
49
+ linkType: LinkType;
50
+ }
51
+ /** In-memory traceability graph. */
52
+ export interface Graph {
53
+ nodes: Map<string, GraphNode>;
54
+ edges: Edge[];
55
+ /** nodeId -> outgoing edges from that node */
56
+ outgoing: Map<string, Edge[]>;
57
+ /** nodeId -> incoming edges to that node */
58
+ incoming: Map<string, Edge[]>;
59
+ }
60
+ /** Creates a DocumentNode, adding the `nodeKind` discriminator. */
61
+ export declare function createDocumentNode(props: Omit<DocumentNode, 'nodeKind'>): DocumentNode;
62
+ /** Creates a RequirementNode, adding the `nodeKind` discriminator. */
63
+ export declare function createRequirementNode(props: Omit<RequirementNode, 'nodeKind'>): RequirementNode;
64
+ /** Creates a TestRefNode, generating the `id` from `file`, `requirementId`, and `name`. */
65
+ export declare function createTestRefNode(props: Omit<TestRefNode, 'nodeKind' | 'id'>): TestRefNode;
66
+ /** Creates a directed Edge between two nodes. */
67
+ export declare function createEdge(props: Edge): Edge;
68
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/types.ts"],"names":[],"mappings":"AAEA,qEAAqE;AACrE,MAAM,MAAM,QAAQ,GAChB,cAAc,GACd,YAAY,GACZ,aAAa,GACb,WAAW,GACX,WAAW,GACX,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,UAAU,GACV,aAAa,GACb,WAAW,GACX,eAAe,CAAC;AAIpB,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,UAAU,CAAC;IACrB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,aAAa,CAAC;IACxB,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,UAAU,CAAC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GraphNode, DocumentNode } from './types.js';
2
+ /** A strategy function walks the graph from an entry node and returns discovered nodes. */
3
+ export type WalkStrategyFn = (graph: Graph, entryNode: DocumentNode) => GraphNode[];
4
+ /** Register a named walk strategy. */
5
+ export declare function registerStrategy(name: string, fn: WalkStrategyFn): void;
6
+ /** Execute a named strategy. Throws if the strategy name is unknown. */
7
+ export declare function walkStrategy(name: string, graph: Graph, entryNode: DocumentNode): GraphNode[];
8
+ /** Execute multiple strategies and return the union of results (no duplicates). */
9
+ export declare function walkStrategies(names: string[], graph: Graph, entryNode: DocumentNode): GraphNode[];
10
+ //# sourceMappingURL=walk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../../src/traceability/graph/walk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAY,MAAM,YAAY,CAAC;AAI3E,2FAA2F;AAC3F,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,KAAK,SAAS,EAAE,CAAC;AAMpF,sCAAsC;AACtC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,GAAG,IAAI,CAEvE;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,GAAG,SAAS,EAAE,CAM7F;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,YAAY,GACtB,SAAS,EAAE,CAcb"}
@@ -0,0 +1,43 @@
1
+ import type { DomainEntry, ImpactRule } from './load-rules.js';
2
+ import type { LookupIndex } from './lookups.js';
3
+ export interface ChangedFile {
4
+ path: string;
5
+ status: 'A' | 'M' | 'D' | 'R';
6
+ addedLines: string[];
7
+ }
8
+ export interface EvaluationResult {
9
+ ruleId: string;
10
+ triggerFile: string;
11
+ status: 'met' | 'unmet';
12
+ severity: 'error' | 'warning';
13
+ message: string;
14
+ }
15
+ /**
16
+ * Resolves `{same_dir}` and `{domain}` placeholders in a glob pattern.
17
+ *
18
+ * - `{same_dir}` is replaced with the directory of the trigger file.
19
+ * - `{domain}` is replaced with the name of the domain whose globs match
20
+ * the trigger file, or left as-is if no domain matches.
21
+ */
22
+ export declare function resolveTemplateVars(pattern: string, triggerFile: string, domains: Record<string, DomainEntry>): string;
23
+ /**
24
+ * Evaluates a trigger condition filter against a changed file.
25
+ *
26
+ * - `new_file`: true only when the file's git status is `A` (added).
27
+ * - `contains_new_pattern`: true when `pattern` regex matches any added line.
28
+ */
29
+ export declare function matchesCondition(file: ChangedFile, condition: string, pattern?: string): boolean;
30
+ /**
31
+ * Evaluates impact rules against a set of changed files and returns results.
32
+ *
33
+ * For each changed file that matches a rule's trigger (and passes any
34
+ * condition filter), the engine checks every `expect` entry:
35
+ *
36
+ * - `glob:` — resolved with template vars, then checked against allChangedPaths
37
+ * - `marker:` — checked against commit messages
38
+ * - `lookup:` — delegated to the LookupIndex
39
+ *
40
+ * Results are deduplicated by rule ID (first trigger wins).
41
+ */
42
+ export declare function evaluateRules(rules: ImpactRule[], changedFiles: ChangedFile[], allChangedPaths: string[], domains: Record<string, DomainEntry>, commitMessages: string[], lookupIndex?: LookupIndex): EvaluationResult[];
43
+ //# sourceMappingURL=impact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impact.d.ts","sourceRoot":"","sources":["../../src/traceability/impact.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAc,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAMhD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GACnC,MAAM,CAgBR;AA6BD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAYhG;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,UAAU,EAAE,EACnB,YAAY,EAAE,WAAW,EAAE,EAC3B,eAAe,EAAE,MAAM,EAAE,EACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACpC,cAAc,EAAE,MAAM,EAAE,EACxB,WAAW,CAAC,EAAE,WAAW,GACxB,gBAAgB,EAAE,CA2DpB"}