circle-ir-ai 4.30.0 → 4.32.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/CHANGELOG.md +153 -13
- package/README.md +3 -3
- package/dist/agents/mastra/swarm.d.ts.map +1 -1
- package/dist/agents/mastra/swarm.js +9 -3
- package/dist/agents/mastra/swarm.js.map +1 -1
- package/dist/agents/mastra/workflow.d.ts +3 -1
- package/dist/agents/mastra/workflow.d.ts.map +1 -1
- package/dist/agents/mastra/workflow.js +13 -5
- package/dist/agents/mastra/workflow.js.map +1 -1
- package/dist/blast-radius/index.d.ts +51 -0
- package/dist/blast-radius/index.d.ts.map +1 -0
- package/dist/blast-radius/index.js +462 -0
- package/dist/blast-radius/index.js.map +1 -0
- package/dist/blast-radius/manifest.d.ts +13 -0
- package/dist/blast-radius/manifest.d.ts.map +1 -0
- package/dist/blast-radius/manifest.js +54 -0
- package/dist/blast-radius/manifest.js.map +1 -0
- package/dist/blast-radius/radius.d.ts +138 -0
- package/dist/blast-radius/radius.d.ts.map +1 -0
- package/dist/blast-radius/radius.js +278 -0
- package/dist/blast-radius/radius.js.map +1 -0
- package/dist/blast-radius/types.d.ts +99 -0
- package/dist/blast-radius/types.d.ts.map +1 -0
- package/dist/blast-radius/types.js +15 -0
- package/dist/blast-radius/types.js.map +1 -0
- package/dist/bom/assemble.d.ts +4 -0
- package/dist/bom/assemble.d.ts.map +1 -1
- package/dist/bom/assemble.js +12 -1
- package/dist/bom/assemble.js.map +1 -1
- package/dist/bom/classify.d.ts +6 -2
- package/dist/bom/classify.d.ts.map +1 -1
- package/dist/bom/classify.js +2 -1
- package/dist/bom/classify.js.map +1 -1
- package/dist/bom/index.d.ts +69 -8
- package/dist/bom/index.d.ts.map +1 -1
- package/dist/bom/index.js +222 -62
- package/dist/bom/index.js.map +1 -1
- package/dist/bom/lockfiles.d.ts +73 -0
- package/dist/bom/lockfiles.d.ts.map +1 -0
- package/dist/bom/lockfiles.js +408 -0
- package/dist/bom/lockfiles.js.map +1 -0
- package/dist/bom/osgi-libraries.d.ts +93 -0
- package/dist/bom/osgi-libraries.d.ts.map +1 -0
- package/dist/bom/osgi-libraries.js +333 -0
- package/dist/bom/osgi-libraries.js.map +1 -0
- package/dist/bom/osgi.d.ts +72 -0
- package/dist/bom/osgi.d.ts.map +1 -0
- package/dist/bom/osgi.js +295 -0
- package/dist/bom/osgi.js.map +1 -0
- package/dist/bom/types.d.ts +22 -0
- package/dist/bom/types.d.ts.map +1 -1
- package/dist/bom/unread.d.ts +56 -0
- package/dist/bom/unread.d.ts.map +1 -0
- package/dist/bom/unread.js +187 -0
- package/dist/bom/unread.js.map +1 -0
- package/dist/bom/usage.d.ts +44 -1
- package/dist/bom/usage.d.ts.map +1 -1
- package/dist/bom/usage.js +110 -33
- package/dist/bom/usage.js.map +1 -1
- package/dist/grid/index.d.ts +169 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/index.js +250 -0
- package/dist/grid/index.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/llm/ax-client.d.ts +12 -0
- package/dist/llm/ax-client.d.ts.map +1 -1
- package/dist/llm/ax-client.js +69 -8
- package/dist/llm/ax-client.js.map +1 -1
- package/dist/llm/config.d.ts +15 -2
- package/dist/llm/config.d.ts.map +1 -1
- package/dist/llm/config.js +106 -47
- package/dist/llm/config.js.map +1 -1
- package/dist/llm/discovery.d.ts.map +1 -1
- package/dist/llm/discovery.js +6 -1
- package/dist/llm/discovery.js.map +1 -1
- package/dist/llm/index.d.ts +1 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +2 -0
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/model-route.d.ts +139 -0
- package/dist/llm/model-route.d.ts.map +1 -0
- package/dist/llm/model-route.js +256 -0
- package/dist/llm/model-route.js.map +1 -0
- package/dist/llm/verification.d.ts.map +1 -1
- package/dist/llm/verification.js +5 -1
- package/dist/llm/verification.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +11 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools/blast-radius.d.ts +14 -0
- package/dist/mcp/tools/blast-radius.d.ts.map +1 -0
- package/dist/mcp/tools/blast-radius.js +105 -0
- package/dist/mcp/tools/blast-radius.js.map +1 -0
- package/dist/mcp/tools/detect-selectors.d.ts +14 -0
- package/dist/mcp/tools/detect-selectors.d.ts.map +1 -0
- package/dist/mcp/tools/detect-selectors.js +86 -0
- package/dist/mcp/tools/detect-selectors.js.map +1 -0
- package/dist/mcp/tools/find-credential-exposure.d.ts.map +1 -1
- package/dist/mcp/tools/find-credential-exposure.js +2 -1
- package/dist/mcp/tools/find-credential-exposure.js.map +1 -1
- package/dist/mcp/tools/layer-bom.d.ts.map +1 -1
- package/dist/mcp/tools/layer-bom.js +6 -0
- package/dist/mcp/tools/layer-bom.js.map +1 -1
- package/dist/mcp/tools/layer-grid.d.ts +12 -0
- package/dist/mcp/tools/layer-grid.d.ts.map +1 -0
- package/dist/mcp/tools/layer-grid.js +56 -0
- package/dist/mcp/tools/layer-grid.js.map +1 -0
- package/dist/project/analyzer.d.ts +3 -1
- package/dist/project/analyzer.d.ts.map +1 -1
- package/dist/project/analyzer.js +12 -3
- package/dist/project/analyzer.js.map +1 -1
- package/dist/secret-scan/history-patterns.d.ts +6 -0
- package/dist/secret-scan/history-patterns.d.ts.map +1 -1
- package/dist/secret-scan/history-patterns.js +2 -1
- package/dist/secret-scan/history-patterns.js.map +1 -1
- package/dist/secret-scan/index.d.ts +1 -1
- package/dist/secret-scan/index.d.ts.map +1 -1
- package/dist/secret-scan/index.js +1 -1
- package/dist/secret-scan/index.js.map +1 -1
- package/dist/secret-scan/scanner.d.ts +59 -0
- package/dist/secret-scan/scanner.d.ts.map +1 -1
- package/dist/secret-scan/scanner.js +413 -16
- package/dist/secret-scan/scanner.js.map +1 -1
- package/dist/security-scan/scanner.d.ts +6 -0
- package/dist/security-scan/scanner.d.ts.map +1 -1
- package/dist/security-scan/scanner.js +90 -11
- package/dist/security-scan/scanner.js.map +1 -1
- package/dist/selectors/canonical.d.ts +46 -0
- package/dist/selectors/canonical.d.ts.map +1 -0
- package/dist/selectors/canonical.js +106 -0
- package/dist/selectors/canonical.js.map +1 -0
- package/dist/selectors/detect.d.ts +50 -0
- package/dist/selectors/detect.d.ts.map +1 -0
- package/dist/selectors/detect.js +459 -0
- package/dist/selectors/detect.js.map +1 -0
- package/dist/selectors/exclude.d.ts +29 -0
- package/dist/selectors/exclude.d.ts.map +1 -0
- package/dist/selectors/exclude.js +63 -0
- package/dist/selectors/exclude.js.map +1 -0
- package/dist/selectors/facts.d.ts +92 -0
- package/dist/selectors/facts.d.ts.map +1 -0
- package/dist/selectors/facts.js +312 -0
- package/dist/selectors/facts.js.map +1 -0
- package/dist/selectors/index.d.ts +42 -0
- package/dist/selectors/index.d.ts.map +1 -0
- package/dist/selectors/index.js +54 -0
- package/dist/selectors/index.js.map +1 -0
- package/dist/selectors/rules.d.ts +126 -0
- package/dist/selectors/rules.d.ts.map +1 -0
- package/dist/selectors/rules.js +340 -0
- package/dist/selectors/rules.js.map +1 -0
- package/dist/selectors/taxonomy.d.ts +35 -0
- package/dist/selectors/taxonomy.d.ts.map +1 -0
- package/dist/selectors/taxonomy.js +317 -0
- package/dist/selectors/taxonomy.js.map +1 -0
- package/dist/selectors/types.d.ts +104 -0
- package/dist/selectors/types.d.ts.map +1 -0
- package/dist/selectors/types.js +16 -0
- package/dist/selectors/types.js.map +1 -0
- package/dist/skills/capability-mismatch.d.ts +30 -0
- package/dist/skills/capability-mismatch.d.ts.map +1 -1
- package/dist/skills/capability-mismatch.js +24 -0
- package/dist/skills/capability-mismatch.js.map +1 -1
- package/dist/skills/code-threat-patterns.d.ts +10 -0
- package/dist/skills/code-threat-patterns.d.ts.map +1 -1
- package/dist/skills/code-threat-patterns.js +166 -21
- package/dist/skills/code-threat-patterns.js.map +1 -1
- package/dist/skills/precision.d.ts.map +1 -1
- package/dist/skills/precision.js +11 -10
- package/dist/skills/precision.js.map +1 -1
- package/dist/specifica/evidence-aggregator.d.ts.map +1 -1
- package/dist/specifica/evidence-aggregator.js +4 -0
- package/dist/specifica/evidence-aggregator.js.map +1 -1
- package/dist/specifica/evidence-extractor.d.ts.map +1 -1
- package/dist/specifica/evidence-extractor.js +8 -2
- package/dist/specifica/evidence-extractor.js.map +1 -1
- package/dist/specifica/generator.d.ts.map +1 -1
- package/dist/specifica/generator.js +45 -5
- package/dist/specifica/generator.js.map +1 -1
- package/dist/specifica/provenance.d.ts +30 -3
- package/dist/specifica/provenance.d.ts.map +1 -1
- package/dist/specifica/provenance.js +34 -0
- package/dist/specifica/provenance.js.map +1 -1
- package/dist/specifica/spec-generator.d.ts.map +1 -1
- package/dist/specifica/spec-generator.js +24 -3
- package/dist/specifica/spec-generator.js.map +1 -1
- package/dist/specifica/ts-rule-sources.d.ts +32 -5
- package/dist/specifica/ts-rule-sources.d.ts.map +1 -1
- package/dist/specifica/ts-rule-sources.js +190 -8
- package/dist/specifica/ts-rule-sources.js.map +1 -1
- package/dist/specifica/types.d.ts +17 -2
- package/dist/specifica/types.d.ts.map +1 -1
- package/dist/trust/passes/code-complexity.d.ts +1 -1
- package/dist/trust/passes/code-complexity.d.ts.map +1 -1
- package/dist/trust/passes/code-complexity.js +18 -13
- package/dist/trust/passes/code-complexity.js.map +1 -1
- package/dist/trust/passes/hardcoded-secrets.d.ts.map +1 -1
- package/dist/trust/passes/hardcoded-secrets.js +9 -2
- package/dist/trust/passes/hardcoded-secrets.js.map +1 -1
- package/dist/trust/passes/input-validation.d.ts.map +1 -1
- package/dist/trust/passes/input-validation.js +4 -0
- package/dist/trust/passes/input-validation.js.map +1 -1
- package/dist/trust/passes/missing-guard-dom.d.ts.map +1 -1
- package/dist/trust/passes/missing-guard-dom.js +48 -1
- package/dist/trust/passes/missing-guard-dom.js.map +1 -1
- package/dist/utils/nearest-java-manifests.d.ts +9 -0
- package/dist/utils/nearest-java-manifests.d.ts.map +1 -0
- package/dist/utils/nearest-java-manifests.js +51 -0
- package/dist/utils/nearest-java-manifests.js.map +1 -0
- package/dist/utils/nearest-npm-manifests.d.ts +10 -0
- package/dist/utils/nearest-npm-manifests.d.ts.map +1 -0
- package/dist/utils/nearest-npm-manifests.js +42 -0
- package/dist/utils/nearest-npm-manifests.js.map +1 -0
- package/dist/utils/nearest-python-manifests.d.ts +9 -0
- package/dist/utils/nearest-python-manifests.d.ts.map +1 -0
- package/dist/utils/nearest-python-manifests.js +41 -0
- package/dist/utils/nearest-python-manifests.js.map +1 -0
- package/dist/utils/nearest-scan-dependency-context.d.ts +12 -0
- package/dist/utils/nearest-scan-dependency-context.d.ts.map +1 -0
- package/dist/utils/nearest-scan-dependency-context.js +21 -0
- package/dist/utils/nearest-scan-dependency-context.js.map +1 -0
- package/package.json +6 -6
- package/dist/coverage/index.d.ts +0 -50
- package/dist/coverage/index.d.ts.map +0 -1
- package/dist/coverage/index.js +0 -73
- package/dist/coverage/index.js.map +0 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blast radius — the pure part: which declarations a location changes, who
|
|
3
|
+
* calls them, the level thresholds, and the union of several radii (a batch).
|
|
4
|
+
*
|
|
5
|
+
* No IO and no model. Given the same code facts and items it gives the same
|
|
6
|
+
* answer, with every list sorted.
|
|
7
|
+
*/
|
|
8
|
+
import type { BlastBasis, BlastCallSite, BlastImportSite, BlastLevel, BlastLocation, BlastRadius } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Level thresholds, over the reach (touched files plus the files that call or
|
|
11
|
+
* import what the item changes; a module is a directory):
|
|
12
|
+
*
|
|
13
|
+
* - **low**: at most 3 files, all in one module;
|
|
14
|
+
* - **high**: 10 files or more, or 4 modules or more;
|
|
15
|
+
* - **medium**: anything between.
|
|
16
|
+
*
|
|
17
|
+
* Kept simple and on the cautious side: a change that leaves its own
|
|
18
|
+
* directory is never low.
|
|
19
|
+
*/
|
|
20
|
+
export declare const BLAST_THRESHOLDS: {
|
|
21
|
+
readonly low: {
|
|
22
|
+
readonly maxFiles: 3;
|
|
23
|
+
readonly maxModules: 1;
|
|
24
|
+
};
|
|
25
|
+
readonly high: {
|
|
26
|
+
readonly minFiles: 10;
|
|
27
|
+
readonly minModules: 4;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function levelFor(files: number, modules: number): BlastLevel;
|
|
31
|
+
/** `medium · 9 files`, `low · 1 file`, `not known · at least 1 file`. */
|
|
32
|
+
export declare function labelFor(level: BlastLevel, files: number): string;
|
|
33
|
+
/** A file's module: its directory, `/`-separated, relative to the code root (`.` at the root). */
|
|
34
|
+
export declare function moduleOf(file: string): string;
|
|
35
|
+
export interface FactDecl {
|
|
36
|
+
id: string;
|
|
37
|
+
kind: string;
|
|
38
|
+
name: string;
|
|
39
|
+
qualified_name: string;
|
|
40
|
+
parent: string | null;
|
|
41
|
+
start_line: number;
|
|
42
|
+
end_line: number;
|
|
43
|
+
}
|
|
44
|
+
export interface FactFile {
|
|
45
|
+
file: string;
|
|
46
|
+
decls: readonly FactDecl[];
|
|
47
|
+
}
|
|
48
|
+
export interface FactEdge {
|
|
49
|
+
from: string;
|
|
50
|
+
to: string;
|
|
51
|
+
tier: string;
|
|
52
|
+
methodName: string;
|
|
53
|
+
site: {
|
|
54
|
+
file: string;
|
|
55
|
+
line: number;
|
|
56
|
+
col?: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface FactUnresolved {
|
|
60
|
+
from: string;
|
|
61
|
+
methodName: string;
|
|
62
|
+
reason: string;
|
|
63
|
+
}
|
|
64
|
+
export interface CodeFacts {
|
|
65
|
+
scheme: string;
|
|
66
|
+
files: readonly FactFile[];
|
|
67
|
+
edges: readonly FactEdge[];
|
|
68
|
+
unresolved: readonly FactUnresolved[];
|
|
69
|
+
partial: readonly string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The declarations a location changes, in one file's facts:
|
|
73
|
+
*
|
|
74
|
+
* - `symbol`: the declarations whose member path is the symbol or ends with
|
|
75
|
+
* `.<symbol>` (a type brings its members);
|
|
76
|
+
* - lines: the innermost declarations that overlap the range (a type, when
|
|
77
|
+
* the lines are in it but in none of its members, brings its members),
|
|
78
|
+
* plus any declaration whose header line is in the range;
|
|
79
|
+
* - neither: every declaration in the file.
|
|
80
|
+
*/
|
|
81
|
+
export declare function selectChanged(file: FactFile, loc: BlastLocation): Set<string>;
|
|
82
|
+
/** Lines a change rewrites (the whole file: `end_line` is Infinity). Calls made from them are inside the change. */
|
|
83
|
+
export interface ChangedRegion {
|
|
84
|
+
file: string;
|
|
85
|
+
start_line: number;
|
|
86
|
+
end_line: number;
|
|
87
|
+
}
|
|
88
|
+
export interface CallerAnswer {
|
|
89
|
+
call_sites: BlastCallSite[];
|
|
90
|
+
unresolved_sites: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Calls into `changed` from declarations outside it (one hop), plus
|
|
94
|
+
* unresolved sites by the same name. A call made from inside one of
|
|
95
|
+
* `regions` (the lines, or the whole file, the change rewrites; e.g. a
|
|
96
|
+
* file's top-level code calling its own functions) is part of the change,
|
|
97
|
+
* not a caller of it.
|
|
98
|
+
*/
|
|
99
|
+
export declare function callersOf(facts: CodeFacts, changed: Set<string>, qualifiedName: Map<string, string>, regions?: readonly ChangedRegion[]): CallerAnswer;
|
|
100
|
+
/** One call site per file, line, callee and caller: the same key for an item and for a batch. */
|
|
101
|
+
export declare function siteKey(s: BlastCallSite): string;
|
|
102
|
+
export declare function sortCallSites(sites: BlastCallSite[]): BlastCallSite[];
|
|
103
|
+
export declare function emptyBasis(): BlastBasis;
|
|
104
|
+
/** Build a radius from what an item touches and what reaches into it; computes reach, level and label. */
|
|
105
|
+
export declare function assembleRadius(itemId: string, touchedFiles: Iterable<string>, callSites: BlastCallSite[], importSites: BlastImportSite[], basis: BlastBasis, known?: boolean): BlastRadius;
|
|
106
|
+
/**
|
|
107
|
+
* A batch's blast radius: the union of its items' (loop plan §5). Touched
|
|
108
|
+
* files, call sites and import sites are joined without duplicates, and the
|
|
109
|
+
* level is taken again over the joined reach, so two low items in different
|
|
110
|
+
* directories can make a medium batch; it is not known when any item's is
|
|
111
|
+
* not.
|
|
112
|
+
*
|
|
113
|
+
* `fromFacts` (what `blastRadius` passes) is the batch's callers worked out
|
|
114
|
+
* again from the code facts over the union of the items' changes: calls
|
|
115
|
+
* between them drop out by declaration id (so an unchanged overload stays a
|
|
116
|
+
* caller) and unresolved sites are counted once. Without it, calls whose
|
|
117
|
+
* caller is another item's changed declaration (by name, in a touched file)
|
|
118
|
+
* drop out, and unresolved sites are summed (an upper bound).
|
|
119
|
+
*/
|
|
120
|
+
export declare function unionRadius(batchId: string, radii: readonly BlastRadius[], fromFacts?: {
|
|
121
|
+
call_sites: BlastCallSite[];
|
|
122
|
+
unresolved_sites: number;
|
|
123
|
+
}): BlastRadius;
|
|
124
|
+
/**
|
|
125
|
+
* A qualified name as the screen shows it: the engine's `<anonymous>@…` ids
|
|
126
|
+
* for unnamed functions become `(anonymous function)` after the nearest
|
|
127
|
+
* named owner (`src/app:createApp/<anonymous>@2.37.0.1.1` →
|
|
128
|
+
* `src/app:createApp (anonymous function)`).
|
|
129
|
+
*/
|
|
130
|
+
export declare function displayName(qualifiedName: string): string;
|
|
131
|
+
/**
|
|
132
|
+
* The radius as returned: call sites name their caller and callee with
|
|
133
|
+
* `displayName`, and unnamed changed declarations are counted in a note
|
|
134
|
+
* instead of listed by id. Applied last, after any union, which compares
|
|
135
|
+
* the engine's own names.
|
|
136
|
+
*/
|
|
137
|
+
export declare function presentRadius(r: BlastRadius): BlastRadius;
|
|
138
|
+
//# sourceMappingURL=radius.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.d.ts","sourceRoot":"","sources":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M,CAAC,EAC9B,SAAS,EAAE,aAAa,EAAE,EAC1B,WAAW,EAAE,eAAe,EAAE,EAC9B,KAAK,EAAE,UAAU,EACjB,KAAK,UAAO,GACX,WAAW,CAyBb;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,SAAS,CAAC,EAAE;IAAE,UAAU,EAAE,aAAa,EAAE,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GACpE,WAAW,CA6Bb;AAQD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW,CAezD"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blast radius — the pure part: which declarations a location changes, who
|
|
3
|
+
* calls them, the level thresholds, and the union of several radii (a batch).
|
|
4
|
+
*
|
|
5
|
+
* No IO and no model. Given the same code facts and items it gives the same
|
|
6
|
+
* answer, with every list sorted.
|
|
7
|
+
*/
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Thresholds
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
/**
|
|
12
|
+
* Level thresholds, over the reach (touched files plus the files that call or
|
|
13
|
+
* import what the item changes; a module is a directory):
|
|
14
|
+
*
|
|
15
|
+
* - **low**: at most 3 files, all in one module;
|
|
16
|
+
* - **high**: 10 files or more, or 4 modules or more;
|
|
17
|
+
* - **medium**: anything between.
|
|
18
|
+
*
|
|
19
|
+
* Kept simple and on the cautious side: a change that leaves its own
|
|
20
|
+
* directory is never low.
|
|
21
|
+
*/
|
|
22
|
+
export const BLAST_THRESHOLDS = {
|
|
23
|
+
low: { maxFiles: 3, maxModules: 1 },
|
|
24
|
+
high: { minFiles: 10, minModules: 4 },
|
|
25
|
+
};
|
|
26
|
+
export function levelFor(files, modules) {
|
|
27
|
+
if (files >= BLAST_THRESHOLDS.high.minFiles || modules >= BLAST_THRESHOLDS.high.minModules)
|
|
28
|
+
return 'high';
|
|
29
|
+
if (files <= BLAST_THRESHOLDS.low.maxFiles && modules <= BLAST_THRESHOLDS.low.maxModules)
|
|
30
|
+
return 'low';
|
|
31
|
+
return 'medium';
|
|
32
|
+
}
|
|
33
|
+
/** `medium · 9 files`, `low · 1 file`, `not known · at least 1 file`. */
|
|
34
|
+
export function labelFor(level, files) {
|
|
35
|
+
const n = `${files} ${files === 1 ? 'file' : 'files'}`;
|
|
36
|
+
return level === 'unknown' ? `not known · at least ${n}` : `${level} · ${n}`;
|
|
37
|
+
}
|
|
38
|
+
/** A file's module: its directory, `/`-separated, relative to the code root (`.` at the root). */
|
|
39
|
+
export function moduleOf(file) {
|
|
40
|
+
const i = file.lastIndexOf('/');
|
|
41
|
+
return i <= 0 ? '.' : file.slice(0, i);
|
|
42
|
+
}
|
|
43
|
+
const byString = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
44
|
+
/** The part of a qualified name after `<module>:` (e.g. `Calc.total`). */
|
|
45
|
+
function memberPath(decl) {
|
|
46
|
+
const i = decl.qualified_name.indexOf(':');
|
|
47
|
+
return i >= 0 ? decl.qualified_name.slice(i + 1) : decl.qualified_name;
|
|
48
|
+
}
|
|
49
|
+
function descendants(decls, rootIds) {
|
|
50
|
+
const out = new Set(rootIds);
|
|
51
|
+
// Decls are in source order, a parent before its members, so one pass suffices.
|
|
52
|
+
for (const d of decls)
|
|
53
|
+
if (d.parent && out.has(d.parent))
|
|
54
|
+
out.add(d.id);
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The declarations a location changes, in one file's facts:
|
|
59
|
+
*
|
|
60
|
+
* - `symbol`: the declarations whose member path is the symbol or ends with
|
|
61
|
+
* `.<symbol>` (a type brings its members);
|
|
62
|
+
* - lines: the innermost declarations that overlap the range (a type, when
|
|
63
|
+
* the lines are in it but in none of its members, brings its members),
|
|
64
|
+
* plus any declaration whose header line is in the range;
|
|
65
|
+
* - neither: every declaration in the file.
|
|
66
|
+
*/
|
|
67
|
+
export function selectChanged(file, loc) {
|
|
68
|
+
const decls = file.decls.filter((d) => d.kind !== 'module');
|
|
69
|
+
let picked;
|
|
70
|
+
if (loc.symbol) {
|
|
71
|
+
const s = loc.symbol;
|
|
72
|
+
picked = decls.filter((d) => {
|
|
73
|
+
const m = memberPath(d);
|
|
74
|
+
return m === s || m.endsWith('.' + s);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
else if (loc.start_line !== undefined) {
|
|
78
|
+
const start = loc.start_line;
|
|
79
|
+
const end = Math.max(start, loc.end_line ?? start);
|
|
80
|
+
const overlapping = decls.filter((d) => d.start_line <= end && d.end_line >= start);
|
|
81
|
+
const ids = new Set(overlapping.map((d) => d.id));
|
|
82
|
+
// Innermost: drop a declaration when one of its members also overlaps.
|
|
83
|
+
const hasOverlappingChild = new Set(overlapping.filter((d) => d.parent && ids.has(d.parent)).map((d) => d.parent));
|
|
84
|
+
picked = overlapping.filter((d) => !hasOverlappingChild.has(d.id));
|
|
85
|
+
// ...but keep one whose header line is in the range (its signature changes: `new X()` reaches it).
|
|
86
|
+
const headers = overlapping.filter((d) => hasOverlappingChild.has(d.id) && d.start_line >= start && d.start_line <= end);
|
|
87
|
+
const out = descendants(decls, new Set(picked.map((d) => d.id)));
|
|
88
|
+
for (const d of headers)
|
|
89
|
+
out.add(d.id);
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
picked = decls;
|
|
94
|
+
}
|
|
95
|
+
return descendants(decls, new Set(picked.map((d) => d.id)));
|
|
96
|
+
}
|
|
97
|
+
const inRegion = (regions, file, start, end = start) => regions.some((r) => r.file === file && r.start_line <= start && end <= r.end_line);
|
|
98
|
+
/**
|
|
99
|
+
* Calls into `changed` from declarations outside it (one hop), plus
|
|
100
|
+
* unresolved sites by the same name. A call made from inside one of
|
|
101
|
+
* `regions` (the lines, or the whole file, the change rewrites; e.g. a
|
|
102
|
+
* file's top-level code calling its own functions) is part of the change,
|
|
103
|
+
* not a caller of it.
|
|
104
|
+
*/
|
|
105
|
+
export function callersOf(facts, changed, qualifiedName, regions = []) {
|
|
106
|
+
// A declaration whose whole body lies in a changed region is inside the change.
|
|
107
|
+
const inside = new Set(changed);
|
|
108
|
+
if (regions.length > 0) {
|
|
109
|
+
for (const f of facts.files) {
|
|
110
|
+
for (const d of f.decls)
|
|
111
|
+
if (inRegion(regions, f.file, d.start_line, d.end_line))
|
|
112
|
+
inside.add(d.id);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const sites = new Map();
|
|
116
|
+
for (const e of facts.edges) {
|
|
117
|
+
if (!changed.has(e.to) || inside.has(e.from))
|
|
118
|
+
continue;
|
|
119
|
+
if (inRegion(regions, e.site.file, e.site.line))
|
|
120
|
+
continue;
|
|
121
|
+
const site = {
|
|
122
|
+
file: e.site.file,
|
|
123
|
+
line: e.site.line,
|
|
124
|
+
symbol: qualifiedName.get(e.to) ?? e.to,
|
|
125
|
+
caller: qualifiedName.get(e.from) ?? e.from,
|
|
126
|
+
tier: e.tier,
|
|
127
|
+
};
|
|
128
|
+
if (!sites.has(siteKey(site)))
|
|
129
|
+
sites.set(siteKey(site), site);
|
|
130
|
+
}
|
|
131
|
+
const call_sites = [...sites.values()];
|
|
132
|
+
const names = new Set();
|
|
133
|
+
for (const f of facts.files)
|
|
134
|
+
for (const d of f.decls)
|
|
135
|
+
if (changed.has(d.id))
|
|
136
|
+
names.add(d.name);
|
|
137
|
+
let unresolved_sites = 0;
|
|
138
|
+
for (const u of facts.unresolved) {
|
|
139
|
+
if (u.reason === 'external' || inside.has(u.from))
|
|
140
|
+
continue;
|
|
141
|
+
if (names.has(u.methodName))
|
|
142
|
+
unresolved_sites++;
|
|
143
|
+
}
|
|
144
|
+
return { call_sites: sortCallSites(call_sites), unresolved_sites };
|
|
145
|
+
}
|
|
146
|
+
/** One call site per file, line, callee and caller: the same key for an item and for a batch. */
|
|
147
|
+
export function siteKey(s) {
|
|
148
|
+
return `${s.file}:${s.line}:${s.symbol}:${s.caller}`;
|
|
149
|
+
}
|
|
150
|
+
export function sortCallSites(sites) {
|
|
151
|
+
return sites.sort((a, b) => byString(a.file, b.file) || a.line - b.line || byString(a.symbol, b.symbol) || byString(a.caller, b.caller));
|
|
152
|
+
}
|
|
153
|
+
function sortImportSites(sites) {
|
|
154
|
+
return sites.sort((a, b) => byString(a.file, b.file) || (a.line ?? 0) - (b.line ?? 0) || byString(a.package, b.package));
|
|
155
|
+
}
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
// Assembling and joining radii
|
|
158
|
+
// ---------------------------------------------------------------------------
|
|
159
|
+
export function emptyBasis() {
|
|
160
|
+
return { graphs: [], declarations: [], dependencies: [], unresolved_sites: 0, partial_files: [], notes: [] };
|
|
161
|
+
}
|
|
162
|
+
const uniqSorted = (xs) => [...new Set(xs)].sort(byString);
|
|
163
|
+
/** Build a radius from what an item touches and what reaches into it; computes reach, level and label. */
|
|
164
|
+
export function assembleRadius(itemId, touchedFiles, callSites, importSites, basis, known = true) {
|
|
165
|
+
const files = uniqSorted(touchedFiles);
|
|
166
|
+
const reachFiles = new Set(files);
|
|
167
|
+
for (const s of callSites)
|
|
168
|
+
reachFiles.add(s.file);
|
|
169
|
+
for (const s of importSites)
|
|
170
|
+
reachFiles.add(s.file);
|
|
171
|
+
const reachModules = new Set([...reachFiles].map(moduleOf));
|
|
172
|
+
const level = known && !basis.truncated ? levelFor(reachFiles.size, reachModules.size) : 'unknown';
|
|
173
|
+
return {
|
|
174
|
+
item_id: itemId,
|
|
175
|
+
touched: { files, modules: uniqSorted(files.map(moduleOf)) },
|
|
176
|
+
call_sites: sortCallSites([...callSites]),
|
|
177
|
+
import_sites: sortImportSites([...importSites]),
|
|
178
|
+
reach: { files: reachFiles.size, modules: reachModules.size, call_sites: callSites.length },
|
|
179
|
+
level,
|
|
180
|
+
label: labelFor(level, reachFiles.size),
|
|
181
|
+
basis: {
|
|
182
|
+
graphs: uniqSorted(basis.graphs),
|
|
183
|
+
declarations: uniqSorted(basis.declarations),
|
|
184
|
+
dependencies: uniqSorted(basis.dependencies),
|
|
185
|
+
unresolved_sites: basis.unresolved_sites,
|
|
186
|
+
partial_files: uniqSorted(basis.partial_files),
|
|
187
|
+
notes: uniqSorted(basis.notes),
|
|
188
|
+
...(basis.truncated ? { truncated: true } : {}),
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* A batch's blast radius: the union of its items' (loop plan §5). Touched
|
|
194
|
+
* files, call sites and import sites are joined without duplicates, and the
|
|
195
|
+
* level is taken again over the joined reach, so two low items in different
|
|
196
|
+
* directories can make a medium batch; it is not known when any item's is
|
|
197
|
+
* not.
|
|
198
|
+
*
|
|
199
|
+
* `fromFacts` (what `blastRadius` passes) is the batch's callers worked out
|
|
200
|
+
* again from the code facts over the union of the items' changes: calls
|
|
201
|
+
* between them drop out by declaration id (so an unchanged overload stays a
|
|
202
|
+
* caller) and unresolved sites are counted once. Without it, calls whose
|
|
203
|
+
* caller is another item's changed declaration (by name, in a touched file)
|
|
204
|
+
* drop out, and unresolved sites are summed (an upper bound).
|
|
205
|
+
*/
|
|
206
|
+
export function unionRadius(batchId, radii, fromFacts) {
|
|
207
|
+
const callSites = new Map();
|
|
208
|
+
const importSites = new Map();
|
|
209
|
+
const basis = emptyBasis();
|
|
210
|
+
const touched = [];
|
|
211
|
+
for (const r of radii) {
|
|
212
|
+
touched.push(...r.touched.files);
|
|
213
|
+
for (const s of r.call_sites)
|
|
214
|
+
callSites.set(siteKey(s), s);
|
|
215
|
+
for (const s of r.import_sites)
|
|
216
|
+
importSites.set(`${s.file}:${s.line}:${s.package}`, s);
|
|
217
|
+
basis.graphs.push(...r.basis.graphs);
|
|
218
|
+
basis.declarations.push(...r.basis.declarations);
|
|
219
|
+
basis.dependencies.push(...r.basis.dependencies);
|
|
220
|
+
basis.partial_files.push(...r.basis.partial_files);
|
|
221
|
+
basis.notes.push(...r.basis.notes);
|
|
222
|
+
basis.unresolved_sites += r.basis.unresolved_sites;
|
|
223
|
+
if (r.basis.truncated)
|
|
224
|
+
basis.truncated = true;
|
|
225
|
+
}
|
|
226
|
+
let outside;
|
|
227
|
+
if (fromFacts) {
|
|
228
|
+
outside = fromFacts.call_sites;
|
|
229
|
+
basis.unresolved_sites = fromFacts.unresolved_sites;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
// A call into one item's change from another item's change is inside the batch's change.
|
|
233
|
+
const touchedSet = new Set(touched);
|
|
234
|
+
const declared = new Set(basis.declarations);
|
|
235
|
+
outside = [...callSites.values()].filter((s) => !(declared.has(s.caller) && touchedSet.has(s.file)));
|
|
236
|
+
}
|
|
237
|
+
const known = radii.every((r) => r.level !== 'unknown');
|
|
238
|
+
return assembleRadius(batchId, touched, outside, [...importSites.values()], basis, known);
|
|
239
|
+
}
|
|
240
|
+
// ---------------------------------------------------------------------------
|
|
241
|
+
// Presenting
|
|
242
|
+
// ---------------------------------------------------------------------------
|
|
243
|
+
const ANON = /\/?<anonymous>@[\d.]+/g;
|
|
244
|
+
/**
|
|
245
|
+
* A qualified name as the screen shows it: the engine's `<anonymous>@…` ids
|
|
246
|
+
* for unnamed functions become `(anonymous function)` after the nearest
|
|
247
|
+
* named owner (`src/app:createApp/<anonymous>@2.37.0.1.1` →
|
|
248
|
+
* `src/app:createApp (anonymous function)`).
|
|
249
|
+
*/
|
|
250
|
+
export function displayName(qualifiedName) {
|
|
251
|
+
if (!qualifiedName.includes('<anonymous>@'))
|
|
252
|
+
return qualifiedName;
|
|
253
|
+
const named = qualifiedName.replace(ANON, '').replace(/\/$/, '');
|
|
254
|
+
return `${named} (anonymous function)`;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The radius as returned: call sites name their caller and callee with
|
|
258
|
+
* `displayName`, and unnamed changed declarations are counted in a note
|
|
259
|
+
* instead of listed by id. Applied last, after any union, which compares
|
|
260
|
+
* the engine's own names.
|
|
261
|
+
*/
|
|
262
|
+
export function presentRadius(r) {
|
|
263
|
+
const anonymous = r.basis.declarations.filter((d) => d.includes('<anonymous>@'));
|
|
264
|
+
const notes = [...r.basis.notes];
|
|
265
|
+
if (anonymous.length > 0) {
|
|
266
|
+
notes.push(`${anonymous.length} unnamed ${anonymous.length === 1 ? 'function is' : 'functions are'} changed too (not listed)`);
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
...r,
|
|
270
|
+
call_sites: sortCallSites(r.call_sites.map((s) => ({ ...s, symbol: displayName(s.symbol), caller: displayName(s.caller) }))),
|
|
271
|
+
basis: {
|
|
272
|
+
...r.basis,
|
|
273
|
+
declarations: r.basis.declarations.filter((d) => !d.includes('<anonymous>@')),
|
|
274
|
+
notes: uniqSorted(notes),
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=radius.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.js","sourceRoot":"","sources":["../../src/blast-radius/radius.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;IACnC,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE;CAC7B,CAAC;AAEX,MAAM,UAAU,QAAQ,CAAC,KAAa,EAAE,OAAe;IACrD,IAAI,KAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,IAAI,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,UAAU;QAAE,OAAO,MAAM,CAA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CAAC;QACJ,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5H,KAAK,EAAE;YACL,GAAG,CAAC,CAAC,KAAK;YACV,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;YAC7E,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;SACzB;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blast radius per upkeep item — types.
|
|
3
|
+
*
|
|
4
|
+
* An item names where its fix would change the code (files, optionally line
|
|
5
|
+
* ranges or symbol names) and/or a dependency it bumps. Its blast radius is
|
|
6
|
+
* what that change touches: the files and modules it edits, the call sites
|
|
7
|
+
* that call the declarations it changes (or, for a dependency, the files
|
|
8
|
+
* that import the package), and a coarse level for the screen
|
|
9
|
+
* ("medium · 9 files").
|
|
10
|
+
*
|
|
11
|
+
* Field names are snake_case: this is the JSON contract the MCP tool, and
|
|
12
|
+
* later the CLI and REST route, return unchanged.
|
|
13
|
+
*/
|
|
14
|
+
/** One place an item's fix would change. Paths are relative to the code root. */
|
|
15
|
+
export interface BlastLocation {
|
|
16
|
+
file: string;
|
|
17
|
+
/** 1-based, inclusive. Omit both lines and `symbol` to mean the whole file. */
|
|
18
|
+
start_line?: number;
|
|
19
|
+
/** 1-based, inclusive. Defaults to `start_line`. */
|
|
20
|
+
end_line?: number;
|
|
21
|
+
/** A declaration name: `member`, `Owner.member`, or a type name. */
|
|
22
|
+
symbol?: string;
|
|
23
|
+
}
|
|
24
|
+
/** A dependency bump: the package, and the manifest that declares it. */
|
|
25
|
+
export interface BlastDependency {
|
|
26
|
+
/** As the usage index names it: npm/PyPI name, or Maven `group:artifact`. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** The manifest the bump edits (e.g. `package.json`), relative to the code root. */
|
|
29
|
+
manifest?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface BlastRadiusItem {
|
|
32
|
+
id: string;
|
|
33
|
+
locations?: BlastLocation[];
|
|
34
|
+
dependency?: BlastDependency;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `unknown` ("not known") when the code facts cannot back a level: the
|
|
38
|
+
* repository walk was cut short, or nothing the item names could be read
|
|
39
|
+
* (no graph for its files, no manifest and no importers). The reach then
|
|
40
|
+
* counts what was found, a lower bound.
|
|
41
|
+
*/
|
|
42
|
+
export type BlastLevel = 'low' | 'medium' | 'high' | 'unknown';
|
|
43
|
+
/** A call to a changed declaration, from outside the change. */
|
|
44
|
+
export interface BlastCallSite {
|
|
45
|
+
file: string;
|
|
46
|
+
line: number;
|
|
47
|
+
/** The changed declaration being called (qualified name). */
|
|
48
|
+
symbol: string;
|
|
49
|
+
/** The declaration the call sits in (qualified name). */
|
|
50
|
+
caller: string;
|
|
51
|
+
/** How the engine resolved the call: `exact`, `polymorphic` or `inferred`. */
|
|
52
|
+
tier: string;
|
|
53
|
+
}
|
|
54
|
+
/** An import of a bumped package. */
|
|
55
|
+
export interface BlastImportSite {
|
|
56
|
+
file: string;
|
|
57
|
+
line: number | null;
|
|
58
|
+
package: string;
|
|
59
|
+
}
|
|
60
|
+
export interface BlastBasis {
|
|
61
|
+
/** The code-fact schemes the answer was built from (e.g. `ts-call-edges@0.1`, `bom-usage`). */
|
|
62
|
+
graphs: string[];
|
|
63
|
+
/** Qualified names of the declarations taken as changed. */
|
|
64
|
+
declarations: string[];
|
|
65
|
+
/** Packages whose importers were counted. */
|
|
66
|
+
dependencies: string[];
|
|
67
|
+
/** Call sites the engine could not resolve whose method name matches a changed declaration (may also call it). */
|
|
68
|
+
unresolved_sites: number;
|
|
69
|
+
/** Files that did not parse completely; their call sites may be missing. */
|
|
70
|
+
partial_files: string[];
|
|
71
|
+
/** One line per thing worth knowing about how the answer was reached. */
|
|
72
|
+
notes: string[];
|
|
73
|
+
/** Present (true) when the repository walk stopped at its bounds: callers and importers beyond it are missing. */
|
|
74
|
+
truncated?: true;
|
|
75
|
+
}
|
|
76
|
+
export interface BlastRadius {
|
|
77
|
+
item_id: string;
|
|
78
|
+
touched: {
|
|
79
|
+
files: string[];
|
|
80
|
+
modules: string[];
|
|
81
|
+
};
|
|
82
|
+
call_sites: BlastCallSite[];
|
|
83
|
+
import_sites: BlastImportSite[];
|
|
84
|
+
reach: {
|
|
85
|
+
files: number;
|
|
86
|
+
modules: number;
|
|
87
|
+
call_sites: number;
|
|
88
|
+
};
|
|
89
|
+
level: BlastLevel;
|
|
90
|
+
/** e.g. `medium · 9 files`, or `not known · at least 1 file`. */
|
|
91
|
+
label: string;
|
|
92
|
+
basis: BlastBasis;
|
|
93
|
+
}
|
|
94
|
+
/** What `blastRadius()` returns: one radius per item, in input order. */
|
|
95
|
+
export interface BlastRadiusResult {
|
|
96
|
+
code_root: string;
|
|
97
|
+
items: BlastRadius[];
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/blast-radius/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,yEAAyE;AACzE,M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C,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAChD,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,KAAK,EAAE,UAAU,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blast radius per upkeep item — types.
|
|
3
|
+
*
|
|
4
|
+
* An item names where its fix would change the code (files, optionally line
|
|
5
|
+
* ranges or symbol names) and/or a dependency it bumps. Its blast radius is
|
|
6
|
+
* what that change touches: the files and modules it edits, the call sites
|
|
7
|
+
* that call the declarations it changes (or, for a dependency, the files
|
|
8
|
+
* that import the package), and a coarse level for the screen
|
|
9
|
+
* ("medium · 9 files").
|
|
10
|
+
*
|
|
11
|
+
* Field names are snake_case: this is the JSON contract the MCP tool, and
|
|
12
|
+
* later the CLI and REST route, return unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/blast-radius/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
package/dist/bom/assemble.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ import { type BomLayer, type RepoBom } from './types.js';
|
|
|
11
11
|
export interface BomInputDependency extends ClassifiableDependency {
|
|
12
12
|
scope?: 'required' | 'optional' | 'dev';
|
|
13
13
|
direct?: boolean;
|
|
14
|
+
/** OSGi: imported Java packages this library stands for (see `BomComponent.packages`). */
|
|
15
|
+
packages?: number;
|
|
16
|
+
/** Other names of the same library (see `BomComponent.aliases`). */
|
|
17
|
+
aliases?: string[];
|
|
14
18
|
}
|
|
15
19
|
/** A non-dependency component found by walking the repo (L6 config, L8 spec). */
|
|
16
20
|
export interface DetectedFile {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../src/bom/assemble.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,QAAQ,EAEb,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAIpB,0FAA0F;AAC1F,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,KAAK,CAAC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../src/bom/assemble.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,QAAQ,EAEb,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAIpB,0FAA0F;AAC1F,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,KAAK,CAAC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;IACtC,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAyF9D"}
|
package/dist/bom/assemble.js
CHANGED
|
@@ -16,6 +16,11 @@ export function assembleBom(params) {
|
|
|
16
16
|
const ecosystems = new Set();
|
|
17
17
|
for (const dep of dependencies) {
|
|
18
18
|
ecosystems.add(dep.ecosystem);
|
|
19
|
+
// Additive detail, present only when the inventory has it.
|
|
20
|
+
const detail = {
|
|
21
|
+
...(dep.packages ? { packages: dep.packages } : {}),
|
|
22
|
+
...(dep.aliases?.length ? { aliases: dep.aliases } : {}),
|
|
23
|
+
};
|
|
19
24
|
// Every dependency is L4 supply chain (the recursive dependency BOM).
|
|
20
25
|
buckets.L4.push({
|
|
21
26
|
name: dep.name,
|
|
@@ -25,6 +30,7 @@ export function assembleBom(params) {
|
|
|
25
30
|
ecosystem: dep.ecosystem,
|
|
26
31
|
source: 'dependency',
|
|
27
32
|
direct: dep.direct,
|
|
33
|
+
...detail,
|
|
28
34
|
});
|
|
29
35
|
// …and, if it is a protocol/framework/data library, its usage layer too.
|
|
30
36
|
const cls = classifyDependency(dep);
|
|
@@ -37,11 +43,16 @@ export function assembleBom(params) {
|
|
|
37
43
|
ecosystem: dep.ecosystem,
|
|
38
44
|
source: 'dependency',
|
|
39
45
|
direct: dep.direct,
|
|
46
|
+
...detail,
|
|
40
47
|
});
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
|
-
// L2 Runtime — one component per distinct
|
|
50
|
+
// L2 Runtime — one component per distinct runtime (maven and osgi are both the JVM).
|
|
51
|
+
const runtimes = new Set();
|
|
44
52
|
for (const eco of ecosystems) {
|
|
53
|
+
if (runtimes.has(runtimeForEcosystem(eco)))
|
|
54
|
+
continue;
|
|
55
|
+
runtimes.add(runtimeForEcosystem(eco));
|
|
45
56
|
buckets.L2.push({
|
|
46
57
|
name: runtimeForEcosystem(eco),
|
|
47
58
|
layer: 'L2',
|
package/dist/bom/assemble.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assemble.js","sourceRoot":"","sources":["../../src/bom/assemble.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,GAKjB,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,GAAe,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"assemble.js","sourceRoot":"","sources":["../../src/bom/assemble.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,GAKjB,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,GAAe,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AA2BhF,MAAM,UAAU,WAAW,CAAC,MAAyB;IACnD,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAEpD,MAAM,OAAO,GAAqC;QAChD,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAA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