@opensip-cli/checks-typescript 0.1.5 β 0.1.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.
- package/README.md +2 -2
- package/dist/__tests__/all-checks-execute.test.js +3 -0
- package/dist/__tests__/all-checks-execute.test.js.map +1 -1
- package/dist/__tests__/behavior-fixtures-2.test.js +3 -0
- package/dist/__tests__/behavior-fixtures-2.test.js.map +1 -1
- package/dist/__tests__/behavior-fixtures-3.test.js +3 -0
- package/dist/__tests__/behavior-fixtures-3.test.js.map +1 -1
- package/dist/__tests__/behavior-fixtures-4.test.js +3 -0
- package/dist/__tests__/behavior-fixtures-4.test.js.map +1 -1
- package/dist/__tests__/behavior-fixtures-5.test.js +3 -0
- package/dist/__tests__/behavior-fixtures-5.test.js.map +1 -1
- package/dist/__tests__/behavior-fixtures-6.test.js +3 -0
- package/dist/__tests__/behavior-fixtures-6.test.js.map +1 -1
- package/dist/__tests__/behavior-fixtures.test.js +4 -0
- package/dist/__tests__/behavior-fixtures.test.js.map +1 -1
- package/dist/__tests__/branch-fixtures-2.test.js +3 -0
- package/dist/__tests__/branch-fixtures-2.test.js.map +1 -1
- package/dist/__tests__/branch-fixtures-3.test.js +3 -0
- package/dist/__tests__/branch-fixtures-3.test.js.map +1 -1
- package/dist/__tests__/branch-fixtures.test.js +3 -0
- package/dist/__tests__/branch-fixtures.test.js.map +1 -1
- package/dist/__tests__/host-tool-runtime-import-boundary.test.d.ts +2 -0
- package/dist/__tests__/host-tool-runtime-import-boundary.test.d.ts.map +1 -0
- package/dist/__tests__/host-tool-runtime-import-boundary.test.js +83 -0
- package/dist/__tests__/host-tool-runtime-import-boundary.test.js.map +1 -0
- package/dist/__tests__/subprocess-correlation-required.test.d.ts +2 -0
- package/dist/__tests__/subprocess-correlation-required.test.d.ts.map +1 -0
- package/dist/__tests__/subprocess-correlation-required.test.js +114 -0
- package/dist/__tests__/subprocess-correlation-required.test.js.map +1 -0
- package/dist/checks/architecture/host-tool-runtime-import-boundary.d.ts +15 -0
- package/dist/checks/architecture/host-tool-runtime-import-boundary.d.ts.map +1 -0
- package/dist/checks/architecture/host-tool-runtime-import-boundary.js +139 -0
- package/dist/checks/architecture/host-tool-runtime-import-boundary.js.map +1 -0
- package/dist/checks/architecture/index.d.ts +3 -0
- package/dist/checks/architecture/index.d.ts.map +1 -1
- package/dist/checks/architecture/index.js +3 -0
- package/dist/checks/architecture/index.js.map +1 -1
- package/dist/checks/architecture/no-run-done-result.d.ts +27 -0
- package/dist/checks/architecture/no-run-done-result.d.ts.map +1 -0
- package/dist/checks/architecture/no-run-done-result.js +120 -0
- package/dist/checks/architecture/no-run-done-result.js.map +1 -0
- package/dist/checks/architecture/subprocess-correlation-required.d.ts +28 -0
- package/dist/checks/architecture/subprocess-correlation-required.d.ts.map +1 -0
- package/dist/checks/architecture/subprocess-correlation-required.js +159 -0
- package/dist/checks/architecture/subprocess-correlation-required.js.map +1 -0
- package/dist/display/architecture.d.ts.map +1 -1
- package/dist/display/architecture.js +3 -0
- package/dist/display/architecture.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Keep ADR-0054's host-process runtime import exception narrow.
|
|
3
|
+
*
|
|
4
|
+
* External Tool runtimes still execute in the host process during the
|
|
5
|
+
* ADR-0054 migration because the current manifest only carries command
|
|
6
|
+
* metadata, not executable CommandSpec/RPC descriptors. That exception must
|
|
7
|
+
* remain explicit: every importToolRuntime call needs a source policy, and no
|
|
8
|
+
* new production call sites should appear outside the admission/discovery
|
|
9
|
+
* boundary.
|
|
10
|
+
*/
|
|
11
|
+
import { type CheckViolation } from '@opensip-cli/fitness';
|
|
12
|
+
/** Pure analysis over a parsed source file. Exported for unit tests. */
|
|
13
|
+
export declare function analyzeHostToolRuntimeImportBoundary(content: string, filePath: string): CheckViolation[];
|
|
14
|
+
export declare const hostToolRuntimeImportBoundary: import("@opensip-cli/fitness").Check;
|
|
15
|
+
//# sourceMappingURL=host-tool-runtime-import-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-tool-runtime-import-boundary.d.ts","sourceRoot":"","sources":["../../../src/checks/architecture/host-tool-runtime-import-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA4EpF,wEAAwE;AACxE,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,cAAc,EAAE,CAyClB;AAED,eAAO,MAAM,6BAA6B,sCAYxC,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Keep ADR-0054's host-process runtime import exception narrow.
|
|
3
|
+
*
|
|
4
|
+
* External Tool runtimes still execute in the host process during the
|
|
5
|
+
* ADR-0054 migration because the current manifest only carries command
|
|
6
|
+
* metadata, not executable CommandSpec/RPC descriptors. That exception must
|
|
7
|
+
* remain explicit: every importToolRuntime call needs a source policy, and no
|
|
8
|
+
* new production call sites should appear outside the admission/discovery
|
|
9
|
+
* boundary.
|
|
10
|
+
*/
|
|
11
|
+
// @fitness-ignore-file shipped-checks-must-be-generic -- dogfood check for this repo's ADR-0054 migration boundary; AST precision keeps the temporary import exception mechanically narrow.
|
|
12
|
+
import { defineCheck, isTestFile } from '@opensip-cli/fitness';
|
|
13
|
+
import { getSharedSourceFile } from '@opensip-cli/lang-typescript';
|
|
14
|
+
import * as ts from 'typescript';
|
|
15
|
+
const CLI_HOST_PATH = 'packages/cli/src/';
|
|
16
|
+
const IMPORT_RUNTIME = 'importToolRuntime';
|
|
17
|
+
const POLICY_HELPER = 'hostRuntimeImportPolicyFor';
|
|
18
|
+
const ALLOWED_CALLSITE_SUFFIXES = new Set([
|
|
19
|
+
'packages/cli/src/bootstrap/admit-tool-package.ts',
|
|
20
|
+
'packages/cli/src/bootstrap/register-tools.ts',
|
|
21
|
+
'packages/cli/src/bootstrap/register-tools-discovery.ts',
|
|
22
|
+
]);
|
|
23
|
+
function normalized(path) {
|
|
24
|
+
return path.replaceAll('\\', '/');
|
|
25
|
+
}
|
|
26
|
+
function isAllowedCallsite(filePath) {
|
|
27
|
+
const p = normalized(filePath);
|
|
28
|
+
for (const suffix of ALLOWED_CALLSITE_SUFFIXES) {
|
|
29
|
+
if (p.endsWith(suffix))
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
function propertyNameText(name) {
|
|
35
|
+
if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name)) {
|
|
36
|
+
return name.text;
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
function isTrueLiteral(node) {
|
|
41
|
+
return node.kind === ts.SyntaxKind.TrueKeyword;
|
|
42
|
+
}
|
|
43
|
+
function isPolicyArg(arg) {
|
|
44
|
+
if (ts.isCallExpression(arg) && ts.isIdentifier(arg.expression)) {
|
|
45
|
+
return arg.expression.text === POLICY_HELPER;
|
|
46
|
+
}
|
|
47
|
+
if (!ts.isObjectLiteralExpression(arg))
|
|
48
|
+
return false;
|
|
49
|
+
let hasSource = false;
|
|
50
|
+
let hasTransition = false;
|
|
51
|
+
for (const prop of arg.properties) {
|
|
52
|
+
if (!ts.isPropertyAssignment(prop))
|
|
53
|
+
continue;
|
|
54
|
+
const name = propertyNameText(prop.name);
|
|
55
|
+
if (name === 'source')
|
|
56
|
+
hasSource = true;
|
|
57
|
+
if (name === 'adr0054Transition' && isTrueLiteral(prop.initializer)) {
|
|
58
|
+
hasTransition = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return hasSource && (hasTransition || arg.getText().includes("'bundled'"));
|
|
62
|
+
}
|
|
63
|
+
function localRuntimeImportNames(sourceFile) {
|
|
64
|
+
const names = new Set();
|
|
65
|
+
for (const stmt of sourceFile.statements) {
|
|
66
|
+
if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier))
|
|
67
|
+
continue;
|
|
68
|
+
const module = stmt.moduleSpecifier.text;
|
|
69
|
+
if (!module.endsWith('/admit-tool-package.js') && module !== './admit-tool-package.js') {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const named = stmt.importClause?.namedBindings;
|
|
73
|
+
if (named === undefined || !ts.isNamedImports(named))
|
|
74
|
+
continue;
|
|
75
|
+
for (const element of named.elements) {
|
|
76
|
+
const imported = (element.propertyName ?? element.name).text;
|
|
77
|
+
if (imported === IMPORT_RUNTIME)
|
|
78
|
+
names.add(element.name.text);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// The defining module calls its own exported function by name.
|
|
82
|
+
if (isAllowedCallsite(sourceFile.fileName))
|
|
83
|
+
names.add(IMPORT_RUNTIME);
|
|
84
|
+
return names;
|
|
85
|
+
}
|
|
86
|
+
/** Pure analysis over a parsed source file. Exported for unit tests. */
|
|
87
|
+
export function analyzeHostToolRuntimeImportBoundary(content, filePath) {
|
|
88
|
+
const violations = [];
|
|
89
|
+
const sourceFile = getSharedSourceFile(filePath, content);
|
|
90
|
+
if (!sourceFile)
|
|
91
|
+
return violations;
|
|
92
|
+
const runtimeNames = localRuntimeImportNames(sourceFile);
|
|
93
|
+
if (runtimeNames.size === 0)
|
|
94
|
+
return violations;
|
|
95
|
+
const allowedFile = isAllowedCallsite(filePath);
|
|
96
|
+
const visit = (node) => {
|
|
97
|
+
if (ts.isCallExpression(node) && ts.isIdentifier(node.expression)) {
|
|
98
|
+
const callee = node.expression.text;
|
|
99
|
+
if (runtimeNames.has(callee)) {
|
|
100
|
+
const line = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;
|
|
101
|
+
if (!allowedFile) {
|
|
102
|
+
violations.push({
|
|
103
|
+
message: `importToolRuntime may only be called from the tool admission/discovery boundary ` +
|
|
104
|
+
`(ADR-0054 transition). Found host-process runtime import in ${normalized(filePath)}.`,
|
|
105
|
+
severity: 'error',
|
|
106
|
+
line,
|
|
107
|
+
suggestion: 'Route tool runtime loading through admit-tool-package/register-tools, or the ADR-0054 worker boundary.',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else if (node.arguments.length < 2 || !isPolicyArg(node.arguments[1])) {
|
|
111
|
+
violations.push({
|
|
112
|
+
message: 'importToolRuntime host-process imports must pass an explicit source policy ' +
|
|
113
|
+
'(bundled or adr0054Transition) so external runtime execution remains visible.',
|
|
114
|
+
severity: 'error',
|
|
115
|
+
line,
|
|
116
|
+
suggestion: 'Pass hostRuntimeImportPolicyFor(source), or an explicit policy object for bundled/ADR-0054 transition imports.',
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
ts.forEachChild(node, visit);
|
|
122
|
+
};
|
|
123
|
+
visit(sourceFile);
|
|
124
|
+
return violations;
|
|
125
|
+
}
|
|
126
|
+
export const hostToolRuntimeImportBoundary = defineCheck({
|
|
127
|
+
id: 'b7554963-e24e-4d80-b3e0-edbb97bbdba3',
|
|
128
|
+
slug: 'host-tool-runtime-import-boundary',
|
|
129
|
+
description: 'Host-process tool runtime imports must stay in the admission boundary and carry an explicit ADR-0054 transition policy',
|
|
130
|
+
scope: { languages: ['typescript'], concerns: ['backend'] },
|
|
131
|
+
tags: ['architecture'],
|
|
132
|
+
fileTypes: ['ts', 'tsx'],
|
|
133
|
+
analyze: (content, filePath) => {
|
|
134
|
+
if (!normalized(filePath).includes(CLI_HOST_PATH) || isTestFile(filePath))
|
|
135
|
+
return [];
|
|
136
|
+
return analyzeHostToolRuntimeImportBoundary(content, filePath);
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=host-tool-runtime-import-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-tool-runtime-import-boundary.js","sourceRoot":"","sources":["../../../src/checks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AAc,CAAC;IACtB,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IACxB,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;QAC7B,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,EAAE,CAAC;QACrF,OAAO,oCAAoC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export * from './circular-import-detection.js';
|
|
2
2
|
export * from './contracts-schema-consistency.js';
|
|
3
3
|
export * from './drizzle-orm-migration-guardrails.js';
|
|
4
|
+
export * from './host-tool-runtime-import-boundary.js';
|
|
4
5
|
export * from './missing-type-exports.js';
|
|
5
6
|
export * from './module-coupling-fan-out.js';
|
|
6
7
|
export * from './no-bootstrap-tool-import.js';
|
|
8
|
+
export * from './no-run-done-result.js';
|
|
7
9
|
export * from './package-json-exports-field.js';
|
|
8
10
|
export * from './phantom-dependency-detection.js';
|
|
11
|
+
export * from './subprocess-correlation-required.js';
|
|
9
12
|
export * from './tsconfig-extends-validation.js';
|
|
10
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checks/architecture/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checks/architecture/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export * from './circular-import-detection.js';
|
|
2
2
|
export * from './contracts-schema-consistency.js';
|
|
3
3
|
export * from './drizzle-orm-migration-guardrails.js';
|
|
4
|
+
export * from './host-tool-runtime-import-boundary.js';
|
|
4
5
|
export * from './missing-type-exports.js';
|
|
5
6
|
export * from './module-coupling-fan-out.js';
|
|
6
7
|
export * from './no-bootstrap-tool-import.js';
|
|
8
|
+
export * from './no-run-done-result.js';
|
|
7
9
|
export * from './package-json-exports-field.js';
|
|
8
10
|
export * from './phantom-dependency-detection.js';
|
|
11
|
+
export * from './subprocess-correlation-required.js';
|
|
9
12
|
export * from './tsconfig-extends-validation.js';
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checks/architecture/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checks/architecture/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Run commands render via RunPresentation β no per-tool `*DoneResult`.
|
|
3
|
+
*
|
|
4
|
+
* The envelope-first-presentation plan (ADR-0011) collapsed the three
|
|
5
|
+
* near-identical per-tool run-result interfaces (one each for fit/sim/graph) into
|
|
6
|
+
* a single render-only `RunPresentation` (`type: 'run-presentation'`) on the
|
|
7
|
+
* `CommandResult` union. Each of those interfaces only wrapped a `SignalEnvelope`
|
|
8
|
+
* plus render-only adjuncts, so the union grew one variant per tool and
|
|
9
|
+
* `resultToView` carried one near-duplicate render case per tool. They were
|
|
10
|
+
* hard-removed in RP-3.
|
|
11
|
+
*
|
|
12
|
+
* This check guards the `@opensip-cli/contracts` command-result surface against a
|
|
13
|
+
* regression: re-declaring a per-tool run done-result interface/type (a name
|
|
14
|
+
* ending `β¦DoneResult` for fit/sim/graph) OR a discriminator property
|
|
15
|
+
* `type: 'fit-done' | 'sim-done' | 'graph-done'`. Run commands must render through
|
|
16
|
+
* the one `RunPresentation` variant.
|
|
17
|
+
*
|
|
18
|
+
* Path-gated to `packages/contracts/src/` (the contract surface) and test-exempt.
|
|
19
|
+
* AST-based so a `*-done` string appearing as TEXT (a comment, a doc example, an
|
|
20
|
+
* unrelated string) is not flagged β only a real type/interface declaration or a
|
|
21
|
+
* `type:` discriminator literal in a type declaration counts.
|
|
22
|
+
*/
|
|
23
|
+
import { type CheckViolation } from '@opensip-cli/fitness';
|
|
24
|
+
/** Pure analysis over a parsed source file. Exported for unit tests. */
|
|
25
|
+
export declare function analyzeNoRunDoneResult(content: string, filePath: string): CheckViolation[];
|
|
26
|
+
export declare const noRunDoneResult: import("@opensip-cli/fitness").Check;
|
|
27
|
+
//# sourceMappingURL=no-run-done-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-run-done-result.d.ts","sourceRoot":"","sources":["../../../src/checks/architecture/no-run-done-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA0CpF,wEAAwE;AACxE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,CAoC1F;AAED,eAAO,MAAM,eAAe,sCAqB1B,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Run commands render via RunPresentation β no per-tool `*DoneResult`.
|
|
3
|
+
*
|
|
4
|
+
* The envelope-first-presentation plan (ADR-0011) collapsed the three
|
|
5
|
+
* near-identical per-tool run-result interfaces (one each for fit/sim/graph) into
|
|
6
|
+
* a single render-only `RunPresentation` (`type: 'run-presentation'`) on the
|
|
7
|
+
* `CommandResult` union. Each of those interfaces only wrapped a `SignalEnvelope`
|
|
8
|
+
* plus render-only adjuncts, so the union grew one variant per tool and
|
|
9
|
+
* `resultToView` carried one near-duplicate render case per tool. They were
|
|
10
|
+
* hard-removed in RP-3.
|
|
11
|
+
*
|
|
12
|
+
* This check guards the `@opensip-cli/contracts` command-result surface against a
|
|
13
|
+
* regression: re-declaring a per-tool run done-result interface/type (a name
|
|
14
|
+
* ending `β¦DoneResult` for fit/sim/graph) OR a discriminator property
|
|
15
|
+
* `type: 'fit-done' | 'sim-done' | 'graph-done'`. Run commands must render through
|
|
16
|
+
* the one `RunPresentation` variant.
|
|
17
|
+
*
|
|
18
|
+
* Path-gated to `packages/contracts/src/` (the contract surface) and test-exempt.
|
|
19
|
+
* AST-based so a `*-done` string appearing as TEXT (a comment, a doc example, an
|
|
20
|
+
* unrelated string) is not flagged β only a real type/interface declaration or a
|
|
21
|
+
* `type:` discriminator literal in a type declaration counts.
|
|
22
|
+
*/
|
|
23
|
+
// @fitness-ignore-file shipped-checks-must-be-generic -- opensip-internal dogfood guard for the envelope-first-presentation contract surface; AST precision keeps it from flagging the `*-done` literals that legitimately appear in prose. Needs @opensip-cli/lang-typescript, which a project-local .mjs cannot import.
|
|
24
|
+
import { defineCheck, isTestFile } from '@opensip-cli/fitness';
|
|
25
|
+
import { getSharedSourceFile } from '@opensip-cli/lang-typescript';
|
|
26
|
+
import * as ts from 'typescript';
|
|
27
|
+
/** The contract surface this check guards. */
|
|
28
|
+
const CONTRACTS_SRC_PATH = 'packages/contracts/src/';
|
|
29
|
+
/** A re-introduced per-tool run done-result type name (fit/sim/graph). */
|
|
30
|
+
const DONE_RESULT_NAME_RE = /^(?:Fit|Sim|Graph)DoneResult$/;
|
|
31
|
+
/** A re-introduced per-tool run done-result discriminator literal. */
|
|
32
|
+
const DONE_RESULT_DISCRIMINATOR = new Set([
|
|
33
|
+
'fit-done',
|
|
34
|
+
'sim-done',
|
|
35
|
+
'graph-done',
|
|
36
|
+
]);
|
|
37
|
+
const GUIDANCE = 'Run commands render via the single RunPresentation variant (ADR-0011 / ' +
|
|
38
|
+
'envelope-first-presentation plan); do not re-introduce per-tool *DoneResult types.';
|
|
39
|
+
function normalized(path) {
|
|
40
|
+
return path.replaceAll('\\', '/');
|
|
41
|
+
}
|
|
42
|
+
/** A `type:` property whose value is a `fit-done|sim-done|graph-done` string literal. */
|
|
43
|
+
function isDoneDiscriminatorMember(member) {
|
|
44
|
+
if (!ts.isPropertySignature(member) || member.type === undefined)
|
|
45
|
+
return false;
|
|
46
|
+
if (!ts.isIdentifier(member.name) || member.name.text !== 'type')
|
|
47
|
+
return false;
|
|
48
|
+
if (!ts.isLiteralTypeNode(member.type) || !ts.isStringLiteral(member.type.literal)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return DONE_RESULT_DISCRIMINATOR.has(member.type.literal.text);
|
|
52
|
+
}
|
|
53
|
+
/** Walk a type node's members (interface body or type-literal) for a done discriminator. */
|
|
54
|
+
function membersOf(node) {
|
|
55
|
+
if (ts.isInterfaceDeclaration(node))
|
|
56
|
+
return node.members;
|
|
57
|
+
if (ts.isTypeAliasDeclaration(node) && ts.isTypeLiteralNode(node.type))
|
|
58
|
+
return node.type.members;
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
/** Pure analysis over a parsed source file. Exported for unit tests. */
|
|
62
|
+
export function analyzeNoRunDoneResult(content, filePath) {
|
|
63
|
+
const violations = [];
|
|
64
|
+
const sourceFile = getSharedSourceFile(filePath, content);
|
|
65
|
+
if (!sourceFile)
|
|
66
|
+
return violations;
|
|
67
|
+
const lineOf = (node) => sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;
|
|
68
|
+
const visit = (node) => {
|
|
69
|
+
if (ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) {
|
|
70
|
+
const name = node.name.text;
|
|
71
|
+
if (DONE_RESULT_NAME_RE.test(name)) {
|
|
72
|
+
violations.push({
|
|
73
|
+
filePath,
|
|
74
|
+
line: lineOf(node),
|
|
75
|
+
message: `Type '${name}' re-introduces a per-tool run done-result. ${GUIDANCE}`,
|
|
76
|
+
severity: 'error',
|
|
77
|
+
suggestion: 'Render the run via the RunPresentation variant on CommandResult.',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const members = membersOf(node);
|
|
82
|
+
if (members?.some(isDoneDiscriminatorMember)) {
|
|
83
|
+
violations.push({
|
|
84
|
+
filePath,
|
|
85
|
+
line: lineOf(node),
|
|
86
|
+
message: `Type '${name}' declares a per-tool run done-result discriminator. ${GUIDANCE}`,
|
|
87
|
+
severity: 'error',
|
|
88
|
+
suggestion: "Use the shared `type: 'run-presentation'` run variant instead.",
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
ts.forEachChild(node, visit);
|
|
94
|
+
};
|
|
95
|
+
visit(sourceFile);
|
|
96
|
+
return violations;
|
|
97
|
+
}
|
|
98
|
+
export const noRunDoneResult = defineCheck({
|
|
99
|
+
id: 'a3d9f1c4-7b2e-4f6a-9c1d-8e5b0a2f4d63',
|
|
100
|
+
slug: 'architecture-no-run-done-result',
|
|
101
|
+
description: 'Run commands render via the single RunPresentation variant; the contracts surface must not re-introduce a per-tool *DoneResult run type',
|
|
102
|
+
longDescription: `**Purpose:** Guard the \`@opensip-cli/contracts\` command-result surface against re-growing one run-result interface per tool.
|
|
103
|
+
|
|
104
|
+
**Detects (in \`packages/contracts/src/\` only):**
|
|
105
|
+
- A re-declared per-tool run done-result type/interface (name ending \`β¦DoneResult\` for fit/sim/graph).
|
|
106
|
+
- A discriminator property \`type: 'fit-done' | 'sim-done' | 'graph-done'\` on a type/interface declaration.
|
|
107
|
+
|
|
108
|
+
**Why it matters:** The envelope-first-presentation plan (ADR-0011) collapsed the three per-tool run results into one render-only \`RunPresentation\`. Re-introducing a per-tool done-result would re-grow the union and \`resultToView\` and diverge the human render from the envelope verdict.
|
|
109
|
+
|
|
110
|
+
**Scope:** Contracts package source only; test files exempt.`,
|
|
111
|
+
scope: { languages: ['typescript'], concerns: ['backend'] },
|
|
112
|
+
tags: ['architecture', 'contracts'],
|
|
113
|
+
fileTypes: ['ts'],
|
|
114
|
+
analyze: (content, filePath) => {
|
|
115
|
+
if (!normalized(filePath).includes(CONTRACTS_SRC_PATH) || isTestFile(filePath))
|
|
116
|
+
return [];
|
|
117
|
+
return analyzeNoRunDoneResult(content, filePath);
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=no-run-done-result.js.map
|
|
@@ -0,0 +1 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|
+
/**
|
|
2
|
+
* @fileoverview Guard that every CLI worker spawn/fork forwards the RunCorrelation bag.
|
|
3
|
+
*
|
|
4
|
+
* The subprocess-correlation-telemetry spec (and ADR-0054 readiness) requires
|
|
5
|
+
* that when the CLI spawns or forks a child CLI *worker* subcommand (e.g.
|
|
6
|
+
* `graph-shard-worker`, `graph-run-worker`, any future `*-run-worker`), the
|
|
7
|
+
* parent forwards its {@link RunCorrelation} bag so a child failure is
|
|
8
|
+
* attributable to the parent run/trace from JSONL logs alone. `runId` travels
|
|
9
|
+
* via `OPENSIP_RUN_ID` env (merged through `correlationToEnv`); the rest travels
|
|
10
|
+
* via env + the worker spec/descriptor's `correlation` field.
|
|
11
|
+
*
|
|
12
|
+
* This check fires on a spawn/fork of a `*-worker` subcommand that forwards env
|
|
13
|
+
* (so it clearly inherits the parent environment) but does NOT reference
|
|
14
|
+
* `correlationToEnv` or write a `correlation` field anywhere in the enclosing
|
|
15
|
+
* function β i.e. the parent forgot to carry correlation. It is bounded to the
|
|
16
|
+
* two host packages that own real worker spawn/fork sites (`packages/graph` and
|
|
17
|
+
* `packages/cli`); the generic fork transport (`packages/core`) is out of scope
|
|
18
|
+
* by design.
|
|
19
|
+
*/
|
|
20
|
+
import { type CheckViolation } from '@opensip-cli/fitness';
|
|
21
|
+
/**
|
|
22
|
+
* Pure analysis over a parsed source file. Exported for unit tests. Returns one
|
|
23
|
+
* error per spawn/fork of a CLI `*-worker` subcommand whose enclosing function
|
|
24
|
+
* shows no correlation forwarding.
|
|
25
|
+
*/
|
|
26
|
+
export declare function analyzeSubprocessCorrelationRequired(content: string, filePath: string): CheckViolation[];
|
|
27
|
+
export declare const subprocessCorrelationRequired: import("@opensip-cli/fitness").Check;
|
|
28
|
+
//# sourceMappingURL=subprocess-correlation-required.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subprocess-correlation-required.d.ts","sourceRoot":"","sources":["../../../src/checks/architecture/subprocess-correlation-required.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAsGpF;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,cAAc,EAAE,CAoClB;AAED,eAAO,MAAM,6BAA6B,sCAYxC,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Guard that every CLI worker spawn/fork forwards the RunCorrelation bag.
|
|
3
|
+
*
|
|
4
|
+
* The subprocess-correlation-telemetry spec (and ADR-0054 readiness) requires
|
|
5
|
+
* that when the CLI spawns or forks a child CLI *worker* subcommand (e.g.
|
|
6
|
+
* `graph-shard-worker`, `graph-run-worker`, any future `*-run-worker`), the
|
|
7
|
+
* parent forwards its {@link RunCorrelation} bag so a child failure is
|
|
8
|
+
* attributable to the parent run/trace from JSONL logs alone. `runId` travels
|
|
9
|
+
* via `OPENSIP_RUN_ID` env (merged through `correlationToEnv`); the rest travels
|
|
10
|
+
* via env + the worker spec/descriptor's `correlation` field.
|
|
11
|
+
*
|
|
12
|
+
* This check fires on a spawn/fork of a `*-worker` subcommand that forwards env
|
|
13
|
+
* (so it clearly inherits the parent environment) but does NOT reference
|
|
14
|
+
* `correlationToEnv` or write a `correlation` field anywhere in the enclosing
|
|
15
|
+
* function β i.e. the parent forgot to carry correlation. It is bounded to the
|
|
16
|
+
* two host packages that own real worker spawn/fork sites (`packages/graph` and
|
|
17
|
+
* `packages/cli`); the generic fork transport (`packages/core`) is out of scope
|
|
18
|
+
* by design.
|
|
19
|
+
*/
|
|
20
|
+
// @fitness-ignore-file shipped-checks-must-be-generic -- dogfood check for this repo's subprocess-correlation-telemetry migration boundary; AST precision keeps the worker-spawn correlation requirement mechanically narrow.
|
|
21
|
+
import { defineCheck, isTestFile } from '@opensip-cli/fitness';
|
|
22
|
+
import { getSharedSourceFile } from '@opensip-cli/lang-typescript';
|
|
23
|
+
import * as ts from 'typescript';
|
|
24
|
+
/** Host packages that own real CLI worker spawn/fork sites. */
|
|
25
|
+
const GATED_PATHS = ['packages/graph/', 'packages/cli/'];
|
|
26
|
+
/** The child-process primitives a worker is launched through. */
|
|
27
|
+
const SPAWN_CALLEES = new Set(['spawn', 'fork']);
|
|
28
|
+
/**
|
|
29
|
+
* A CLI worker subcommand is named `<tool>-...-worker` (`graph-shard-worker`,
|
|
30
|
+
* `graph-run-worker`, future `*-run-worker`). The plain `graph` subcommand
|
|
31
|
+
* spawn (workspace fan-out) and a same-process re-exec (`process.argv.slice(1)`,
|
|
32
|
+
* heap preflight) are deliberately NOT worker subcommands β they carry no
|
|
33
|
+
* literal `*-worker` argv string and so are not matched.
|
|
34
|
+
*/
|
|
35
|
+
const WORKER_SUBCOMMAND_SUFFIX = '-worker';
|
|
36
|
+
/** Evidence that correlation is being forwarded into the child. */
|
|
37
|
+
const CORRELATION_TO_ENV = 'correlationToEnv';
|
|
38
|
+
const CORRELATION_PROP = 'correlation';
|
|
39
|
+
function normalized(path) {
|
|
40
|
+
return path.replaceAll('\\', '/');
|
|
41
|
+
}
|
|
42
|
+
function isGatedFile(filePath) {
|
|
43
|
+
const p = normalized(filePath);
|
|
44
|
+
return GATED_PATHS.some((prefix) => p.includes(prefix));
|
|
45
|
+
}
|
|
46
|
+
/** A string literal (`'graph-shard-worker'`) whose text matches `*-worker`. */
|
|
47
|
+
function isWorkerSubcommandLiteral(node) {
|
|
48
|
+
return ((ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) &&
|
|
49
|
+
node.text.endsWith(WORKER_SUBCOMMAND_SUFFIX));
|
|
50
|
+
}
|
|
51
|
+
/** True when any descendant of `node` is a `*-worker` subcommand string. */
|
|
52
|
+
function referencesWorkerSubcommand(node) {
|
|
53
|
+
let found = false;
|
|
54
|
+
const visit = (n) => {
|
|
55
|
+
if (found)
|
|
56
|
+
return;
|
|
57
|
+
if (isWorkerSubcommandLiteral(n)) {
|
|
58
|
+
found = true;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
ts.forEachChild(n, visit);
|
|
62
|
+
};
|
|
63
|
+
visit(node);
|
|
64
|
+
return found;
|
|
65
|
+
}
|
|
66
|
+
/** True when any descendant references `correlationToEnv` or a `correlation` key/property. */
|
|
67
|
+
function referencesCorrelation(node) {
|
|
68
|
+
let found = false;
|
|
69
|
+
const visit = (n) => {
|
|
70
|
+
if (found)
|
|
71
|
+
return;
|
|
72
|
+
if (ts.isIdentifier(n) && n.text === CORRELATION_TO_ENV) {
|
|
73
|
+
found = true;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// A `correlation:` property assignment / shorthand on the spec or descriptor.
|
|
77
|
+
if ((ts.isPropertyAssignment(n) || ts.isShorthandPropertyAssignment(n)) &&
|
|
78
|
+
ts.isIdentifier(n.name) &&
|
|
79
|
+
n.name.text === CORRELATION_PROP) {
|
|
80
|
+
found = true;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
ts.forEachChild(n, visit);
|
|
84
|
+
};
|
|
85
|
+
visit(node);
|
|
86
|
+
return found;
|
|
87
|
+
}
|
|
88
|
+
/** Walk outward to the nearest enclosing function/method body (the spawn site's scope). */
|
|
89
|
+
function enclosingFunction(node) {
|
|
90
|
+
let current = node.parent;
|
|
91
|
+
while (current) {
|
|
92
|
+
if (ts.isFunctionDeclaration(current) ||
|
|
93
|
+
ts.isFunctionExpression(current) ||
|
|
94
|
+
ts.isArrowFunction(current) ||
|
|
95
|
+
ts.isMethodDeclaration(current) ||
|
|
96
|
+
ts.isConstructorDeclaration(current)) {
|
|
97
|
+
return current;
|
|
98
|
+
}
|
|
99
|
+
current = current.parent;
|
|
100
|
+
}
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
/** Callee identifier text of a call expression, if the callee is a bare identifier. */
|
|
104
|
+
function calleeName(call) {
|
|
105
|
+
return ts.isIdentifier(call.expression) ? call.expression.text : undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Pure analysis over a parsed source file. Exported for unit tests. Returns one
|
|
109
|
+
* error per spawn/fork of a CLI `*-worker` subcommand whose enclosing function
|
|
110
|
+
* shows no correlation forwarding.
|
|
111
|
+
*/
|
|
112
|
+
export function analyzeSubprocessCorrelationRequired(content, filePath) {
|
|
113
|
+
const violations = [];
|
|
114
|
+
const sourceFile = getSharedSourceFile(filePath, content);
|
|
115
|
+
if (!sourceFile)
|
|
116
|
+
return violations;
|
|
117
|
+
const visit = (node) => {
|
|
118
|
+
if (ts.isCallExpression(node)) {
|
|
119
|
+
const callee = calleeName(node);
|
|
120
|
+
if (callee !== undefined && SPAWN_CALLEES.has(callee)) {
|
|
121
|
+
// Only worker subcommand spawns/forks carry the correlation requirement;
|
|
122
|
+
// a plain `graph` subcommand spawn or a same-process re-exec is exempt.
|
|
123
|
+
const isWorkerLaunch = node.arguments.some((arg) => referencesWorkerSubcommand(arg));
|
|
124
|
+
if (isWorkerLaunch) {
|
|
125
|
+
const scope = enclosingFunction(node) ?? sourceFile;
|
|
126
|
+
if (!referencesCorrelation(scope)) {
|
|
127
|
+
const line = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;
|
|
128
|
+
violations.push({
|
|
129
|
+
message: `CLI worker spawn/fork in ${normalized(filePath)} forwards env to a child worker ` +
|
|
130
|
+
`subcommand but does not forward the RunCorrelation bag β a child failure cannot be ` +
|
|
131
|
+
`attributed to the parent run.`,
|
|
132
|
+
severity: 'error',
|
|
133
|
+
line,
|
|
134
|
+
suggestion: 'Merge correlationToEnv(currentScope()?.correlation) into the child env and write ' +
|
|
135
|
+
'the correlation onto the spec/descriptor (subprocess-correlation-telemetry spec).',
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
ts.forEachChild(node, visit);
|
|
142
|
+
};
|
|
143
|
+
visit(sourceFile);
|
|
144
|
+
return violations;
|
|
145
|
+
}
|
|
146
|
+
export const subprocessCorrelationRequired = defineCheck({
|
|
147
|
+
id: '822a0ca0-2c29-467b-9286-b2d3798b3810',
|
|
148
|
+
slug: 'subprocess-correlation-required',
|
|
149
|
+
description: 'CLI subprocess spawn/fork sites must forward the RunCorrelation bag (runId via env, other fields via env+spec) so child failures are attributable',
|
|
150
|
+
scope: { languages: ['typescript'], concerns: ['backend'] },
|
|
151
|
+
tags: ['architecture'],
|
|
152
|
+
fileTypes: ['ts', 'tsx'],
|
|
153
|
+
analyze: (content, filePath) => {
|
|
154
|
+
if (!isGatedFile(filePath) || isTestFile(filePath))
|
|
155
|
+
return [];
|
|
156
|
+
return analyzeSubprocessCorrelationRequired(content, filePath);
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
//# sourceMappingURL=subprocess-correlation-required.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subprocess-correlation-required.js","sourceRoot":"","sources":["../../../src/checks/architecture/subprocess-correlation-required.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,8NAA8N;AAC9N,OAAO,EAAE,WAAW,EAAE,UAAU,EAAuB,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,+DAA+D;AAC/D,MAAM,WAAW,GAAG,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;AAEzD,iEAAiE;AACjE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAE3C,mEAAmE;AACnE,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAC9C,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,SAAS,UAAU,CAA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ClB,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,WAAW,CAAC;IACvD,EAAE,EAAE,sCAAsC;IAC1C,IAAI,EAAE,iCAAiC;IACvC,WAAW,EACT,mJAAmJ;IACrJ,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE;IAC3D,IAAI,EAAE,CAAC,cAAc,CAAC;IACtB,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IACxB,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;QAC7B,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,EAAE,CAAC;QAC9D,OAAO,oCAAoC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture.d.ts","sourceRoot":"","sources":["../../src/display/architecture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"architecture.d.ts","sourceRoot":"","sources":["../../src/display/architecture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,6CAa/B,CAAC;AAEH,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,6CAAuD,CAAC"}
|
|
@@ -6,11 +6,14 @@ export const ARCHITECTURE_DISPLAY = Object.freeze({
|
|
|
6
6
|
'circular-import-detection': ['π', 'Circular Import Detection'],
|
|
7
7
|
'contracts-schema-consistency': ['π', 'Contracts Schema Consistency'],
|
|
8
8
|
'drizzle-orm-migration-guardrails': ['π‘οΈ', 'Drizzle ORM Migration Guardrails'],
|
|
9
|
+
'host-tool-runtime-import-boundary': ['π§±', 'Host Tool Runtime Import Boundary'],
|
|
9
10
|
'missing-type-exports': ['π€', 'Missing Type Exports'],
|
|
10
11
|
'module-coupling-fan-out': ['πΈοΈ', 'Module Coupling Fan-Out'],
|
|
11
12
|
'no-bootstrap-tool-import': ['π', 'No Bootstrap Tool Import'],
|
|
13
|
+
'architecture-no-run-done-result': ['π―', 'No Per-Tool Run Done-Result'],
|
|
12
14
|
'package-json-exports-field': ['π¦', 'package.json Exports Field'],
|
|
13
15
|
'phantom-dependency-detection': ['π¦', 'Phantom Dependency Detection'],
|
|
16
|
+
'subprocess-correlation-required': ['π', 'Subprocess Correlation Required'],
|
|
14
17
|
'tsconfig-extends-validation': ['βοΈ', 'tsconfig Extends Validation'],
|
|
15
18
|
});
|
|
16
19
|
/** No documentation TS_AST checks; export empty object for symmetry */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture.js","sourceRoot":"","sources":["../../src/display/architecture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,uDAAuD;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAoC;IACnF,2BAA2B,EAAE,CAAC,IAAI,EAAE,2BAA2B,CAAC;IAChE,8BAA8B,EAAE,CAAC,IAAI,EAAE,8BAA8B,CAAC;IACtE,kCAAkC,EAAE,CAAC,KAAK,EAAE,kCAAkC,CAAC;IAC/E,sBAAsB,EAAE,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtD,yBAAyB,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAC7D,0BAA0B,EAAE,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC9D,4BAA4B,EAAE,CAAC,IAAI,EAAE,4BAA4B,CAAC;IAClE,8BAA8B,EAAE,CAAC,IAAI,EAAE,8BAA8B,CAAC;IACtE,6BAA6B,EAAE,CAAC,IAAI,EAAE,6BAA6B,CAAC;CACrE,CAAC,CAAC;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAoC,EAAE,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"architecture.js","sourceRoot":"","sources":["../../src/display/architecture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,uDAAuD;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAoC;IACnF,2BAA2B,EAAE,CAAC,IAAI,EAAE,2BAA2B,CAAC;IAChE,8BAA8B,EAAE,CAAC,IAAI,EAAE,8BAA8B,CAAC;IACtE,kCAAkC,EAAE,CAAC,KAAK,EAAE,kCAAkC,CAAC;IAC/E,mCAAmC,EAAE,CAAC,IAAI,EAAE,mCAAmC,CAAC;IAChF,sBAAsB,EAAE,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtD,yBAAyB,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAC7D,0BAA0B,EAAE,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC9D,iCAAiC,EAAE,CAAC,IAAI,EAAE,6BAA6B,CAAC;IACxE,4BAA4B,EAAE,CAAC,IAAI,EAAE,4BAA4B,CAAC;IAClE,8BAA8B,EAAE,CAAC,IAAI,EAAE,8BAA8B,CAAC;IACtE,iCAAiC,EAAE,CAAC,IAAI,EAAE,iCAAiC,CAAC;IAC5E,6BAA6B,EAAE,CAAC,IAAI,EAAE,6BAA6B,CAAC;CACrE,CAAC,CAAC;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAoC,EAAE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensip-cli/checks-typescript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "TypeScript/Node.js fitness checks for opensip-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"typescript": "~6.0.3",
|
|
40
|
-
"@opensip-cli/
|
|
41
|
-
"@opensip-cli/
|
|
42
|
-
"@opensip-cli/fitness": "0.1.
|
|
40
|
+
"@opensip-cli/lang-typescript": "0.1.7",
|
|
41
|
+
"@opensip-cli/core": "0.1.7",
|
|
42
|
+
"@opensip-cli/fitness": "0.1.7"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^24.13.2",
|
|
46
46
|
"vitest": "^4.1.8",
|
|
47
|
-
"@opensip-cli/test-support": "0.1.
|
|
47
|
+
"@opensip-cli/test-support": "0.1.7"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsc",
|