@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,11 @@
1
+ /**
2
+ * Check Command — Flagship gap detection
3
+ *
4
+ * Combines structural gap detection (48 gap codes from contracts) with
5
+ * test coverage scanning (trace engine). Outputs severity-grouped results
6
+ * with file paths, IEC/ISO citations, and real gap messages from the engine.
7
+ *
8
+ * Exit code: 0 for warnings-only, 1 for errors.
9
+ */
10
+ export declare function runCheckCommand(args: string[]): Promise<void>;
11
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+BH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0CnE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Context Command
3
+ *
4
+ * Displays domain-scoped traceability context -- the requirement chain,
5
+ * risk neighbors, and architecture nodes for a given domain.
6
+ * Delegates to runTraceContext().
7
+ */
8
+ export declare function runContextCommand(args: string[]): Promise<void>;
9
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCrE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * DRM Check Command
3
+ *
4
+ * Checks Design Review Meeting adherence by parsing DRM markers from
5
+ * GitHub issues/PRs and verifying that required actions have been fulfilled
6
+ * in the git diff.
7
+ */
8
+ export declare function runDrmCheckCommand(args: string[]): Promise<void>;
9
+ //# sourceMappingURL=drm-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drm-check.d.ts","sourceRoot":"","sources":["../../src/commands/drm-check.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsEH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDtE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Impact Command
3
+ *
4
+ * Determines which documents are affected by current git changes and
5
+ * compares gaps against the merge-base to report only NEW issues:
6
+ *
7
+ * 1. Gets changed files from git diff
8
+ * 2. Loads document graph via FilesystemDocumentLoader
9
+ * 3. Matches changed files to documents
10
+ * 4. Walks link graph bidirectionally (incoming + outgoing)
11
+ * 5. Runs gap detection on head (current tree)
12
+ * 6. Scans baseline gaps at merge-base commit
13
+ * 7. Diffs gaps to find new/resolved
14
+ * 8. Reports with link types, direction, and baseline comparison
15
+ */
16
+ export declare function runImpactCommand(args: string[]): Promise<void>;
17
+ //# sourceMappingURL=impact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impact.d.ts","sourceRoot":"","sources":["../../src/commands/impact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAqHH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmHpE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Report Command
3
+ *
4
+ * Generates a Software Test Report (STR) per IEC 62304 section 5.7.
5
+ * Delegates to generateTestReport() from the test-report module.
6
+ */
7
+ export declare function runReportCommand(args: string[]): Promise<void>;
8
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCpE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Risk Command
3
+ *
4
+ * Computes a full risk profile: 5x5 risk matrix with acceptability
5
+ * breakdown (ISO 14971) plus risk-related gap detection (IEC 62304).
6
+ */
7
+ export declare function runRiskCommand(args: string[]): Promise<void>;
8
+ //# sourceMappingURL=risk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"risk.d.ts","sourceRoot":"","sources":["../../src/commands/risk.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA+IH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsClE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * RTM Command
3
+ *
4
+ * Generates a Requirements Traceability Matrix using the legacy traceability engine.
5
+ * Delegates to runLegacyTraceability() in RTM mode.
6
+ */
7
+ export declare function runRtmCommand(args: string[]): Promise<void>;
8
+ //# sourceMappingURL=rtm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rtm.d.ts","sourceRoot":"","sources":["../../src/commands/rtm.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Validate Command
3
+ *
4
+ * Delegates to validateDocument() / validateDirectory() from @pactosigna/schemas.
5
+ * Accepts file or directory paths as positional args.
6
+ */
7
+ export declare function runValidateCommand(args: string[]): Promise<void>;
8
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6EtE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * VSR Command
3
+ *
4
+ * Generates a Validation Summary Report per IEC 62304 section 5.8.
5
+ * Combines RTM + STR + risk summary into a single report.
6
+ * Delegates to generateVSR() from the validation-report module.
7
+ */
8
+ export declare function runVsrCommand(args: string[]): Promise<void>;
9
+ //# sourceMappingURL=vsr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vsr.d.ts","sourceRoot":"","sources":["../../src/commands/vsr.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BjE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Config Loader -- reads pactosigna-trace.yaml from the repository root
3
+ *
4
+ * Falls back to empty defaults if the file doesn't exist or is malformed.
5
+ * Does NOT fall back to pactosigna.yaml (separate concerns).
6
+ */
7
+ import type { TraceConfig } from './types.js';
8
+ /**
9
+ * Load trace configuration from `pactosigna-trace.yaml` in the given root directory.
10
+ *
11
+ * Returns defaults when the file doesn't exist or contains invalid YAML.
12
+ */
13
+ export declare function loadTraceConfig(rootDir: string): TraceConfig;
14
+ //# sourceMappingURL=load-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/config/load-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,YAAY,CAAC;AAiGpB;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CA8B5D"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * TraceConfig -- Configuration types for pactosigna-trace.yaml
3
+ *
4
+ * Customers with non-standard folder structures use this config to
5
+ * override default FOLDER_RULES. Also provides `deviceSafetyClass`
6
+ * for gap severity scaling, `codeMap` for the impact command,
7
+ * `softwareItems` for context/assess commands, and `impactRules`
8
+ * for the legacy context command.
9
+ */
10
+ export interface CodeMapEntry {
11
+ /** Glob pattern matching source code paths */
12
+ path: string;
13
+ /** Software items (document IDs) affected by changes in matched paths */
14
+ softwareItems: string[];
15
+ }
16
+ export interface FolderOverride {
17
+ /** Glob pattern matching document paths (e.g. "docs/hazards/**") */
18
+ pattern: string;
19
+ /** Document type to assign to matched files */
20
+ docType: string;
21
+ /** Optional document ID prefixes expected in this folder */
22
+ prefixes?: string[];
23
+ }
24
+ export interface SoftwareItemConfig {
25
+ /** Domain identifier, e.g. "releases" */
26
+ domain: string;
27
+ /** Glob patterns for code paths belonging to this software item */
28
+ codePaths: string[];
29
+ /** Architecture document IDs, e.g. ["HLD-001", "SDD-REL"] */
30
+ architecture: string[];
31
+ }
32
+ export interface ImpactRulesConfig {
33
+ /** Domain-scoped file pattern registry */
34
+ domains: Record<string, Record<string, string[]>>;
35
+ /** Structured impact rules with triggers and expectations */
36
+ rules: Array<Record<string, unknown>>;
37
+ }
38
+ export interface TraceConfig {
39
+ /** Config file version (currently 1) */
40
+ version: number;
41
+ /** Device safety class (A/B/C per IEC 62304) -- controls gap severity scaling */
42
+ deviceSafetyClass?: string;
43
+ /** Code-path to software-item mapping (used by trace impact) */
44
+ codeMap: CodeMapEntry[];
45
+ /** Custom folder rules -- override default FOLDER_RULES for document type inference */
46
+ folderOverrides: FolderOverride[];
47
+ /** Software items -- bounded context to code paths and architecture docs */
48
+ softwareItems?: Record<string, SoftwareItemConfig>;
49
+ /** Impact rules -- domain file patterns and structured rules for doc change detection */
50
+ impactRules?: ImpactRulesConfig;
51
+ }
52
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAClD,6DAA6D;IAC7D,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gEAAgE;IAChE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,uFAAuF;IACvF,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACnD,yFAAyF;IACzF,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Check Command Output Formatter
3
+ *
4
+ * Formats gap detection results for human-readable text and machine-readable JSON.
5
+ * Text mode shows severity-grouped gaps with file paths and IEC/ISO citations.
6
+ * JSON mode outputs structured results for CI integration.
7
+ */
8
+ import type { DocumentRef, GapDetectionResult } from '@pactosigna/domain';
9
+ import type { TraceCheckResult } from '../traceability/trace-cli.js';
10
+ export interface CheckFormatOptions {
11
+ documents: DocumentRef[];
12
+ links: {
13
+ sourceDocumentId: string;
14
+ targetDocumentId: string;
15
+ linkType: string;
16
+ }[];
17
+ gapResult: GapDetectionResult;
18
+ traceResult: TraceCheckResult;
19
+ format: 'text' | 'json';
20
+ verbose: boolean;
21
+ filePathMap: Map<string, string>;
22
+ }
23
+ export interface CheckFormatOutput {
24
+ output: string;
25
+ exitCode: number;
26
+ }
27
+ export declare function formatCheckOutput(opts: CheckFormatOptions): CheckFormatOutput;
28
+ //# sourceMappingURL=format-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-check.d.ts","sourceRoot":"","sources":["../../src/formatters/format-check.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAO,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,KAAK,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClF,SAAS,EAAE,kBAAkB,CAAC;IAC9B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuFD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,iBAAiB,CAK7E"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Impact Command Output Formatter
3
+ *
4
+ * Formats baseline-diffed gap results for human-readable text and
5
+ * machine-readable JSON. Text mode shows neighbor graph with link
6
+ * directions and severity-grouped new/resolved gaps.
7
+ */
8
+ import type { Gap } from '@pactosigna/domain';
9
+ import type { GapDiffResult } from '../impact/diff-gaps.js';
10
+ interface Neighbor {
11
+ documentId: string;
12
+ title: string;
13
+ linkType: string;
14
+ direction: 'outgoing' | 'incoming';
15
+ filePath?: string;
16
+ }
17
+ interface ChangedDocInfo {
18
+ documentId: string;
19
+ docType: string;
20
+ filePath?: string;
21
+ neighbors: Neighbor[];
22
+ newGaps: Gap[];
23
+ }
24
+ export interface ImpactFormatOptions {
25
+ changedFiles: number;
26
+ changedDocs: ChangedDocInfo[];
27
+ diff: GapDiffResult;
28
+ format: 'text' | 'json';
29
+ verbose: boolean;
30
+ }
31
+ export interface ImpactFormatOutput {
32
+ output: string;
33
+ exitCode: number;
34
+ }
35
+ export declare function formatImpactOutput(opts: ImpactFormatOptions): ImpactFormatOutput;
36
+ export {};
37
+ //# sourceMappingURL=format-impact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-impact.d.ts","sourceRoot":"","sources":["../../src/formatters/format-impact.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,UAAU,QAAQ;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,EAAE,GAAG,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AA8FD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,kBAAkB,CAKhF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Risk Command Output Formatter
3
+ *
4
+ * Formats risk matrix calculation + gap detection results for
5
+ * human-readable text and machine-readable JSON output.
6
+ */
7
+ import type { Gap } from '@pactosigna/domain';
8
+ import type { RiskMatrixResult } from '@pactosigna/domain';
9
+ export interface RiskFormatOptions {
10
+ matrix: RiskMatrixResult;
11
+ gaps: Gap[];
12
+ riskDocCount: number;
13
+ format: 'text' | 'json';
14
+ verbose: boolean;
15
+ }
16
+ export interface RiskFormatOutput {
17
+ output: string;
18
+ exitCode: number;
19
+ }
20
+ export declare function formatRiskOutput(opts: RiskFormatOptions): RiskFormatOutput;
21
+ //# sourceMappingURL=format-risk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-risk.d.ts","sourceRoot":"","sources":["../../src/formatters/format-risk.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuFD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,gBAAgB,CAK1E"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Baseline Scanner — runs gap detection at the merge-base commit
3
+ *
4
+ * Creates a temporary git worktree at the merge-base, loads documents,
5
+ * runs detectAllGaps(), and cleans up. Falls back to an empty gap list
6
+ * when git operations fail (shallow clones, detached HEAD, etc.).
7
+ */
8
+ import type { Gap } from '@pactosigna/domain';
9
+ import type { TraceConfig } from '../config/types.js';
10
+ /**
11
+ * Scan for gaps at the merge-base commit between HEAD and the given base branch.
12
+ *
13
+ * Uses a temporary git worktree to check out the merge-base without
14
+ * disturbing the working tree. Returns an empty array on failure
15
+ * (all gaps will appear as "new" — safe fallback for shallow clones).
16
+ */
17
+ export declare function scanBaselineGaps(rootDir: string, baseBranch: string, config: TraceConfig): Gap[];
18
+ //# sourceMappingURL=baseline-scan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseline-scan.d.ts","sourceRoot":"","sources":["../../src/impact/baseline-scan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,GAAG,EAAE,CA2ChG"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Gap Diffing — compares baseline (merge-base) gaps against head gaps
3
+ *
4
+ * Only NEW or WORSENED gaps are reported as actionable. Pre-existing
5
+ * gaps are filtered out so PRs don't show inherited noise.
6
+ */
7
+ import type { Gap } from '@pactosigna/domain';
8
+ export interface GapDiffResult {
9
+ /** Gaps that exist on HEAD but not on the baseline */
10
+ newGaps: Gap[];
11
+ /** Gaps that existed on the baseline but are gone on HEAD */
12
+ resolvedGaps: Gap[];
13
+ /** Number of gaps present on both baseline and HEAD */
14
+ unchangedCount: number;
15
+ }
16
+ /**
17
+ * Diff two gap sets to find new, resolved, and unchanged gaps.
18
+ */
19
+ export declare function diffGaps(baseGaps: Gap[], headGaps: Gap[]): GapDiffResult;
20
+ //# sourceMappingURL=diff-gaps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-gaps.d.ts","sourceRoot":"","sources":["../../src/impact/diff-gaps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,6DAA6D;IAC7D,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;CACxB;AAUD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,aAAa,CAgBxE"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @pactosigna/trace — Public API
3
+ *
4
+ * QMS traceability engine for IEC 62304 / ISO 14971 compliance.
5
+ * Provides gap detection, impact analysis, test reports, and
6
+ * validation summary reports.
7
+ */
8
+ export { loadTraceConfig } from './config/load-config.js';
9
+ export type { TraceConfig, CodeMapEntry, FolderOverride, SoftwareItemConfig, ImpactRulesConfig, } from './config/types.js';
10
+ export { FilesystemDocumentLoader } from './loaders/filesystem-document-loader.js';
11
+ export { extractReqTagsFromFeature, findOrphanScenarios } from './traceability/scan-e2e.js';
12
+ export { extractReqMarkersFromTestFile } from './traceability/scan-unit.js';
13
+ export { parseRequirementsFromMarkdown } from './traceability/parse-requirements.js';
14
+ export { buildTraceabilityReport, buildDocumentChainGaps } from './traceability/cross-reference.js';
15
+ export type { Requirement, TestReference, TraceabilityMatrix, ComplianceEntry, TraceabilityReport, GapCategory, DocumentLink, RiskEntry, } from './traceability/types.js';
16
+ export type { Gap as TraceGap } from './traceability/types.js';
17
+ export { runLegacyTraceability } from './traceability/index.js';
18
+ export type { LegacyTraceOptions, LegacyTraceResult } from './traceability/index.js';
19
+ export { diffGaps } from './impact/diff-gaps.js';
20
+ export { scanBaselineGaps } from './impact/baseline-scan.js';
21
+ export type { GapDiffResult } from './impact/diff-gaps.js';
22
+ export { runTraceCheck, runTraceContext, runTraceImpact, runTraceAssess, } from './traceability/trace-cli.js';
23
+ export type { TraceCheckResult } from './traceability/trace-cli.js';
24
+ export { generateTestReport, buildSTRReport, formatSTR, parseVitestResults, parsePlaywrightResults, } from './test-report/index.js';
25
+ export type { TestReportOptions, TestResult, TestSuiteResult, STRReport, STRSummary, STREnvironment, RequirementCoverageEntry, } from './test-report/index.js';
26
+ export { generateVSR } from './validation-report/index.js';
27
+ export type { GitContext, VSROptions } from './validation-report/index.js';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAG5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAGrF,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGpG,YAAY,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,SAAS,GACV,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,GAAG,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGrF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,cAAc,EACd,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC"}