@company-semantics/contracts 0.21.1 → 0.23.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.
- package/package.json +10 -1
- package/src/guards/config.ts +54 -0
- package/src/guards/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@company-semantics/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
"types": "./src/compatibility.ts",
|
|
21
21
|
"default": "./src/compatibility.ts"
|
|
22
22
|
},
|
|
23
|
+
"./identity": {
|
|
24
|
+
"types": "./src/identity/index.ts",
|
|
25
|
+
"default": "./src/identity/index.ts"
|
|
26
|
+
},
|
|
27
|
+
"./mcp": {
|
|
28
|
+
"types": "./src/mcp/index.ts",
|
|
29
|
+
"default": "./src/mcp/index.ts"
|
|
30
|
+
},
|
|
23
31
|
"./schemas/guard-result.schema.json": "./schemas/guard-result.schema.json"
|
|
24
32
|
},
|
|
25
33
|
"types": "./src/index.ts",
|
|
@@ -32,6 +40,7 @@
|
|
|
32
40
|
},
|
|
33
41
|
"scripts": {
|
|
34
42
|
"typecheck": "tsc -b --noEmit",
|
|
43
|
+
"typecheck:ci": "tsc -p scripts/ci/tsconfig.json",
|
|
35
44
|
"lint:md": "markdownlint-cli2 '**/*.md' '#node_modules'",
|
|
36
45
|
"lint:json": "node -e \"JSON.parse(require('fs').readFileSync('package.json'))\"",
|
|
37
46
|
"prepare": "husky",
|
package/src/guards/config.ts
CHANGED
|
@@ -288,6 +288,22 @@ export interface EvolutionBaselines {
|
|
|
288
288
|
* Errors when coverage drops below baseline (enforced).
|
|
289
289
|
*/
|
|
290
290
|
coverage?: CoverageBaseline;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* File cluster detection configuration.
|
|
294
|
+
* CI injects checkFileClusters based on this config.
|
|
295
|
+
* Advisory only: suggests folder reorganization.
|
|
296
|
+
*
|
|
297
|
+
* @see ADR-CI-010
|
|
298
|
+
*/
|
|
299
|
+
fileClusters?: FileClusterBaseline;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Subdirectory affinity detection configuration.
|
|
303
|
+
* CI injects checkSubdirectoryAffinity based on this config.
|
|
304
|
+
* Advisory only: suggests moving files to subdirectories.
|
|
305
|
+
*/
|
|
306
|
+
subdirectoryAffinity?: SubdirectoryAffinityBaseline;
|
|
291
307
|
}
|
|
292
308
|
|
|
293
309
|
/**
|
|
@@ -303,6 +319,44 @@ export interface CoverageBaseline {
|
|
|
303
319
|
dropThreshold?: number;
|
|
304
320
|
}
|
|
305
321
|
|
|
322
|
+
/**
|
|
323
|
+
* File cluster detection configuration.
|
|
324
|
+
* Detects clusters of related files that could benefit from
|
|
325
|
+
* parent-child folder organization.
|
|
326
|
+
*
|
|
327
|
+
* @see ADR-CI-010
|
|
328
|
+
*/
|
|
329
|
+
export interface FileClusterBaseline {
|
|
330
|
+
/** Minimum files to form a cluster */
|
|
331
|
+
minClusterSize: number;
|
|
332
|
+
/** Minimum stragglers to suggest reorganization */
|
|
333
|
+
minStragglers: number;
|
|
334
|
+
/** Suffixes to strip when detecting clusters (e.g., '.test', '.spec') */
|
|
335
|
+
stripSuffixes: string[];
|
|
336
|
+
/** Role words to strip (e.g., 'Service', 'Handler') */
|
|
337
|
+
stripRoleWords: string[];
|
|
338
|
+
/** Directories to ignore */
|
|
339
|
+
ignoredDirectories: string[];
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Subdirectory affinity detection configuration.
|
|
344
|
+
* Detects files in a parent directory that are only imported by
|
|
345
|
+
* files within a single subdirectory, suggesting they should move.
|
|
346
|
+
*/
|
|
347
|
+
export interface SubdirectoryAffinityBaseline {
|
|
348
|
+
/** Minimum importers required */
|
|
349
|
+
minImporters: number;
|
|
350
|
+
/** Maximum non-subdirectory imports allowed */
|
|
351
|
+
maxNonSubdirImports: number;
|
|
352
|
+
/** Patterns to exclude from analysis */
|
|
353
|
+
excludePatterns: RegExp[];
|
|
354
|
+
/** Importer patterns to ignore */
|
|
355
|
+
ignoredImporterPatterns: RegExp[];
|
|
356
|
+
/** Directories to ignore */
|
|
357
|
+
ignoredDirectories: string[];
|
|
358
|
+
}
|
|
359
|
+
|
|
306
360
|
/**
|
|
307
361
|
* Registry of checks grouped by tier.
|
|
308
362
|
* Each repo exports this from guard-entries.ts for universal orchestration.
|