circle-ir 4.19.0 → 4.21.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/dist/analysis/advisories.d.ts +21 -3
- package/dist/analysis/advisories.d.ts.map +1 -1
- package/dist/analysis/advisories.js +26 -8
- package/dist/analysis/advisories.js.map +1 -1
- package/dist/analysis/arg-executing-programs.d.ts +16 -0
- package/dist/analysis/arg-executing-programs.d.ts.map +1 -0
- package/dist/analysis/arg-executing-programs.js +24 -0
- package/dist/analysis/arg-executing-programs.js.map +1 -0
- package/dist/analysis/config-loader.d.ts.map +1 -1
- package/dist/analysis/config-loader.js +27 -3
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/analysis/constant-caller-gate.d.ts +3 -1
- package/dist/analysis/constant-caller-gate.d.ts.map +1 -1
- package/dist/analysis/constant-caller-gate.js +108 -1
- package/dist/analysis/constant-caller-gate.js.map +1 -1
- package/dist/analysis/constant-propagation/index.d.ts.map +1 -1
- package/dist/analysis/constant-propagation/index.js +1 -1
- package/dist/analysis/constant-propagation/index.js.map +1 -1
- package/dist/analysis/constant-propagation/patterns.d.ts.map +1 -1
- package/dist/analysis/constant-propagation/patterns.js +8 -0
- package/dist/analysis/constant-propagation/patterns.js.map +1 -1
- package/dist/analysis/constant-propagation/propagator.d.ts +47 -2
- package/dist/analysis/constant-propagation/propagator.d.ts.map +1 -1
- package/dist/analysis/constant-propagation/propagator.js +422 -57
- package/dist/analysis/constant-propagation/propagator.js.map +1 -1
- package/dist/analysis/constant-propagation/types.d.ts +2 -0
- package/dist/analysis/constant-propagation/types.d.ts.map +1 -1
- package/dist/analysis/dependency-versions.d.ts +33 -0
- package/dist/analysis/dependency-versions.d.ts.map +1 -1
- package/dist/analysis/dependency-versions.js +70 -0
- package/dist/analysis/dependency-versions.js.map +1 -1
- package/dist/analysis/findings.d.ts.map +1 -1
- package/dist/analysis/findings.js +7 -5
- package/dist/analysis/findings.js.map +1 -1
- package/dist/analysis/interprocedural.d.ts +16 -0
- package/dist/analysis/interprocedural.d.ts.map +1 -1
- package/dist/analysis/interprocedural.js +545 -197
- package/dist/analysis/interprocedural.js.map +1 -1
- package/dist/analysis/passes/constant-propagation-pass.d.ts.map +1 -1
- package/dist/analysis/passes/constant-propagation-pass.js +1 -0
- package/dist/analysis/passes/constant-propagation-pass.js.map +1 -1
- package/dist/analysis/passes/cross-file-pass.d.ts.map +1 -1
- package/dist/analysis/passes/cross-file-pass.js +61 -0
- package/dist/analysis/passes/cross-file-pass.js.map +1 -1
- package/dist/analysis/passes/csharp-sanitizer-credit.d.ts.map +1 -1
- package/dist/analysis/passes/csharp-sanitizer-credit.js +60 -3
- package/dist/analysis/passes/csharp-sanitizer-credit.js.map +1 -1
- package/dist/analysis/passes/csrf-samesite-none-session-pass.d.ts +58 -0
- package/dist/analysis/passes/csrf-samesite-none-session-pass.d.ts.map +1 -0
- package/dist/analysis/passes/csrf-samesite-none-session-pass.js +159 -0
- package/dist/analysis/passes/csrf-samesite-none-session-pass.js.map +1 -0
- package/dist/analysis/passes/deserialization-safety-gate-pass.d.ts +15 -0
- package/dist/analysis/passes/deserialization-safety-gate-pass.d.ts.map +1 -1
- package/dist/analysis/passes/deserialization-safety-gate-pass.js +60 -1
- package/dist/analysis/passes/deserialization-safety-gate-pass.js.map +1 -1
- package/dist/analysis/passes/interprocedural-pass.d.ts +23 -1
- package/dist/analysis/passes/interprocedural-pass.d.ts.map +1 -1
- package/dist/analysis/passes/interprocedural-pass.js +220 -7
- package/dist/analysis/passes/interprocedural-pass.js.map +1 -1
- package/dist/analysis/passes/language-sources-pass.d.ts +0 -18
- package/dist/analysis/passes/language-sources-pass.d.ts.map +1 -1
- package/dist/analysis/passes/language-sources-pass.js +549 -22
- package/dist/analysis/passes/language-sources-pass.js.map +1 -1
- package/dist/analysis/passes/param-source-flow-gate-pass.d.ts.map +1 -1
- package/dist/analysis/passes/param-source-flow-gate-pass.js +71 -1
- package/dist/analysis/passes/param-source-flow-gate-pass.js.map +1 -1
- package/dist/analysis/passes/prompt-injection-safety-gate-pass.js +1 -1
- package/dist/analysis/passes/prompt-injection-safety-gate-pass.js.map +1 -1
- package/dist/analysis/passes/resource-leak-pass.d.ts.map +1 -1
- package/dist/analysis/passes/resource-leak-pass.js +15 -3
- package/dist/analysis/passes/resource-leak-pass.js.map +1 -1
- package/dist/analysis/passes/scan-secrets-pass.js +2 -2
- package/dist/analysis/passes/scan-secrets-pass.js.map +1 -1
- package/dist/analysis/passes/sensitive-data-in-log-pass.d.ts +66 -0
- package/dist/analysis/passes/sensitive-data-in-log-pass.d.ts.map +1 -0
- package/dist/analysis/passes/sensitive-data-in-log-pass.js +462 -0
- package/dist/analysis/passes/sensitive-data-in-log-pass.js.map +1 -0
- package/dist/analysis/passes/sink-filter-pass.d.ts +7 -1
- package/dist/analysis/passes/sink-filter-pass.d.ts.map +1 -1
- package/dist/analysis/passes/sink-filter-pass.js +564 -22
- package/dist/analysis/passes/sink-filter-pass.js.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.d.ts +7 -3
- package/dist/analysis/passes/taint-propagation-pass.d.ts.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.js +464 -27
- package/dist/analysis/passes/taint-propagation-pass.js.map +1 -1
- package/dist/analysis/passes/xml-entity-expansion-pass.d.ts.map +1 -1
- package/dist/analysis/passes/xml-entity-expansion-pass.js +50 -6
- package/dist/analysis/passes/xml-entity-expansion-pass.js.map +1 -1
- package/dist/analysis/pep440-version.d.ts +40 -0
- package/dist/analysis/pep440-version.d.ts.map +1 -0
- package/dist/analysis/pep440-version.js +149 -0
- package/dist/analysis/pep440-version.js.map +1 -0
- package/dist/analysis/project-callee-escape-gate.js +1 -1
- package/dist/analysis/project-callee-escape-gate.js.map +1 -1
- package/dist/analysis/rules.d.ts.map +1 -1
- package/dist/analysis/rules.js +15 -0
- package/dist/analysis/rules.js.map +1 -1
- package/dist/analysis/sbom.d.ts +92 -4
- package/dist/analysis/sbom.d.ts.map +1 -1
- package/dist/analysis/sbom.js +390 -33
- package/dist/analysis/sbom.js.map +1 -1
- package/dist/analysis/taint-matcher.d.ts.map +1 -1
- package/dist/analysis/taint-matcher.js +124 -19
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/analysis/taint-propagation.d.ts +1 -0
- package/dist/analysis/taint-propagation.d.ts.map +1 -1
- package/dist/analysis/taint-propagation.js +32 -0
- package/dist/analysis/taint-propagation.js.map +1 -1
- package/dist/analysis/test-to-production-taint-gate.d.ts +13 -0
- package/dist/analysis/test-to-production-taint-gate.d.ts.map +1 -0
- package/dist/analysis/test-to-production-taint-gate.js +30 -0
- package/dist/analysis/test-to-production-taint-gate.js.map +1 -0
- package/dist/analyzer.d.ts +21 -3
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +83 -3
- package/dist/analyzer.js.map +1 -1
- package/dist/browser/circle-ir.js +8118 -2526
- package/dist/core/circle-ir-core.cjs +3098 -2280
- package/dist/core/circle-ir-core.js +3036 -2214
- package/dist/core/extractors/calls.d.ts +10 -1
- package/dist/core/extractors/calls.d.ts.map +1 -1
- package/dist/core/extractors/calls.js +148 -6
- package/dist/core/extractors/calls.js.map +1 -1
- package/dist/core/extractors/cfg.d.ts.map +1 -1
- package/dist/core/extractors/cfg.js +12 -0
- package/dist/core/extractors/cfg.js.map +1 -1
- package/dist/core/extractors/dfg.d.ts.map +1 -1
- package/dist/core/extractors/dfg.js +151 -18
- package/dist/core/extractors/dfg.js.map +1 -1
- package/dist/core/extractors/ts-declaration-detail.d.ts +8 -0
- package/dist/core/extractors/ts-declaration-detail.d.ts.map +1 -1
- package/dist/core/extractors/ts-declaration-detail.js +22 -0
- package/dist/core/extractors/ts-declaration-detail.js.map +1 -1
- package/dist/core/extractors/types.d.ts +5 -0
- package/dist/core/extractors/types.d.ts.map +1 -1
- package/dist/core/extractors/types.js +149 -4
- package/dist/core/extractors/types.js.map +1 -1
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/parser.js +3 -1
- package/dist/core/parser.js.map +1 -1
- package/dist/core/ts-grammar-workarounds.d.ts +18 -0
- package/dist/core/ts-grammar-workarounds.d.ts.map +1 -0
- package/dist/core/ts-grammar-workarounds.js +40 -0
- package/dist/core/ts-grammar-workarounds.js.map +1 -0
- package/dist/facts/arrow.d.ts +106 -0
- package/dist/facts/arrow.d.ts.map +1 -0
- package/dist/facts/arrow.js +196 -0
- package/dist/facts/arrow.js.map +1 -0
- package/dist/facts/facts2.d.ts +68 -0
- package/dist/facts/facts2.d.ts.map +1 -0
- package/dist/facts/facts2.js +379 -0
- package/dist/facts/facts2.js.map +1 -0
- package/dist/facts/index.d.ts +22 -0
- package/dist/facts/index.d.ts.map +1 -0
- package/dist/facts/index.js +15 -0
- package/dist/facts/index.js.map +1 -0
- package/dist/facts/java-facts.d.ts +56 -0
- package/dist/facts/java-facts.d.ts.map +1 -0
- package/dist/facts/java-facts.js +250 -0
- package/dist/facts/java-facts.js.map +1 -0
- package/dist/facts/order.d.ts +39 -0
- package/dist/facts/order.d.ts.map +1 -0
- package/dist/facts/order.js +120 -0
- package/dist/facts/order.js.map +1 -0
- package/dist/facts/schema.d.ts +60 -0
- package/dist/facts/schema.d.ts.map +1 -0
- package/dist/facts/schema.js +126 -0
- package/dist/facts/schema.js.map +1 -0
- package/dist/facts/schema2.d.ts +47 -0
- package/dist/facts/schema2.d.ts.map +1 -0
- package/dist/facts/schema2.js +194 -0
- package/dist/facts/schema2.js.map +1 -0
- package/dist/facts/t6.d.ts +84 -0
- package/dist/facts/t6.d.ts.map +1 -0
- package/dist/facts/t6.js +226 -0
- package/dist/facts/t6.js.map +1 -0
- package/dist/facts/table.d.ts +80 -0
- package/dist/facts/table.d.ts.map +1 -0
- package/dist/facts/table.js +548 -0
- package/dist/facts/table.js.map +1 -0
- package/dist/graph-facts/dead-code.d.ts +2 -0
- package/dist/graph-facts/dead-code.d.ts.map +1 -1
- package/dist/graph-facts/dead-code.js +4 -3
- package/dist/graph-facts/dead-code.js.map +1 -1
- package/dist/graph-facts/index.d.ts +1 -1
- package/dist/graph-facts/index.d.ts.map +1 -1
- package/dist/graph-facts/index.js +1 -1
- package/dist/graph-facts/index.js.map +1 -1
- package/dist/graph-facts/reach.d.ts +53 -8
- package/dist/graph-facts/reach.d.ts.map +1 -1
- package/dist/graph-facts/reach.js +172 -16
- package/dist/graph-facts/reach.js.map +1 -1
- package/dist/graph-facts/removal-reach.d.ts +2 -0
- package/dist/graph-facts/removal-reach.d.ts.map +1 -1
- package/dist/graph-facts/removal-reach.js +1 -1
- package/dist/graph-facts/removal-reach.js.map +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/java-graph.d.ts +47 -2
- package/dist/navigation/java-graph.d.ts.map +1 -1
- package/dist/navigation/java-graph.js +395 -18
- package/dist/navigation/java-graph.js.map +1 -1
- package/dist/navigation/java-registrations.d.ts +93 -0
- package/dist/navigation/java-registrations.d.ts.map +1 -0
- package/dist/navigation/java-registrations.js +254 -0
- package/dist/navigation/java-registrations.js.map +1 -0
- package/dist/navigation/navigation-index.d.ts +74 -3
- package/dist/navigation/navigation-index.d.ts.map +1 -1
- package/dist/navigation/navigation-index.js +206 -11
- package/dist/navigation/navigation-index.js.map +1 -1
- package/dist/navigation/ts-call-edges.d.ts +15 -0
- package/dist/navigation/ts-call-edges.d.ts.map +1 -1
- package/dist/navigation/ts-call-edges.js.map +1 -1
- package/dist/navigation/ts-entry-tables.d.ts +1 -1
- package/dist/navigation/ts-entry-tables.d.ts.map +1 -1
- package/dist/navigation/ts-entry-tables.js.map +1 -1
- package/dist/navigation/xml-scan.d.ts +40 -0
- package/dist/navigation/xml-scan.d.ts.map +1 -0
- package/dist/navigation/xml-scan.js +269 -0
- package/dist/navigation/xml-scan.js.map +1 -0
- package/dist/resolution/cross-file.d.ts +44 -0
- package/dist/resolution/cross-file.d.ts.map +1 -1
- package/dist/resolution/cross-file.js +259 -13
- package/dist/resolution/cross-file.js.map +1 -1
- package/dist/stable-ids/files.d.ts +22 -0
- package/dist/stable-ids/files.d.ts.map +1 -0
- package/dist/stable-ids/files.js +28 -0
- package/dist/stable-ids/files.js.map +1 -0
- package/dist/stable-ids/hash.d.ts +16 -4
- package/dist/stable-ids/hash.d.ts.map +1 -1
- package/dist/stable-ids/hash.js +266 -80
- package/dist/stable-ids/hash.js.map +1 -1
- package/dist/stable-ids/index.d.ts +6 -5
- package/dist/stable-ids/index.d.ts.map +1 -1
- package/dist/stable-ids/index.js +19 -6
- package/dist/stable-ids/index.js.map +1 -1
- package/dist/stable-ids/nodes.d.ts +61 -7
- package/dist/stable-ids/nodes.d.ts.map +1 -1
- package/dist/stable-ids/nodes.js +134 -21
- package/dist/stable-ids/nodes.js.map +1 -1
- package/dist/stable-ids/ts-parse-errors.d.ts +5 -1
- package/dist/stable-ids/ts-parse-errors.d.ts.map +1 -1
- package/dist/stable-ids/ts-parse-errors.js +55 -3
- package/dist/stable-ids/ts-parse-errors.js.map +1 -1
- package/dist/stable-ids/typescript.d.ts +5 -0
- package/dist/stable-ids/typescript.d.ts.map +1 -1
- package/dist/stable-ids/typescript.js +41 -8
- package/dist/stable-ids/typescript.js.map +1 -1
- package/dist/types/index.d.ts +21 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/docs/SPEC.md +9 -0
- package/package.json +9 -5
- package/schemas/facts@1.json +134 -0
- package/schemas/facts@2.json +216 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `facts@2` rows from a call graph: a post-pass over the graph the engine
|
|
3
|
+
* already builds (`java-graph@0.1`, or `ts-call-edges@0.1` for TypeScript and
|
|
4
|
+
* JavaScript), the counterpart of `javaGraphFactSet` for the `facts@2`
|
|
5
|
+
* schema. Opt-in: `facts@1` stays the default (`JavaGraphOptions.factsScheme`).
|
|
6
|
+
*
|
|
7
|
+
* Against the `facts@1` post-pass:
|
|
8
|
+
* - every relation that names a file carries the stable file key
|
|
9
|
+
* (`fileKey(path)`), never a dense index;
|
|
10
|
+
* - a site (`call`, `unresolved`, `ref`, `registration`) carries `rel_line` =
|
|
11
|
+
* its line minus the start line of the declaration whose body holds it, and
|
|
12
|
+
* its column, and no file (the file is that declaration's file);
|
|
13
|
+
* - `decl` has no position (`decl_pos` holds it) and gains `name`,
|
|
14
|
+
* `parent_id`, `type_only`, the two `ids@0.1` flags, `contained` (the
|
|
15
|
+
* reach walk's `contains` rule, `containedIn`) and `loads_parent` (the
|
|
16
|
+
* graph's member-initializes-its-class `loads`);
|
|
17
|
+
* - `call.declaring` marks the polymorphic row whose callee is the member the
|
|
18
|
+
* receiver's static type declares;
|
|
19
|
+
* - `ref` (references), `registration` (unresolved registrations),
|
|
20
|
+
* `files.partial` and `parse_error` (the first blocking parse error, its
|
|
21
|
+
* column 0-based) are new.
|
|
22
|
+
*
|
|
23
|
+
* The `#n` re-key of a declaration id two files derive is the `facts@1` one,
|
|
24
|
+
* and it rewrites `parent_id` and every site's declaration as it rewrites
|
|
25
|
+
* `caller_id`. Built as columns, then each relation goes through
|
|
26
|
+
* `canonicalTable` (sorted, duplicates dropped and counted).
|
|
27
|
+
*/
|
|
28
|
+
import { containedIn } from '../graph-facts/reach.js';
|
|
29
|
+
import { digest128 } from '../stable-ids/hash.js';
|
|
30
|
+
import { NodeIdWriter, declLocator, locateNodes } from '../stable-ids/nodes.js';
|
|
31
|
+
import { STABLE_ID_SCHEME } from '../stable-ids/types.js';
|
|
32
|
+
import { compareCodePoints } from './order.js';
|
|
33
|
+
import { FACTS_ID_WIDTH } from './schema.js';
|
|
34
|
+
import { FACTS2_RELATION_NAMES, FACTS2_RELATIONS, FACTS2_SCHEME, fileKey } from './schema2.js';
|
|
35
|
+
import { IdDecoder, allocTable, canonicalTable, dictIndex, keyCollisions } from './table.js';
|
|
36
|
+
import { contentHash, factsEntryKind } from './java-facts.js';
|
|
37
|
+
/**
|
|
38
|
+
* Polymorphic call edges that are the declaring row of their site. The Java
|
|
39
|
+
* graph sets `via` on the other rows only, so `buildJavaGraph` marks the
|
|
40
|
+
* declaring one here; the TypeScript graph sets `via` on every row of the
|
|
41
|
+
* site, the declaring one included (`via === to`). A mark, not a field, so
|
|
42
|
+
* the graph's JSON is unchanged.
|
|
43
|
+
*/
|
|
44
|
+
const declaringEdges = new WeakSet();
|
|
45
|
+
/** Mark `edge` as the declaring row of its polymorphic site (for `call.declaring`). */
|
|
46
|
+
export function markDeclaringEdge(edge) {
|
|
47
|
+
declaringEdges.add(edge);
|
|
48
|
+
}
|
|
49
|
+
function isDeclaring(e) {
|
|
50
|
+
return e.tier === 'polymorphic' && (e.via === e.to || declaringEdges.has(e));
|
|
51
|
+
}
|
|
52
|
+
function dict(relation, column) {
|
|
53
|
+
return dictIndex(relation.columns.find(c => c.name === column));
|
|
54
|
+
}
|
|
55
|
+
function code(d, value, column) {
|
|
56
|
+
const k = d.get(value);
|
|
57
|
+
if (k === undefined)
|
|
58
|
+
throw new Error(`${FACTS2_SCHEME}: ${JSON.stringify(value)} is not in the ${column} vocabulary`);
|
|
59
|
+
return k;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The twelve `facts@2` relations of a graph, each a canonical set, with the
|
|
63
|
+
* dedupe counts. `inputs` must cover every file of the graph (a file the
|
|
64
|
+
* graph names but the inputs do not is an error, never a silent gap).
|
|
65
|
+
*/
|
|
66
|
+
function graphFact2Set(graph, inputs, extras) {
|
|
67
|
+
if (graph.ids !== STABLE_ID_SCHEME)
|
|
68
|
+
throw new Error(`${FACTS2_SCHEME}: graph ids are ${String(graph.ids)}, not ${STABLE_ID_SCHEME}`);
|
|
69
|
+
const R = FACTS2_RELATIONS;
|
|
70
|
+
const ids = new IdDecoder();
|
|
71
|
+
const paths = [...new Set(inputs.map(i => i.path))].sort(compareCodePoints);
|
|
72
|
+
const byPath = new Map(inputs.map(i => [i.path, i]));
|
|
73
|
+
const graphFiles = new Map(graph.files.map(f => [f.file, f]));
|
|
74
|
+
for (const f of graph.files)
|
|
75
|
+
if (!byPath.has(f.file))
|
|
76
|
+
throw new Error(`${FACTS2_SCHEME}: ${f.file} is in the graph but not in the inputs`);
|
|
77
|
+
const keys = new Map(paths.map(p => [p, fileKey(p)]));
|
|
78
|
+
const orderedFiles = paths.map(p => graphFiles.get(p)).filter((f) => f !== undefined);
|
|
79
|
+
// Each file's declarations by their engine id, for parents, start lines and site owners.
|
|
80
|
+
const declsOf = new Map(orderedFiles.map(f => [f.file, new Map(f.decls.map(d => [d.id, d]))]));
|
|
81
|
+
const declIn = (file, id) => {
|
|
82
|
+
const d = declsOf.get(file)?.get(id);
|
|
83
|
+
if (!d)
|
|
84
|
+
throw new Error(`${FACTS2_SCHEME}: declaration ${id} is not in ${file}`);
|
|
85
|
+
return d;
|
|
86
|
+
};
|
|
87
|
+
// files
|
|
88
|
+
const files = allocTable(R.files, paths.length);
|
|
89
|
+
let partialCount = 0;
|
|
90
|
+
{
|
|
91
|
+
const languages = dict(R.files, 'language');
|
|
92
|
+
for (let i = 0; i < paths.length; i++) {
|
|
93
|
+
const p = paths[i];
|
|
94
|
+
const g = graphFiles.get(p);
|
|
95
|
+
const language = g?.language ?? extras.language;
|
|
96
|
+
if (language === undefined)
|
|
97
|
+
throw new Error(`${FACTS2_SCHEME}: ${p} is in the inputs but not in the graph`);
|
|
98
|
+
files[0].set(keys.get(p), i * FACTS_ID_WIDTH);
|
|
99
|
+
files[1][i] = p;
|
|
100
|
+
files[2].set(contentHash(byPath.get(p).code), i * FACTS_ID_WIDTH);
|
|
101
|
+
files[3][i] = code(languages, language, 'language');
|
|
102
|
+
if (g?.partial) {
|
|
103
|
+
files[4][i] = 1;
|
|
104
|
+
partialCount++;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// parse_error — one row per partial file.
|
|
109
|
+
const parseError = allocTable(R.parse_error, partialCount);
|
|
110
|
+
{
|
|
111
|
+
let i = 0;
|
|
112
|
+
for (const f of orderedFiles) {
|
|
113
|
+
if (!f.partial)
|
|
114
|
+
continue;
|
|
115
|
+
const e = f.parseError;
|
|
116
|
+
if (!e)
|
|
117
|
+
throw new Error(`${FACTS2_SCHEME}: ${f.file} is partial but has no parse error`);
|
|
118
|
+
parseError[0].set(keys.get(f.file), i * FACTS_ID_WIDTH);
|
|
119
|
+
parseError[1][i] = e.line;
|
|
120
|
+
// The engine's parse-error column is 1-based; every column in facts@2 is 0-based.
|
|
121
|
+
parseError[2][i] = Math.max(0, e.column - 1);
|
|
122
|
+
parseError[3][i] = e.nodeKind;
|
|
123
|
+
parseError[4][i] = e.parent;
|
|
124
|
+
i++;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// decl and decl_pos — in file order (code point), the order the duplicate rule counts in.
|
|
128
|
+
const declCount = orderedFiles.reduce((n, f) => n + f.decls.length, 0);
|
|
129
|
+
const decl = allocTable(R.decl, declCount);
|
|
130
|
+
const declPos = allocTable(R.decl_pos, declCount);
|
|
131
|
+
const rekey = new Map();
|
|
132
|
+
const rekeyed = (file, id) => (rekey.size > 0 ? rekey.get(file)?.get(id)?.id ?? id : id);
|
|
133
|
+
{
|
|
134
|
+
const kinds = dict(R.decl, 'kind');
|
|
135
|
+
const typeOnly = new Set(graph.typeOnly);
|
|
136
|
+
const loads = new Set((extras.loads ?? []).map(l => `${l.from}\n${l.to}`));
|
|
137
|
+
const seen = new Map();
|
|
138
|
+
let i = 0;
|
|
139
|
+
for (const f of orderedFiles) {
|
|
140
|
+
const file = keys.get(f.file);
|
|
141
|
+
const byId = declsOf.get(f.file);
|
|
142
|
+
const module = f.decls[0];
|
|
143
|
+
for (const d of f.decls) {
|
|
144
|
+
let id = d.id;
|
|
145
|
+
let qualifiedName = d.qualified_name;
|
|
146
|
+
const n = (seen.get(d.id) ?? 0) + 1;
|
|
147
|
+
seen.set(d.id, n);
|
|
148
|
+
if (n > 1) {
|
|
149
|
+
qualifiedName = `${d.qualified_name}#${n}`;
|
|
150
|
+
id = digest128([STABLE_ID_SCHEME, f.language, d.kind, qualifiedName, d.signature]);
|
|
151
|
+
let m = rekey.get(f.file);
|
|
152
|
+
if (!m)
|
|
153
|
+
rekey.set(f.file, (m = new Map()));
|
|
154
|
+
m.set(d.id, { id, qualifiedName });
|
|
155
|
+
}
|
|
156
|
+
const o = i * FACTS_ID_WIDTH;
|
|
157
|
+
const parent = d.parent === null ? undefined : byId.get(d.parent);
|
|
158
|
+
ids.put(id, decl[0], o);
|
|
159
|
+
decl[1][i] = code(kinds, d.kind, 'kind');
|
|
160
|
+
decl[2][i] = d.name;
|
|
161
|
+
decl[3][i] = qualifiedName;
|
|
162
|
+
decl[4][i] = d.signature;
|
|
163
|
+
decl[5].set(file, o);
|
|
164
|
+
// No nulls in facts@2: all-zero bytes for a module's parent and for a missing body hash (the arrays start zeroed).
|
|
165
|
+
if (d.parent !== null)
|
|
166
|
+
ids.put(rekeyed(f.file, d.parent), decl[6], o);
|
|
167
|
+
if (d.body_hash)
|
|
168
|
+
ids.put(d.body_hash, decl[7], o);
|
|
169
|
+
decl[8][i] = typeOnly.has(d.id) ? 1 : 0;
|
|
170
|
+
decl[9][i] = d.flags.includes('unstable:anonymous') ? 1 : 0;
|
|
171
|
+
decl[10][i] = d.flags.includes('unstable:duplicate') || n > 1 ? 1 : 0;
|
|
172
|
+
decl[11][i] = d !== module && parent !== undefined && containedIn(d, parent, module, f.language) ? 1 : 0;
|
|
173
|
+
decl[12][i] = d.parent !== null && loads.has(`${d.id}\n${d.parent}`) ? 1 : 0;
|
|
174
|
+
ids.put(id, declPos[0], o);
|
|
175
|
+
declPos[1][i] = d.start_line;
|
|
176
|
+
declPos[2][i] = d.end_line;
|
|
177
|
+
declPos[3][i] = d.start_column;
|
|
178
|
+
declPos[4][i] = d.end_column;
|
|
179
|
+
i++;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** The site's line relative to the start line of `owner`, the declaration (in the site's file) whose body holds it. */
|
|
184
|
+
const relLine = (site, owner) => {
|
|
185
|
+
const start = declIn(site.file, owner).start_line;
|
|
186
|
+
const rel = site.line - start;
|
|
187
|
+
if (rel < 0)
|
|
188
|
+
throw new Error(`${FACTS2_SCHEME}: a site at ${site.file}:${site.line} lies above its declaration's start line ${start}`);
|
|
189
|
+
return rel;
|
|
190
|
+
};
|
|
191
|
+
// call
|
|
192
|
+
const call = allocTable(R.call, graph.edges.length);
|
|
193
|
+
{
|
|
194
|
+
const tiers = dict(R.call, 'tier');
|
|
195
|
+
for (let i = 0; i < graph.edges.length; i++) {
|
|
196
|
+
const e = graph.edges[i];
|
|
197
|
+
ids.put(rekeyed(e.site.file, e.from), call[0], i * FACTS_ID_WIDTH);
|
|
198
|
+
ids.put(e.to, call[1], i * FACTS_ID_WIDTH);
|
|
199
|
+
call[2][i] = code(tiers, e.tier, 'tier');
|
|
200
|
+
call[3][i] = e.methodName;
|
|
201
|
+
call[4][i] = relLine(e.site, e.from);
|
|
202
|
+
call[5][i] = e.site.col;
|
|
203
|
+
call[6][i] = isDeclaring(e) ? 1 : 0;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// unresolved
|
|
207
|
+
const unresolved = allocTable(R.unresolved, graph.unresolved.length);
|
|
208
|
+
{
|
|
209
|
+
const reasons = dict(R.unresolved, 'reason');
|
|
210
|
+
for (let i = 0; i < graph.unresolved.length; i++) {
|
|
211
|
+
const u = graph.unresolved[i];
|
|
212
|
+
ids.put(rekeyed(u.site.file, u.from), unresolved[0], i * FACTS_ID_WIDTH);
|
|
213
|
+
unresolved[1][i] = code(reasons, u.reason, 'reason');
|
|
214
|
+
// No nulls in facts@2: the empty string when the receiver is unknown.
|
|
215
|
+
unresolved[2][i] = u.receiver ?? '';
|
|
216
|
+
unresolved[3][i] = u.methodName;
|
|
217
|
+
unresolved[4][i] = relLine(u.site, u.from);
|
|
218
|
+
unresolved[5][i] = u.site.col;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// ref
|
|
222
|
+
const ref = allocTable(R.ref, graph.references.length);
|
|
223
|
+
for (let i = 0; i < graph.references.length; i++) {
|
|
224
|
+
const r = graph.references[i];
|
|
225
|
+
ids.put(rekeyed(r.site.file, r.from), ref[0], i * FACTS_ID_WIDTH);
|
|
226
|
+
ids.put(r.to, ref[1], i * FACTS_ID_WIDTH);
|
|
227
|
+
ref[2][i] = relLine(r.site, r.from);
|
|
228
|
+
ref[3][i] = r.site.col;
|
|
229
|
+
}
|
|
230
|
+
// registration — `from` as the engine gives it (Java), else the innermost declaration enclosing the site.
|
|
231
|
+
// A name a registering file gives (`manifest-unresolved` at a site in a manifest or descriptor, not a
|
|
232
|
+
// source file of the graph) has no enclosing body to key it by: it stays in the graph's
|
|
233
|
+
// `unresolvedRegistrations` and is not a `registration` row.
|
|
234
|
+
const regs = graph.unresolvedRegistrations.filter(r => r.reason !== 'manifest-unresolved' || graphFiles.has(r.site.file));
|
|
235
|
+
const registration = allocTable(R.registration, regs.length);
|
|
236
|
+
{
|
|
237
|
+
const reasons = dict(R.registration, 'reason');
|
|
238
|
+
const locators = new Map();
|
|
239
|
+
const owner = (site) => {
|
|
240
|
+
const f = graphFiles.get(site.file);
|
|
241
|
+
if (!f)
|
|
242
|
+
throw new Error(`${FACTS2_SCHEME}: a registration in ${site.file}, which is not in the graph`);
|
|
243
|
+
let at = locators.get(site.file);
|
|
244
|
+
if (!at)
|
|
245
|
+
locators.set(site.file, (at = declLocator(f)));
|
|
246
|
+
return (at(site.line, site.col) ?? f.decls[0]).id;
|
|
247
|
+
};
|
|
248
|
+
for (let i = 0; i < regs.length; i++) {
|
|
249
|
+
const reg = regs[i];
|
|
250
|
+
const from = reg.from ?? owner(reg.site);
|
|
251
|
+
ids.put(rekeyed(reg.site.file, from), registration[0], i * FACTS_ID_WIDTH);
|
|
252
|
+
registration[1][i] = code(reasons, reg.reason, 'reason');
|
|
253
|
+
registration[2][i] = reg.evidence;
|
|
254
|
+
registration[3][i] = relLine(reg.site, from);
|
|
255
|
+
registration[4][i] = reg.site.col;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
// flow — def-use edges on fixed-width node ids, as in facts@1.
|
|
259
|
+
const flowCapacity = orderedFiles.reduce((n, f) => n + (byPath.get(f.file).dfg?.uses.length ?? 0), 0);
|
|
260
|
+
const flow = allocTable(R.flow, flowCapacity);
|
|
261
|
+
let flowCount = 0;
|
|
262
|
+
if (flowCapacity > 0) {
|
|
263
|
+
const defUse = code(dict(R.flow, 'kind'), 'def-use', 'kind');
|
|
264
|
+
const writer = new NodeIdWriter();
|
|
265
|
+
const from = flow[0];
|
|
266
|
+
const to = flow[1];
|
|
267
|
+
const kinds = flow[2];
|
|
268
|
+
for (const f of orderedFiles) {
|
|
269
|
+
const dfg = byPath.get(f.file).dfg;
|
|
270
|
+
if (!dfg || dfg.uses.length === 0)
|
|
271
|
+
continue;
|
|
272
|
+
const fileRekey = rekey.get(f.file);
|
|
273
|
+
const bodyId = (d) => {
|
|
274
|
+
const r = fileRekey?.get(d.id);
|
|
275
|
+
return r ? `${r.id}.${d.body_hash}` : d.body_id;
|
|
276
|
+
};
|
|
277
|
+
const defs = locateNodes(f, dfg.defs, (d, at) => at(d.line, d.column));
|
|
278
|
+
const defIds = new Uint8Array(defs.length * FACTS_ID_WIDTH);
|
|
279
|
+
const defAt = new Map();
|
|
280
|
+
for (let i = 0; i < defs.length; i++) {
|
|
281
|
+
const n = defs[i];
|
|
282
|
+
if (n === null)
|
|
283
|
+
continue;
|
|
284
|
+
writer.forBody(bodyId(n.decl), 'def');
|
|
285
|
+
writer.write(n.ordinal, defIds, i * FACTS_ID_WIDTH);
|
|
286
|
+
defAt.set(dfg.defs[i].id, i * FACTS_ID_WIDTH);
|
|
287
|
+
}
|
|
288
|
+
const uses = locateNodes(f, dfg.uses, (u, at) => at(u.line, u.column));
|
|
289
|
+
for (let i = 0; i < uses.length; i++) {
|
|
290
|
+
const n = uses[i];
|
|
291
|
+
const u = dfg.uses[i];
|
|
292
|
+
if (n === null || u.def_id === null)
|
|
293
|
+
continue;
|
|
294
|
+
const d = defAt.get(u.def_id);
|
|
295
|
+
if (d === undefined)
|
|
296
|
+
continue;
|
|
297
|
+
const o = flowCount * FACTS_ID_WIDTH;
|
|
298
|
+
for (let k = 0; k < FACTS_ID_WIDTH; k++)
|
|
299
|
+
from[o + k] = defIds[d + k];
|
|
300
|
+
writer.forBody(bodyId(n.decl), 'use');
|
|
301
|
+
writer.write(n.ordinal, to, o);
|
|
302
|
+
kinds[flowCount] = defUse;
|
|
303
|
+
flowCount++;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
// imports
|
|
308
|
+
const importCount = paths.reduce((n, p) => n + byPath.get(p).imports.length, 0);
|
|
309
|
+
const imports = allocTable(R.imports, importCount);
|
|
310
|
+
{
|
|
311
|
+
let i = 0;
|
|
312
|
+
for (const p of paths) {
|
|
313
|
+
const file = keys.get(p);
|
|
314
|
+
for (const imp of byPath.get(p).imports) {
|
|
315
|
+
imports[0].set(file, i * FACTS_ID_WIDTH);
|
|
316
|
+
imports[1][i] = imp.target;
|
|
317
|
+
imports[2][i] = imp.wildcard ? 1 : 0;
|
|
318
|
+
i++;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// entries
|
|
323
|
+
const entries = allocTable(R.entries, graph.entries.length);
|
|
324
|
+
{
|
|
325
|
+
const kinds = dict(R.entries, 'kind');
|
|
326
|
+
const certainties = dict(R.entries, 'certainty');
|
|
327
|
+
for (let i = 0; i < graph.entries.length; i++) {
|
|
328
|
+
const e = graph.entries[i];
|
|
329
|
+
ids.put(e.id, entries[0], i * FACTS_ID_WIDTH);
|
|
330
|
+
entries[1][i] = code(kinds, factsEntryKind(e.kind), 'kind');
|
|
331
|
+
entries[2][i] = e.evidence;
|
|
332
|
+
entries[3][i] = code(certainties, e.certainty, 'certainty');
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const raw = {
|
|
336
|
+
files: { columns: files, length: paths.length },
|
|
337
|
+
decl: { columns: decl, length: declCount },
|
|
338
|
+
decl_pos: { columns: declPos, length: declCount },
|
|
339
|
+
call: { columns: call, length: graph.edges.length },
|
|
340
|
+
unresolved: { columns: unresolved, length: graph.unresolved.length },
|
|
341
|
+
ref: { columns: ref, length: graph.references.length },
|
|
342
|
+
registration: { columns: registration, length: regs.length },
|
|
343
|
+
parse_error: { columns: parseError, length: partialCount },
|
|
344
|
+
flow: { columns: flow, length: flowCount },
|
|
345
|
+
imports: { columns: imports, length: importCount },
|
|
346
|
+
entries: { columns: entries, length: graph.entries.length },
|
|
347
|
+
moved: { columns: allocTable(R.moved, 0), length: 0 },
|
|
348
|
+
};
|
|
349
|
+
const relations = {};
|
|
350
|
+
const duplicatesDropped = {};
|
|
351
|
+
for (const name of FACTS2_RELATION_NAMES) {
|
|
352
|
+
const { table, duplicatesDropped: dropped } = canonicalTable(R[name], raw[name].columns, raw[name].length);
|
|
353
|
+
relations[name] = table;
|
|
354
|
+
duplicatesDropped[name] = dropped;
|
|
355
|
+
}
|
|
356
|
+
// Two paths with one key (a 128-bit collision) must fail, never merge.
|
|
357
|
+
if (keyCollisions(R.files, relations.files) > 0)
|
|
358
|
+
throw new Error(`${FACTS2_SCHEME}: two paths share a file key`);
|
|
359
|
+
return { relations, duplicatesDropped };
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The `facts@2` relations of a `java-graph@0.1` graph. Every file the graph
|
|
363
|
+
* holds must be in `inputs`; an input the graph does not hold is written as a
|
|
364
|
+
* Java file with no declarations.
|
|
365
|
+
*/
|
|
366
|
+
export function javaGraphFact2Set(graph, inputs) {
|
|
367
|
+
return graphFact2Set(graph, inputs, { loads: graph.loads, language: 'java' });
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* The `facts@2` relations of a `ts-call-edges@0.1` graph (TypeScript and
|
|
371
|
+
* JavaScript). Every file the graph holds must be in `inputs`, and every
|
|
372
|
+
* input must be a file of the graph. The TypeScript-only edges (field uses,
|
|
373
|
+
* module imports and loads) have no relation in `facts@2`; `imports` holds
|
|
374
|
+
* whatever the inputs list.
|
|
375
|
+
*/
|
|
376
|
+
export function tsGraphFact2Set(graph, inputs) {
|
|
377
|
+
return graphFact2Set(graph, inputs, {});
|
|
378
|
+
}
|
|
379
|
+
//# sourceMappingURL=facts2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts2.js","sourceRoot":"","sources":["../../src/facts/facts2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAsC,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,EAA2B,MAAM,cAAc,CAAC;AACxH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAuC,MAAM,YAAY,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,cAAc,EAAuB,MAAM,iBAAiB,CAAC;AA8BnF;;;;;;GAMG;AACH,MAAM,cAAc,GAAG,IAAI,OAAO,EAAU,CAAC;AAE7C,uFAAuF;AACvF,MAAM,UAAU,iBAAiB,CAAC,IAAc;IAC9C,cAAc,CAAC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AAM,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAkB,EAAE,MAA8B;IAChF,OAAO,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `facts@1` and `facts@2`: the fact relations as columns in canonical order
|
|
3
|
+
* (sets, no nulls), keyed by `ids@0.1`, and their Arrow IPC wire form.
|
|
4
|
+
* Opt-in — see `JavaGraphOptions.emitFacts`; `facts@1` is the default scheme,
|
|
5
|
+
* `facts@2` is chosen with `JavaGraphOptions.factsScheme`.
|
|
6
|
+
*/
|
|
7
|
+
export { FACTS_SCHEME, FACTS_ID_WIDTH, FACTS_CHUNK_ROWS, FACTS_RELATION_NAMES, FACTS_RELATIONS, FACTS_LANGUAGES, FACTS_DECL_KINDS, FACTS_TIERS, FACTS_UNRESOLVED_REASONS, FACTS_FLOW_KINDS, FACTS_ENTRY_KINDS, FACTS_ENTRY_CERTAINTIES, FACTS_MOVE_KINDS, sortColumns, } from './schema.js';
|
|
8
|
+
export type { FactsScheme, FactsColumnType, FactsColumn, FactsRelation, FactsRelationName, FactValue, FactRow, FactRows } from './schema.js';
|
|
9
|
+
export { compareBytes, compareCodePoints, compareValues, rowComparator, canonicalRows, canonicalSet, idBytes } from './order.js';
|
|
10
|
+
export { IdDecoder, allocColumn, allocTable, dictIndex, idBytesInto, compareStrings, tableComparator, canonicalTable, keyCollisions, tableRow, tableRows, tableFromRows } from './table.js';
|
|
11
|
+
export type { FactColumnData, FactTable } from './table.js';
|
|
12
|
+
export { javaGraphFacts, javaGraphFactSet, contentHash, factsEntryKind } from './java-facts.js';
|
|
13
|
+
export type { JavaImportRow, JavaFactsInput, FactSet } from './java-facts.js';
|
|
14
|
+
export { factsToArrow, relationToArrowIpc, facts2ToArrow, relation2ToArrowIpc, loadArrow, hex } from './arrow.js';
|
|
15
|
+
export type { FactsArrow, FactsArrowOptions, FactsManifest, FactsManifestRelation, Facts2Arrow, Facts2Manifest } from './arrow.js';
|
|
16
|
+
export { FACTS2_SCHEME, FACTS2_RELATION_NAMES, FACTS2_RELATIONS, FACTS2_STORE_ONLY, FACTS_REGISTRATION_REASONS, FACTS_FILE_KEY_PARTS, fileKey, } from './schema2.js';
|
|
17
|
+
export type { Facts2Scheme, Facts2Relation, Facts2RelationName, Fact2Rows } from './schema2.js';
|
|
18
|
+
export { javaGraphFact2Set, tsGraphFact2Set } from './facts2.js';
|
|
19
|
+
export type { Fact2Set, Facts2Graph, Facts2Input } from './facts2.js';
|
|
20
|
+
export { T6Graph, t6RowsFromArrow } from './t6.js';
|
|
21
|
+
export type { T6Rows, T6Tier, T6EdgeCounts } from './t6.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/facts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC7I,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACjI,OAAO,EAAE,SAAS,EAAE,WAAW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
|
|
4
|
+
* Opt-in — see `JavaGraphOptions.emitFacts`; `facts@1` is the default scheme,
|
|
5
|
+
* `facts@2` is chosen with `JavaGraphOptions.factsScheme`.
|
|
6
|
+
*/
|
|
7
|
+
export { FACTS_SCHEME, FACTS_ID_WIDTH, FACTS_CHUNK_ROWS, FACTS_RELATION_NAMES, FACTS_RELATIONS, FACTS_LANGUAGES, FACTS_DECL_KINDS, FACTS_TIERS, FACTS_UNRESOLVED_REASONS, FACTS_FLOW_KINDS, FACTS_ENTRY_KINDS, FACTS_ENTRY_CERTAINTIES, FACTS_MOVE_KINDS, sortColumns, } from './schema.js';
|
|
8
|
+
export { compareBytes, compareCodePoints, compareValues, rowComparator, canonicalRows, canonicalSet, idBytes } from './order.js';
|
|
9
|
+
export { IdDecoder, allocColumn, allocTable, dictIndex, idBytesInto, compareStrings, tableComparator, canonicalTable, keyCollisions, tableRow, tableRows, tableFromRows } from './table.js';
|
|
10
|
+
export { javaGraphFacts, javaGraphFactSet, contentHash, factsEntryKind } from './java-facts.js';
|
|
11
|
+
export { factsToArrow, relationToArrowIpc, facts2ToArrow, relation2ToArrowIpc, loadArrow, hex } from './arrow.js';
|
|
12
|
+
export { FACTS2_SCHEME, FACTS2_RELATION_NAMES, FACTS2_RELATIONS, FACTS2_STORE_ONLY, FACTS_REGISTRATION_REASONS, FACTS_FILE_KEY_PARTS, fileKey, } from './schema2.js';
|
|
13
|
+
export { javaGraphFact2Set, tsGraphFact2Set } from './facts2.js';
|
|
14
|
+
export { T6Graph, t6RowsFromArrow } from './t6.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/facts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACjI,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE5L,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEhG,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAElH,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,OAAO,GACR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `facts@1` rows from a `java-graph@0.1` graph: a post-pass over today's
|
|
3
|
+
* structures (graph-store plan T2, first half). The graph is a view of the
|
|
4
|
+
* same facts, so every count here equals one of the graph's *before* the set
|
|
5
|
+
* dedupe: `decl` rows = declarations over `files`, `call` = `edges`,
|
|
6
|
+
* `unresolved` = `unresolved`, `entries` = `entries`, `files` = `files`,
|
|
7
|
+
* `imports` = the files' import declarations, `flow` = the DFG uses with a
|
|
8
|
+
* reaching definition; the manifest's `duplicates_dropped` is the
|
|
9
|
+
* difference. `moved` is empty from one snapshot (see `schemas/facts@1.json`).
|
|
10
|
+
*
|
|
11
|
+
* `flow` rows are keyed by `ids@0.1` node ids in their fixed-width form
|
|
12
|
+
* (`nodeIdBytes`): each DFG def and use is placed in the innermost
|
|
13
|
+
* declaration body enclosing it and numbered there (`locateNodes`), so an
|
|
14
|
+
* edit to one method leaves every other method's flow rows unchanged.
|
|
15
|
+
*
|
|
16
|
+
* Built as columns, never as row objects: each relation's typed arrays are
|
|
17
|
+
* filled straight from the graph, then `canonicalTable` sorts one index
|
|
18
|
+
* permutation, drops duplicates and gathers.
|
|
19
|
+
*/
|
|
20
|
+
import type { JavaGraph } from '../navigation/java-graph.js';
|
|
21
|
+
import type { DFG } from '../types/index.js';
|
|
22
|
+
import { type FactsRelationName } from './schema.js';
|
|
23
|
+
import { type FactTable } from './table.js';
|
|
24
|
+
/** One import declaration of a Java file, as the `imports` relation records it. */
|
|
25
|
+
export interface JavaImportRow {
|
|
26
|
+
/** The imported name without a trailing `.*` (a static import's member path for `import static`). */
|
|
27
|
+
target: string;
|
|
28
|
+
wildcard: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface JavaFactsInput {
|
|
31
|
+
/** Repository-relative path and the source it was analysed from. */
|
|
32
|
+
path: string;
|
|
33
|
+
code: string;
|
|
34
|
+
imports: readonly JavaImportRow[];
|
|
35
|
+
/** The file's DFG (`analyze(...).dfg`); its def-use pairs become `flow` rows. Absent: the file adds no `flow` row. */
|
|
36
|
+
dfg?: Pick<DFG, 'defs' | 'uses'>;
|
|
37
|
+
}
|
|
38
|
+
/** The eight relations in canonical form (sorted sets) with what the dedupe dropped from each. */
|
|
39
|
+
export interface FactSet {
|
|
40
|
+
relations: Readonly<Record<FactsRelationName, FactTable>>;
|
|
41
|
+
duplicatesDropped: Readonly<Record<FactsRelationName, number>>;
|
|
42
|
+
}
|
|
43
|
+
/** blake3 of the UTF-8 bytes, first 16. */
|
|
44
|
+
export declare function contentHash(code: string): Uint8Array;
|
|
45
|
+
/** The engine's `entry-index@0.1` kind as the `facts@1` vocabulary writes it: `bean` is `di`. */
|
|
46
|
+
export declare function factsEntryKind(kind: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* The eight relations, each a canonical set, with the dedupe counts
|
|
49
|
+
* (`FactSet`). `inputs` must cover every file of the graph (a file the graph
|
|
50
|
+
* names but the inputs do not is an error, never a silent gap). File ids are
|
|
51
|
+
* the 0-based positions in the code-point-sorted path list.
|
|
52
|
+
*/
|
|
53
|
+
export declare function javaGraphFactSet(graph: JavaGraph, inputs: readonly JavaFactsInput[]): FactSet;
|
|
54
|
+
/** The eight relations as canonical sets (`javaGraphFactSet` without the dedupe counts). */
|
|
55
|
+
export declare function javaGraphFacts(graph: JavaGraph, inputs: readonly JavaFactsInput[]): Readonly<Record<FactsRelationName, FactTable>>;
|
|
56
|
+
//# sourceMappingURL=java-facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-facts.d.ts","sourceRoot":"","sources":["../../src/facts/java-facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAI7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAyE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnH,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,qGAAqG;IACrG,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,sHAAsH;IACtH,GAAG,CAAC,EAAE,IAAI,CAA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