@gobing-ai/ts-rule-engine 0.2.5 → 0.2.7

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 (87) hide show
  1. package/dist/config/extensions.d.ts +46 -0
  2. package/dist/config/extensions.d.ts.map +1 -0
  3. package/dist/config/extensions.js +63 -0
  4. package/dist/config/loader.d.ts +15 -5
  5. package/dist/config/loader.d.ts.map +1 -1
  6. package/dist/config/loader.js +127 -33
  7. package/dist/engine.d.ts +26 -1
  8. package/dist/engine.d.ts.map +1 -1
  9. package/dist/engine.js +79 -0
  10. package/dist/evaluators/coverage-gate-evaluator.d.ts +21 -0
  11. package/dist/evaluators/coverage-gate-evaluator.d.ts.map +1 -0
  12. package/dist/evaluators/coverage-gate-evaluator.js +103 -0
  13. package/dist/evaluators/exit-code-evaluator.d.ts +1 -1
  14. package/dist/evaluators/exit-code-evaluator.d.ts.map +1 -1
  15. package/dist/evaluators/exit-code-evaluator.js +22 -9
  16. package/dist/evaluators/file-utils.d.ts +8 -0
  17. package/dist/evaluators/file-utils.d.ts.map +1 -1
  18. package/dist/evaluators/file-utils.js +40 -0
  19. package/dist/evaluators/forbidden-import-evaluator.d.ts +16 -3
  20. package/dist/evaluators/forbidden-import-evaluator.d.ts.map +1 -1
  21. package/dist/evaluators/forbidden-import-evaluator.js +71 -6
  22. package/dist/evaluators/import-boundary-evaluator.d.ts +19 -0
  23. package/dist/evaluators/import-boundary-evaluator.d.ts.map +1 -0
  24. package/dist/evaluators/import-boundary-evaluator.js +85 -0
  25. package/dist/evaluators/path-evaluator.d.ts +15 -2
  26. package/dist/evaluators/path-evaluator.d.ts.map +1 -1
  27. package/dist/evaluators/path-evaluator.js +49 -3
  28. package/dist/evaluators/regex-evaluator.d.ts.map +1 -1
  29. package/dist/evaluators/regex-evaluator.js +43 -8
  30. package/dist/evaluators/schema-artifact-evaluator.d.ts +21 -0
  31. package/dist/evaluators/schema-artifact-evaluator.d.ts.map +1 -0
  32. package/dist/evaluators/schema-artifact-evaluator.js +102 -0
  33. package/dist/evaluators/secrets-scanner-evaluator.d.ts +13 -2
  34. package/dist/evaluators/secrets-scanner-evaluator.d.ts.map +1 -1
  35. package/dist/evaluators/secrets-scanner-evaluator.js +72 -9
  36. package/dist/evaluators/sg-evaluator.d.ts +19 -0
  37. package/dist/evaluators/sg-evaluator.d.ts.map +1 -0
  38. package/dist/evaluators/sg-evaluator.js +112 -0
  39. package/dist/evaluators/test-location-evaluator.d.ts +32 -0
  40. package/dist/evaluators/test-location-evaluator.d.ts.map +1 -0
  41. package/dist/evaluators/test-location-evaluator.js +105 -0
  42. package/dist/evaluators/tsdoc-export-evaluator.d.ts +15 -0
  43. package/dist/evaluators/tsdoc-export-evaluator.d.ts.map +1 -0
  44. package/dist/evaluators/tsdoc-export-evaluator.js +91 -0
  45. package/dist/fixers/fixers.d.ts +86 -0
  46. package/dist/fixers/fixers.d.ts.map +1 -0
  47. package/dist/fixers/fixers.js +230 -0
  48. package/dist/fixers/test-stub-fixer.d.ts +49 -0
  49. package/dist/fixers/test-stub-fixer.d.ts.map +1 -0
  50. package/dist/fixers/test-stub-fixer.js +91 -0
  51. package/dist/host/builtins.d.ts.map +1 -1
  52. package/dist/host/builtins.js +17 -0
  53. package/dist/host/rule-engine-host.d.ts +3 -0
  54. package/dist/host/rule-engine-host.d.ts.map +1 -1
  55. package/dist/host/rule-engine-host.js +3 -0
  56. package/dist/index.d.ts +4 -0
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +4 -0
  59. package/dist/resolvers/test-path-resolver.d.ts +72 -0
  60. package/dist/resolvers/test-path-resolver.d.ts.map +1 -0
  61. package/dist/resolvers/test-path-resolver.js +112 -0
  62. package/dist/types.d.ts +30 -0
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/types.js +8 -0
  65. package/package.json +3 -3
  66. package/src/config/extensions.ts +108 -0
  67. package/src/config/loader.ts +140 -35
  68. package/src/engine.ts +99 -2
  69. package/src/evaluators/coverage-gate-evaluator.ts +137 -0
  70. package/src/evaluators/exit-code-evaluator.ts +27 -9
  71. package/src/evaluators/file-utils.ts +38 -0
  72. package/src/evaluators/forbidden-import-evaluator.ts +101 -7
  73. package/src/evaluators/import-boundary-evaluator.ts +135 -0
  74. package/src/evaluators/path-evaluator.ts +66 -3
  75. package/src/evaluators/regex-evaluator.ts +53 -12
  76. package/src/evaluators/schema-artifact-evaluator.ts +134 -0
  77. package/src/evaluators/secrets-scanner-evaluator.ts +89 -11
  78. package/src/evaluators/sg-evaluator.ts +133 -0
  79. package/src/evaluators/test-location-evaluator.ts +127 -0
  80. package/src/evaluators/tsdoc-export-evaluator.ts +111 -0
  81. package/src/fixers/fixers.ts +294 -0
  82. package/src/fixers/test-stub-fixer.ts +118 -0
  83. package/src/host/builtins.ts +22 -0
  84. package/src/host/rule-engine-host.ts +4 -0
  85. package/src/index.ts +4 -0
  86. package/src/resolvers/test-path-resolver.ts +133 -0
  87. package/src/types.ts +34 -0
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Core fixer pipeline: provider contracts, built-in fixer implementations,
3
+ * and the byte-range fix application function.
4
+ *
5
+ * @module rule-engine/fixers
6
+ */
7
+ import { NodeFileSystem, type ProcessExecutor } from '@gobing-ai/ts-runtime';
8
+ import type { CapabilityRegistry } from '../host/capability-registry';
9
+ import type { TestPathResolver } from '../resolvers/test-path-resolver';
10
+ import type { ConstraintFinding, ConstraintRule, Fix, FixMode, RuleContext } from '../types';
11
+ /** Numeric ordering for fix authority; higher means more write authority. */
12
+ export declare const FIX_MODE_RANK: Record<FixMode, number>;
13
+ /** Result of resolving effective fix authority for a rule. */
14
+ export interface EffectiveFix {
15
+ /** Effective mode after all downgrades. */
16
+ readonly mode: FixMode;
17
+ /** Optional replacement text configured by the rule author. */
18
+ readonly replacement?: string;
19
+ /** Optional provider-specific parameters. */
20
+ readonly params?: Record<string, unknown>;
21
+ }
22
+ /** Input passed to a rule fixer provider. */
23
+ export interface RuleFixerInput {
24
+ /** Rule that produced the findings. */
25
+ readonly rule: ConstraintRule;
26
+ /** Rule execution context. */
27
+ readonly context: RuleContext;
28
+ /** Findings emitted for this rule. */
29
+ readonly findings: ConstraintFinding[];
30
+ /** Effective fix metadata after authority enforcement. */
31
+ readonly fix: EffectiveFix;
32
+ }
33
+ /** Provider that turns findings into byte-range fixes. */
34
+ export interface RuleFixerProvider {
35
+ /** Produce fixes for mechanically fixable findings. */
36
+ createFixes(input: RuleFixerInput): Fix[] | Promise<Fix[]>;
37
+ }
38
+ /** Result of applying or previewing a batch of fixes. */
39
+ export interface FixApplicationResult {
40
+ /** Files changed in memory or on disk. */
41
+ readonly changedFiles: string[];
42
+ /** Fixes successfully applied. */
43
+ readonly applied: Fix[];
44
+ /** Fixes skipped because they overlapped an already-applied edit. */
45
+ readonly deferred: Fix[];
46
+ /** Unified diff when dry-run mode is requested. */
47
+ readonly diff: string;
48
+ }
49
+ /** Dependencies required for the built-in fixer registry. */
50
+ export interface BuiltInFixersDeps {
51
+ /** Resolver registry, required for TestStubFixer. */
52
+ resolvers: CapabilityRegistry<TestPathResolver>;
53
+ }
54
+ /** Registry of built-in rule fixer providers keyed by evaluator type. */
55
+ export declare function builtInFixers(host?: BuiltInFixersDeps, exec?: ProcessExecutor): Map<string, RuleFixerProvider>;
56
+ /** Resolve a workdir-relative or absolute path to an absolute path. */
57
+ export declare function resolveWorkdirPath(workdir: string, filePath: string): string;
58
+ /** Apply byte-range fixes to files, optionally returning a dry-run diff only. */
59
+ export declare function applyFixes(workdir: string, fixes: readonly Fix[], dryRun?: boolean, fs?: NodeFileSystem): Promise<FixApplicationResult>;
60
+ /** Create a coarse unified diff string for dry-run CLI output. */
61
+ export declare function createUnifiedDiff(filePath: string, before: string, after: string): string;
62
+ /**
63
+ * Fixer provider for `regex` / `rg` evaluators.
64
+ *
65
+ * For each finding with a known line number, reads the file and emits a Fix that
66
+ * replaces every regex match on that line using `rule.fix.replacement` as the
67
+ * replacement string (supports `$1` / `$&` back-references).
68
+ */
69
+ export declare class RegexFixerProvider implements RuleFixerProvider {
70
+ private readonly fs;
71
+ /** Produce fixes for regex-evaluator findings. */
72
+ createFixes({ rule, context, findings, fix }: RuleFixerInput): Promise<Fix[]>;
73
+ }
74
+ /**
75
+ * Fixer provider for `path` / `file-exist` evaluators.
76
+ *
77
+ * In `auto` mode, when a rule requires a file to be absent (`must: absent`),
78
+ * emits a Fix that replaces the entire file content with an empty string.
79
+ * `applyFixes` interprets a zero-length result spanning the full file as a deletion.
80
+ */
81
+ export declare class PathFixerProvider implements RuleFixerProvider {
82
+ private readonly fs;
83
+ /** Produce deletion fixes for path-evaluator findings. */
84
+ createFixes({ rule, context, findings, fix }: RuleFixerInput): Promise<Fix[]>;
85
+ }
86
+ //# sourceMappingURL=fixers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixers.d.ts","sourceRoot":"","sources":["../../src/fixers/fixers.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Core fixer pipeline: provider contracts, built-in fixer implementations,
3
+ * and the byte-range fix application function.
4
+ *
5
+ * @module rule-engine/fixers
6
+ */
7
+ import { isAbsolute, join, relative, resolve } from 'node:path';
8
+ import { NodeFileSystem } from '@gobing-ai/ts-runtime';
9
+ import { TestStubFixer } from './test-stub-fixer.js';
10
+ /** Numeric ordering for fix authority; higher means more write authority. */
11
+ export const FIX_MODE_RANK = {
12
+ none: 0,
13
+ suggest: 1,
14
+ auto: 2,
15
+ };
16
+ /** Registry of built-in rule fixer providers keyed by evaluator type. */
17
+ export function builtInFixers(host, exec) {
18
+ const regexFixer = new RegexFixerProvider();
19
+ const pathFixer = new PathFixerProvider();
20
+ const entries = [
21
+ ['regex', regexFixer],
22
+ ['rg', regexFixer],
23
+ ['path', pathFixer],
24
+ ['file-exist', pathFixer],
25
+ ];
26
+ if (host && exec) {
27
+ entries.push(['test-location', new TestStubFixer({ resolvers: host.resolvers, processExecutor: exec })]);
28
+ }
29
+ return new Map(entries);
30
+ }
31
+ /** Resolve a workdir-relative or absolute path to an absolute path. */
32
+ export function resolveWorkdirPath(workdir, filePath) {
33
+ return isAbsolute(filePath) ? filePath : join(workdir, filePath);
34
+ }
35
+ /** Apply byte-range fixes to files, optionally returning a dry-run diff only. */
36
+ export async function applyFixes(workdir, fixes, dryRun = false, fs = new NodeFileSystem()) {
37
+ const byFile = new Map();
38
+ for (const fix of fixes) {
39
+ const list = byFile.get(fix.filePath) ?? [];
40
+ list.push(fix);
41
+ byFile.set(fix.filePath, list);
42
+ }
43
+ const applied = [];
44
+ const deferred = [];
45
+ const changedFiles = [];
46
+ const diffs = [];
47
+ for (const [filePath, fileFixes] of byFile) {
48
+ const absPath = resolveWorkdirPath(workdir, filePath);
49
+ if (!isInsideWorkdir(workdir, absPath)) {
50
+ deferred.push(...fileFixes);
51
+ continue;
52
+ }
53
+ const fileExists = await fs.exists(absPath);
54
+ const original = fileExists ? await fs.readFile(absPath) : '';
55
+ const selected = selectNonOverlappingFixes(fileFixes);
56
+ deferred.push(...selected.deferred);
57
+ let next = original;
58
+ for (const fix of [...selected.applied].sort((a, b) => b.start - a.start)) {
59
+ if (!fileExists && (fix.start !== 0 || fix.end !== 0)) {
60
+ deferred.push(fix);
61
+ continue;
62
+ }
63
+ if (!isValidRange(fix.start, fix.end, original.length)) {
64
+ deferred.push(fix);
65
+ continue;
66
+ }
67
+ next = `${next.slice(0, fix.start)}${fix.replacement}${next.slice(fix.end)}`;
68
+ applied.push(fix);
69
+ }
70
+ if (next === original) {
71
+ continue;
72
+ }
73
+ changedFiles.push(filePath);
74
+ diffs.push(createUnifiedDiff(filePath, original, next));
75
+ if (!dryRun) {
76
+ const isFullDeletion = next.length === 0 && selected.applied.some((fix) => fix.start === 0 && fix.end === original.length);
77
+ if (isFullDeletion) {
78
+ await fs.unlink(absPath);
79
+ }
80
+ else {
81
+ await fs.writeFile(absPath, next);
82
+ }
83
+ }
84
+ }
85
+ return { changedFiles, applied, deferred, diff: diffs.join('\n') };
86
+ }
87
+ /** Create a coarse unified diff string for dry-run CLI output. */
88
+ export function createUnifiedDiff(filePath, before, after) {
89
+ const beforeLines = before.split('\n');
90
+ const afterLines = after.split('\n');
91
+ const lines = [`--- ${filePath}`, `+++ ${filePath}`, `@@ -1,${beforeLines.length} +1,${afterLines.length} @@`];
92
+ lines.push(...beforeLines.map((line) => `-${line}`));
93
+ lines.push(...afterLines.map((line) => `+${line}`));
94
+ return lines.join('\n');
95
+ }
96
+ /** Select the maximal non-overlapping set of fixes, ordered by ascending start offset. */
97
+ function selectNonOverlappingFixes(fixes) {
98
+ const applied = [];
99
+ const deferred = [];
100
+ const ordered = [...fixes].sort((a, b) => a.start - b.start || a.end - b.end);
101
+ let lastEnd = -1;
102
+ for (const fix of ordered) {
103
+ if (fix.start < lastEnd) {
104
+ deferred.push(fix);
105
+ continue;
106
+ }
107
+ applied.push(fix);
108
+ lastEnd = fix.end;
109
+ }
110
+ return { applied, deferred };
111
+ }
112
+ /** Return true when absPath is at or below workdir. */
113
+ function isInsideWorkdir(workdir, absPath) {
114
+ const rel = relative(resolve(workdir), resolve(absPath));
115
+ return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel));
116
+ }
117
+ /** Return true when [start, end] is a valid byte range for a string of contentLength bytes. */
118
+ function isValidRange(start, end, contentLength) {
119
+ return start >= 0 && end >= start && end <= contentLength;
120
+ }
121
+ /**
122
+ * Fixer provider for `regex` / `rg` evaluators.
123
+ *
124
+ * For each finding with a known line number, reads the file and emits a Fix that
125
+ * replaces every regex match on that line using `rule.fix.replacement` as the
126
+ * replacement string (supports `$1` / `$&` back-references).
127
+ */
128
+ export class RegexFixerProvider {
129
+ fs = new NodeFileSystem();
130
+ /** Produce fixes for regex-evaluator findings. */
131
+ async createFixes({ rule, context, findings, fix }) {
132
+ if (fix.mode === 'none' || fix.replacement === undefined)
133
+ return [];
134
+ // After the guard above, mode is guaranteed to not be 'none'.
135
+ const fixMode = fix.mode;
136
+ const replacement = fix.replacement;
137
+ const pattern = rule.evaluator.config?.pattern;
138
+ if (typeof pattern !== 'string' || pattern.length === 0)
139
+ return [];
140
+ const flags = flagsFromRule(rule);
141
+ const regex = new RegExp(pattern, flags.includes('g') ? flags : `${flags}g`);
142
+ const fixes = [];
143
+ for (const finding of findings) {
144
+ if (!finding.filePath)
145
+ continue;
146
+ const absPath = resolveWorkdirPath(context.workdir, finding.filePath);
147
+ if (!isInsideWorkdir(context.workdir, absPath) || finding.line == null)
148
+ continue;
149
+ if (!(await this.fs.exists(absPath)))
150
+ continue;
151
+ const source = await this.fs.readFile(absPath);
152
+ const line = getLineRange(source, finding.line);
153
+ if (!line)
154
+ continue;
155
+ for (const match of source.slice(line.start, line.end).matchAll(regex)) {
156
+ if (match.index === undefined)
157
+ continue;
158
+ const matched = match[0];
159
+ fixes.push({
160
+ ruleId: rule.id,
161
+ filePath: finding.filePath,
162
+ start: line.start + match.index,
163
+ end: line.start + match.index + matched.length,
164
+ replacement: matched.replace(new RegExp(pattern, flags), replacement),
165
+ mode: fixMode,
166
+ });
167
+ }
168
+ }
169
+ return fixes;
170
+ }
171
+ }
172
+ /**
173
+ * Fixer provider for `path` / `file-exist` evaluators.
174
+ *
175
+ * In `auto` mode, when a rule requires a file to be absent (`must: absent`),
176
+ * emits a Fix that replaces the entire file content with an empty string.
177
+ * `applyFixes` interprets a zero-length result spanning the full file as a deletion.
178
+ */
179
+ export class PathFixerProvider {
180
+ fs = new NodeFileSystem();
181
+ /** Produce deletion fixes for path-evaluator findings. */
182
+ async createFixes({ rule, context, findings, fix }) {
183
+ if (fix.mode !== 'auto' || rule.evaluator.config?.must !== 'absent')
184
+ return [];
185
+ const fixes = [];
186
+ for (const finding of findings) {
187
+ if (!finding.filePath)
188
+ continue;
189
+ const absPath = resolveWorkdirPath(context.workdir, finding.filePath);
190
+ if (!isInsideWorkdir(context.workdir, absPath))
191
+ continue;
192
+ if (!(await this.fs.exists(absPath)))
193
+ continue;
194
+ const content = await this.fs.readFile(absPath);
195
+ fixes.push({
196
+ ruleId: rule.id,
197
+ filePath: finding.filePath,
198
+ start: 0,
199
+ end: content.length,
200
+ replacement: '',
201
+ mode: 'auto',
202
+ });
203
+ }
204
+ return fixes;
205
+ }
206
+ }
207
+ /** Extract regex flags from a rule's evaluator config. */
208
+ function flagsFromRule(rule) {
209
+ const raw = rule.evaluator.config?.flags;
210
+ if (typeof raw !== 'string')
211
+ return '';
212
+ if (raw.startsWith('(?') && raw.endsWith(')')) {
213
+ return raw.slice(2, -1).replace(/[^imsuy]/g, '');
214
+ }
215
+ return raw.replace(/[^imsuy]/g, '');
216
+ }
217
+ /** Return the byte range [start, end) of a one-based line number within source. */
218
+ function getLineRange(source, oneBasedLine) {
219
+ if (oneBasedLine < 1)
220
+ return null;
221
+ let start = 0;
222
+ for (let line = 1; line < oneBasedLine; line += 1) {
223
+ const next = source.indexOf('\n', start);
224
+ if (next === -1)
225
+ return null;
226
+ start = next + 1;
227
+ }
228
+ const newline = source.indexOf('\n', start);
229
+ return { start, end: newline === -1 ? source.length : newline };
230
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Fixer that generates test file skeletons for source files missing tests.
3
+ *
4
+ * Resolver-aware: selects the correct {@link TestPathResolver} from
5
+ * `rule.evaluator.config.resolver`. Passes empty exports to the resolver's
6
+ * `generateSkeleton` — AST / sg discovery is intentionally omitted here to
7
+ * keep the shared package dependency-free; callers that need export-aware
8
+ * skeletons should register a custom resolver that performs its own discovery.
9
+ * Never overwrites an existing test file.
10
+ *
11
+ * @module rule-engine/fixers/test-stub-fixer
12
+ */
13
+ import { type ProcessExecutor } from '@gobing-ai/ts-runtime';
14
+ import type { CapabilityRegistry } from '../host/capability-registry';
15
+ import type { TestPathResolver } from '../resolvers/test-path-resolver';
16
+ import type { Fix } from '../types';
17
+ import type { RuleFixerInput, RuleFixerProvider } from './fixers';
18
+ /** File-system seam for dependency injection in tests. */
19
+ export interface TestStubFileSystem {
20
+ /** Resolve to true if the path exists on disk. */
21
+ exists(path: string): Promise<boolean>;
22
+ }
23
+ /** Real file-system implementation backed by the runtime FileSystem seam. */
24
+ export declare const realFileSystem: TestStubFileSystem;
25
+ /** Dependencies injected into {@link TestStubFixer}. */
26
+ export interface TestStubFixerDeps {
27
+ /** Resolver registry from the engine host. */
28
+ readonly resolvers: CapabilityRegistry<TestPathResolver>;
29
+ /** Process executor (reserved for future export discovery). */
30
+ readonly processExecutor: ProcessExecutor;
31
+ /** Optional file-system override for testing. */
32
+ readonly fileSystem?: TestStubFileSystem;
33
+ }
34
+ /**
35
+ * Fixer provider for the `test-location` evaluator.
36
+ *
37
+ * Emits a create-file Fix (start=0, end=0) for each finding whose source file
38
+ * has no corresponding test file yet. The test path and skeleton content are
39
+ * produced by the resolver named in `rule.evaluator.config.resolver`
40
+ * (default: `typescript`).
41
+ */
42
+ export declare class TestStubFixer implements RuleFixerProvider {
43
+ private readonly resolvers;
44
+ private readonly fs;
45
+ constructor(deps: TestStubFixerDeps);
46
+ /** Produce create-file fixes for missing test stubs. */
47
+ createFixes(input: RuleFixerInput): Promise<Fix[]>;
48
+ }
49
+ //# sourceMappingURL=test-stub-fixer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-stub-fixer.d.ts","sourceRoot":"","sources":["../../src/fixers/test-stub-fixer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElE,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IAC/B,kDAAkD;IAClD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C;AAED,6EAA6E;AAC7E,eAAO,MAAM,cAAc,EAAE,kBAAyC,CAAC;AAEvE,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAC9B,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACzD,+DAA+D;IAC/D,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,iDAAiD;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;CAC5C;AAUD;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,iBAAiB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuC;IACjE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAqB;gBAE5B,IAAI,EAAE,iBAAiB;IAOnC,wDAAwD;IAClD,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CAkD3D"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Fixer that generates test file skeletons for source files missing tests.
3
+ *
4
+ * Resolver-aware: selects the correct {@link TestPathResolver} from
5
+ * `rule.evaluator.config.resolver`. Passes empty exports to the resolver's
6
+ * `generateSkeleton` — AST / sg discovery is intentionally omitted here to
7
+ * keep the shared package dependency-free; callers that need export-aware
8
+ * skeletons should register a custom resolver that performs its own discovery.
9
+ * Never overwrites an existing test file.
10
+ *
11
+ * @module rule-engine/fixers/test-stub-fixer
12
+ */
13
+ import { isAbsolute, join } from 'node:path';
14
+ import { NodeFileSystem } from '@gobing-ai/ts-runtime';
15
+ /** Real file-system implementation backed by the runtime FileSystem seam. */
16
+ export const realFileSystem = new NodeFileSystem();
17
+ /** Normalize a finding path to a repository-relative POSIX path, or return null when invalid. */
18
+ function normalizeFindingPath(filePath) {
19
+ if (!filePath || isAbsolute(filePath))
20
+ return null;
21
+ const normalized = filePath.replaceAll('\\', '/').replace(/^\.\//, '');
22
+ if (normalized === '..' || normalized.startsWith('../') || normalized.includes('/../'))
23
+ return null;
24
+ return normalized;
25
+ }
26
+ /**
27
+ * Fixer provider for the `test-location` evaluator.
28
+ *
29
+ * Emits a create-file Fix (start=0, end=0) for each finding whose source file
30
+ * has no corresponding test file yet. The test path and skeleton content are
31
+ * produced by the resolver named in `rule.evaluator.config.resolver`
32
+ * (default: `typescript`).
33
+ */
34
+ export class TestStubFixer {
35
+ resolvers;
36
+ fs;
37
+ constructor(deps) {
38
+ this.resolvers = deps.resolvers;
39
+ // processExecutor is accepted for interface parity but export discovery
40
+ // is not performed in this shared-package implementation — see module doc.
41
+ this.fs = deps.fileSystem ?? realFileSystem;
42
+ }
43
+ /** Produce create-file fixes for missing test stubs. */
44
+ async createFixes(input) {
45
+ const { rule, context, findings, fix } = input;
46
+ if (fix.mode === 'none')
47
+ return [];
48
+ const resolverName = rule.evaluator.config?.resolver ?? 'typescript';
49
+ let resolver;
50
+ try {
51
+ resolver = this.resolvers.get(resolverName);
52
+ }
53
+ catch {
54
+ // Resolver not registered — return no fixes rather than silently falling back.
55
+ return [];
56
+ }
57
+ const result = [];
58
+ for (const finding of findings) {
59
+ if (!finding.filePath)
60
+ continue;
61
+ const srcRelPath = normalizeFindingPath(finding.filePath);
62
+ if (!srcRelPath)
63
+ continue;
64
+ let testRelPath;
65
+ try {
66
+ testRelPath = resolver.resolveTestPath(srcRelPath);
67
+ }
68
+ catch {
69
+ continue;
70
+ }
71
+ const absTestPath = join(context.workdir, testRelPath);
72
+ if (await this.fs.exists(absTestPath))
73
+ continue;
74
+ // Export discovery is intentionally omitted — pass empty exports array.
75
+ // Resolvers that need per-export stubs should perform their own discovery.
76
+ const skeleton = resolver.generateSkeleton?.(srcRelPath, []) ?? '';
77
+ if (!skeleton)
78
+ continue;
79
+ result.push({
80
+ ruleId: rule.id,
81
+ filePath: testRelPath,
82
+ start: 0,
83
+ end: 0,
84
+ replacement: skeleton,
85
+ // fix.mode !== 'none' is guaranteed by the guard at the top of this method.
86
+ mode: fix.mode,
87
+ });
88
+ }
89
+ return result;
90
+ }
91
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../src/host/builtins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAS7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,CAavF"}
1
+ {"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../src/host/builtins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAqB7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,CAuBvF"}
@@ -1,11 +1,18 @@
1
1
  import { AgentDetectionEvaluator } from '../evaluators/agent-detection-evaluator.js';
2
+ import { CoverageGateEvaluator } from '../evaluators/coverage-gate-evaluator.js';
2
3
  import { ExitCodeEvaluator } from '../evaluators/exit-code-evaluator.js';
3
4
  import { ForbiddenImportEvaluator } from '../evaluators/forbidden-import-evaluator.js';
5
+ import { ImportBoundaryEvaluator } from '../evaluators/import-boundary-evaluator.js';
4
6
  import { PathEvaluator } from '../evaluators/path-evaluator.js';
5
7
  import { RegexEvaluator } from '../evaluators/regex-evaluator.js';
8
+ import { SchemaArtifactEvaluator } from '../evaluators/schema-artifact-evaluator.js';
6
9
  import { SecretsScannerEvaluator } from '../evaluators/secrets-scanner-evaluator.js';
10
+ import { SgEvaluator } from '../evaluators/sg-evaluator.js';
11
+ import { TestLocationEvaluator } from '../evaluators/test-location-evaluator.js';
12
+ import { TsdocExportEvaluator } from '../evaluators/tsdoc-export-evaluator.js';
7
13
  import { JsonFormatter } from '../formatters/json.js';
8
14
  import { TextFormatter } from '../formatters/text.js';
15
+ import { GoTestPathResolver, PythonTestPathResolver, RustTestPathResolver, TypeScriptTestPathResolver, } from '../resolvers/test-path-resolver.js';
9
16
  /** Register bundled evaluators and formatters on a host. */
10
17
  export function registerBuiltins(host, executor) {
11
18
  const regex = new RegexEvaluator();
@@ -18,6 +25,16 @@ export function registerBuiltins(host, executor) {
18
25
  host.evaluators.register('exit-code', new ExitCodeEvaluator(executor), 'builtin');
19
26
  host.evaluators.register('secrets-scanner', new SecretsScannerEvaluator(), 'builtin');
20
27
  host.evaluators.register('agent-detection', new AgentDetectionEvaluator(), 'builtin');
28
+ host.evaluators.register('coverage-gate', new CoverageGateEvaluator(), 'builtin');
29
+ host.evaluators.register('tsdoc-export', new TsdocExportEvaluator(), 'builtin');
30
+ host.resolvers.register('typescript', new TypeScriptTestPathResolver(), 'builtin');
31
+ host.resolvers.register('python', new PythonTestPathResolver(), 'builtin');
32
+ host.resolvers.register('go', new GoTestPathResolver(), 'builtin');
33
+ host.resolvers.register('rust', new RustTestPathResolver(), 'builtin');
34
+ host.evaluators.register('test-location', new TestLocationEvaluator(host.resolvers), 'builtin');
35
+ host.evaluators.register('sg', new SgEvaluator(executor), 'builtin');
36
+ host.evaluators.register('schema-artifact', new SchemaArtifactEvaluator(), 'builtin');
37
+ host.evaluators.register('import-boundary', new ImportBoundaryEvaluator(), 'builtin');
21
38
  host.formatters.register('text', new TextFormatter(), 'builtin');
22
39
  host.formatters.register('json', new JsonFormatter(), 'builtin');
23
40
  }
@@ -1,3 +1,4 @@
1
+ import type { TestPathResolver } from '../resolvers/test-path-resolver';
1
2
  import type { ResultFormatter, RuleEvaluator } from '../types';
2
3
  import { CapabilityRegistry } from './capability-registry';
3
4
  /** Host container for rule-engine capabilities. */
@@ -6,6 +7,8 @@ export declare class RuleEngineHost {
6
7
  readonly evaluators: CapabilityRegistry<RuleEvaluator>;
7
8
  /** Formatter registry keyed by formatter name. */
8
9
  readonly formatters: CapabilityRegistry<ResultFormatter>;
10
+ /** Test-path resolver registry keyed by language name. */
11
+ readonly resolvers: CapabilityRegistry<TestPathResolver>;
9
12
  constructor();
10
13
  }
11
14
  //# sourceMappingURL=rule-engine-host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rule-engine-host.d.ts","sourceRoot":"","sources":["../../src/host/rule-engine-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,mDAAmD;AACnD,qBAAa,cAAc;IACvB,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACvD,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;;CAM5D"}
1
+ {"version":3,"file":"rule-engine-host.d.ts","sourceRoot":"","sources":["../../src/host/rule-engine-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,mDAAmD;AACnD,qBAAa,cAAc;IACvB,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACvD,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACzD,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;;CAO5D"}
@@ -5,8 +5,11 @@ export class RuleEngineHost {
5
5
  evaluators;
6
6
  /** Formatter registry keyed by formatter name. */
7
7
  formatters;
8
+ /** Test-path resolver registry keyed by language name. */
9
+ resolvers;
8
10
  constructor() {
9
11
  this.evaluators = new CapabilityRegistry('evaluator');
10
12
  this.formatters = new CapabilityRegistry('formatter');
13
+ this.resolvers = new CapabilityRegistry('resolver');
11
14
  }
12
15
  }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,12 @@
1
+ export * from './config/extensions';
1
2
  export * from './config/loader';
2
3
  export * from './engine';
4
+ export * from './fixers/fixers';
5
+ export * from './fixers/test-stub-fixer';
3
6
  export * from './formatters/json';
4
7
  export * from './formatters/text';
5
8
  export * from './host/capability-registry';
6
9
  export * from './host/rule-engine-host';
10
+ export * from './resolvers/test-path-resolver';
7
11
  export * from './types';
8
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
+ export * from './config/extensions.js';
1
2
  export * from './config/loader.js';
2
3
  export * from './engine.js';
4
+ export * from './fixers/fixers.js';
5
+ export * from './fixers/test-stub-fixer.js';
3
6
  export * from './formatters/json.js';
4
7
  export * from './formatters/text.js';
5
8
  export * from './host/capability-registry.js';
6
9
  export * from './host/rule-engine-host.js';
10
+ export * from './resolvers/test-path-resolver.js';
7
11
  export * from './types.js';
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Pluggable test-path resolution for the test-location evaluator.
3
+ *
4
+ * Each implementation maps a source file path to its conventional test file path
5
+ * for one language, so the same evaluator works across TypeScript, Python, Go, and
6
+ * Rust projects. Resolvers are registered on the host and selected per rule via
7
+ * `evaluator.config.resolver`.
8
+ */
9
+ /** Metadata about an exported symbol, used when generating a test skeleton. */
10
+ export interface ExportInfo {
11
+ /** Symbol name. */
12
+ readonly name: string;
13
+ /** Declaration kind. */
14
+ readonly kind: 'function' | 'class' | 'const' | 'type' | 'interface' | 'unknown';
15
+ /** One-based source line, when known. */
16
+ readonly line?: number;
17
+ }
18
+ /** Maps source files to expected test files for a project type. */
19
+ export interface TestPathResolver {
20
+ /** Language name this resolver handles (registry key). */
21
+ readonly name: string;
22
+ /** Compute the expected test file path for a source file. */
23
+ resolveTestPath(srcRelPath: string): string;
24
+ /** Optionally generate a test skeleton for a source file. */
25
+ generateSkeleton?(srcRelPath: string, exports: ExportInfo[]): string;
26
+ }
27
+ /**
28
+ * TypeScript conventions:
29
+ * src/foo/bar.ts → tests/foo/bar.test.ts
30
+ * packages/core/src/foo/bar.ts → packages/core/tests/foo/bar.test.ts
31
+ */
32
+ export declare class TypeScriptTestPathResolver implements TestPathResolver {
33
+ /** Registry key. */
34
+ readonly name = "typescript";
35
+ constructor();
36
+ /** Map a TS/JS source path to its `tests/…test.ts` counterpart. */
37
+ resolveTestPath(srcRelPath: string): string;
38
+ }
39
+ /**
40
+ * Python conventions (pytest):
41
+ * src/foo/bar.py → tests/foo/test_bar.py
42
+ */
43
+ export declare class PythonTestPathResolver implements TestPathResolver {
44
+ /** Registry key. */
45
+ readonly name = "python";
46
+ constructor();
47
+ /** Map a Python source path to its `tests/…/test_*.py` counterpart. */
48
+ resolveTestPath(srcRelPath: string): string;
49
+ }
50
+ /**
51
+ * Go conventions:
52
+ * foo/bar.go → foo/bar_test.go (sibling)
53
+ */
54
+ export declare class GoTestPathResolver implements TestPathResolver {
55
+ /** Registry key. */
56
+ readonly name = "go";
57
+ constructor();
58
+ /** Map a Go source path to its sibling `_test.go` file. */
59
+ resolveTestPath(srcRelPath: string): string;
60
+ }
61
+ /**
62
+ * Rust conventions (Cargo integration tests):
63
+ * crate/src/foo.rs → crate/tests/foo.rs
64
+ */
65
+ export declare class RustTestPathResolver implements TestPathResolver {
66
+ /** Registry key. */
67
+ readonly name = "rust";
68
+ constructor();
69
+ /** Map a Rust source path to its `tests/` integration-test counterpart. */
70
+ resolveTestPath(srcRelPath: string): string;
71
+ }
72
+ //# sourceMappingURL=test-path-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-path-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/test-path-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACvB,mBAAmB;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IACjF,yCAAyC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,mEAAmE;AACnE,MAAM,WAAW,gBAAgB;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,6DAA6D;IAC7D,gBAAgB,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;CACxE;AAED;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,gBAAgB;IAC/D,oBAAoB;IACpB,QAAQ,CAAC,IAAI,gBAAgB;;IAI7B,mEAAmE;IACnE,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAW9C;AAED;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,gBAAgB;IAC3D,oBAAoB;IACpB,QAAQ,CAAC,IAAI,YAAY;;IAIzB,uEAAuE;IACvE,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAe9C;AAED;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,gBAAgB;IACvD,oBAAoB;IACpB,QAAQ,CAAC,IAAI,QAAQ;;IAIrB,2DAA2D;IAC3D,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAM9C;AAED;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,gBAAgB;IACzD,oBAAoB;IACpB,QAAQ,CAAC,IAAI,UAAU;;IAIvB,2EAA2E;IAC3E,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAY9C"}