@seanhogg/builderforce-memory 2026.10.67 → 2026.10.69
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/knowledge/build.d.ts.map +1 -1
- package/dist/knowledge/build.js +7 -2
- package/dist/knowledge/build.js.map +1 -1
- package/dist/knowledge/comparability.d.ts +100 -0
- package/dist/knowledge/comparability.d.ts.map +1 -0
- package/dist/knowledge/comparability.js +149 -0
- package/dist/knowledge/comparability.js.map +1 -0
- package/dist/knowledge/contentHash.d.ts +28 -0
- package/dist/knowledge/contentHash.d.ts.map +1 -0
- package/dist/knowledge/contentHash.js +54 -0
- package/dist/knowledge/contentHash.js.map +1 -0
- package/dist/knowledge/extractFile.d.ts +2 -0
- package/dist/knowledge/extractFile.d.ts.map +1 -1
- package/dist/knowledge/extractFile.js +1 -1
- package/dist/knowledge/extractFile.js.map +1 -1
- package/dist/knowledge/extractJob.d.ts +5 -2
- package/dist/knowledge/extractJob.d.ts.map +1 -1
- package/dist/knowledge/extractJob.js +1 -1
- package/dist/knowledge/extractJob.js.map +1 -1
- package/dist/knowledge/findingBuilder.d.ts +12 -2
- package/dist/knowledge/findingBuilder.d.ts.map +1 -1
- package/dist/knowledge/findingBuilder.js +9 -2
- package/dist/knowledge/findingBuilder.js.map +1 -1
- package/dist/knowledge/findingIdentity.d.ts +52 -0
- package/dist/knowledge/findingIdentity.d.ts.map +1 -0
- package/dist/knowledge/findingIdentity.js +70 -0
- package/dist/knowledge/findingIdentity.js.map +1 -0
- package/dist/knowledge/findingModel.d.ts +30 -0
- package/dist/knowledge/findingModel.d.ts.map +1 -0
- package/dist/knowledge/findingModel.js +6 -0
- package/dist/knowledge/findingModel.js.map +1 -0
- package/dist/knowledge/findings.d.ts.map +1 -1
- package/dist/knowledge/findings.js +17 -9
- package/dist/knowledge/findings.js.map +1 -1
- package/dist/knowledge/godModule.js +2 -2
- package/dist/knowledge/godModule.js.map +1 -1
- package/dist/knowledge/index.d.ts +13 -1
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +8 -0
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/lineage.d.ts +35 -0
- package/dist/knowledge/lineage.d.ts.map +1 -0
- package/dist/knowledge/lineage.js +114 -0
- package/dist/knowledge/lineage.js.map +1 -0
- package/dist/knowledge/merkle.d.ts +65 -0
- package/dist/knowledge/merkle.d.ts.map +1 -0
- package/dist/knowledge/merkle.js +158 -0
- package/dist/knowledge/merkle.js.map +1 -0
- package/dist/knowledge/model.d.ts +20 -17
- package/dist/knowledge/model.d.ts.map +1 -1
- package/dist/knowledge/owedFiles.d.ts +5 -2
- package/dist/knowledge/owedFiles.d.ts.map +1 -1
- package/dist/knowledge/owedFiles.js +20 -5
- package/dist/knowledge/owedFiles.js.map +1 -1
- package/dist/knowledge/pack/encode.d.ts +2 -1
- package/dist/knowledge/pack/encode.d.ts.map +1 -1
- package/dist/knowledge/pack/encode.js +2 -1
- package/dist/knowledge/pack/encode.js.map +1 -1
- package/dist/knowledge/pack/extrDiff.d.ts.map +1 -1
- package/dist/knowledge/pack/extrDiff.js +4 -1
- package/dist/knowledge/pack/extrDiff.js.map +1 -1
- package/dist/knowledge/pack/sections/columns.d.ts +15 -2
- package/dist/knowledge/pack/sections/columns.d.ts.map +1 -1
- package/dist/knowledge/pack/sections/columns.js +16 -1
- package/dist/knowledge/pack/sections/columns.js.map +1 -1
- package/dist/knowledge/pack/sections/extrLists.js +2 -2
- package/dist/knowledge/pack/sections/extrLists.js.map +1 -1
- package/dist/knowledge/pack/sections/facts.d.ts.map +1 -1
- package/dist/knowledge/pack/sections/facts.js +2 -2
- package/dist/knowledge/pack/sections/facts.js.map +1 -1
- package/dist/knowledge/pack/sections/index.d.ts +1 -0
- package/dist/knowledge/pack/sections/index.d.ts.map +1 -1
- package/dist/knowledge/pack/sections/index.js +3 -1
- package/dist/knowledge/pack/sections/index.js.map +1 -1
- package/dist/knowledge/pack/sections/rows.d.ts +1 -0
- package/dist/knowledge/pack/sections/rows.d.ts.map +1 -1
- package/dist/knowledge/pack/sections/rows.js +1 -1
- package/dist/knowledge/pack/sections/rows.js.map +1 -1
- package/dist/knowledge/pack/sections/sites.d.ts +24 -0
- package/dist/knowledge/pack/sections/sites.d.ts.map +1 -0
- package/dist/knowledge/pack/sections/sites.js +96 -0
- package/dist/knowledge/pack/sections/sites.js.map +1 -0
- package/dist/knowledge/pack/types.d.ts +2 -2
- package/dist/knowledge/pack/types.d.ts.map +1 -1
- package/dist/knowledge/plan.d.ts +8 -0
- package/dist/knowledge/plan.d.ts.map +1 -1
- package/dist/knowledge/plan.js +20 -6
- package/dist/knowledge/plan.js.map +1 -1
- package/dist/knowledge/refs.d.ts +4 -0
- package/dist/knowledge/refs.d.ts.map +1 -1
- package/dist/knowledge/refs.js +8 -0
- package/dist/knowledge/refs.js.map +1 -1
- package/dist/knowledge/resolve.d.ts.map +1 -1
- package/dist/knowledge/resolve.js +2 -0
- package/dist/knowledge/resolve.js.map +1 -1
- package/dist/knowledge/reviewModel.d.ts +8 -1
- package/dist/knowledge/reviewModel.d.ts.map +1 -1
- package/dist/knowledge/reviewPrefetch.d.ts +2 -1
- package/dist/knowledge/reviewPrefetch.d.ts.map +1 -1
- package/dist/knowledge/reviewPrefetch.js +8 -4
- package/dist/knowledge/reviewPrefetch.js.map +1 -1
- package/dist/knowledge/sources.d.ts +11 -2
- package/dist/knowledge/sources.d.ts.map +1 -1
- package/dist/knowledge/sources.js +19 -3
- package/dist/knowledge/sources.js.map +1 -1
- package/dist/knowledge/symbolEdges.d.ts +39 -0
- package/dist/knowledge/symbolEdges.d.ts.map +1 -0
- package/dist/knowledge/symbolEdges.js +71 -0
- package/dist/knowledge/symbolEdges.js.map +1 -0
- package/dist/knowledge/truncate.d.ts.map +1 -1
- package/dist/knowledge/truncate.js +4 -0
- package/dist/knowledge/truncate.js.map +1 -1
- package/package.json +1 -1
- package/src/contract/exports.snapshot.json +34 -0
- package/src/contract/regression.contentHash.test.ts +30 -0
- package/src/contract/regression.lineage.test.ts +27 -0
- package/src/contract/regression.listing.test.ts +85 -0
- package/src/contract/regression.symbolEdges.test.ts +323 -0
- package/src/contract/symbolEdges.golden.json +345 -0
- package/src/contract/types.contract.test.ts +68 -1
- package/src/knowledge/build.ts +7 -2
- package/src/knowledge/comparability.analysis.test.ts +73 -0
- package/src/knowledge/comparability.test.ts +44 -0
- package/src/knowledge/comparability.ts +182 -0
- package/src/knowledge/contentHash.test.ts +81 -0
- package/src/knowledge/contentHash.ts +55 -0
- package/src/knowledge/extractFile.ts +4 -2
- package/src/knowledge/extractJob.ts +5 -3
- package/src/knowledge/findingBuilder.ts +17 -2
- package/src/knowledge/findingIdentity.test.ts +102 -0
- package/src/knowledge/findingIdentity.ts +92 -0
- package/src/knowledge/findingModel.ts +32 -0
- package/src/knowledge/findings.ts +17 -9
- package/src/knowledge/godModule.ts +2 -2
- package/src/knowledge/index.ts +22 -1
- package/src/knowledge/lineage.test.ts +106 -0
- package/src/knowledge/lineage.ts +123 -0
- package/src/knowledge/merkle.test.ts +137 -0
- package/src/knowledge/merkle.ts +164 -0
- package/src/knowledge/model.ts +22 -19
- package/src/knowledge/owedFiles.contentHash.test.ts +58 -0
- package/src/knowledge/owedFiles.ts +23 -5
- package/src/knowledge/pack/encode.ts +2 -1
- package/src/knowledge/pack/extrDiff.ts +4 -1
- package/src/knowledge/pack/sections/columns.ts +16 -1
- package/src/knowledge/pack/sections/extrLists.ts +2 -2
- package/src/knowledge/pack/sections/facts.ts +2 -2
- package/src/knowledge/pack/sections/index.ts +3 -1
- package/src/knowledge/pack/sections/rows.ts +1 -1
- package/src/knowledge/pack/sections/sites.ts +87 -0
- package/src/knowledge/pack/types.ts +2 -2
- package/src/knowledge/plan.ts +28 -6
- package/src/knowledge/refs.ts +10 -0
- package/src/knowledge/resolve.ts +2 -0
- package/src/knowledge/reviewModel.ts +8 -1
- package/src/knowledge/reviewPrefetch.ts +10 -6
- package/src/knowledge/sources.ts +22 -3
- package/src/knowledge/symbolEdges.ts +72 -0
- package/src/knowledge/truncate.ts +3 -1
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* src/contract/regression.symbolEdges.test.ts — the symbol-level edge kinds (PRD 43 P0b): `extends`, `implements`,
|
|
3
|
+
* `composes`, `uses`, `calls` (with call sites). One `regression:` test per kind, the pack round trip, and the
|
|
4
|
+
* compatibility proof in both directions:
|
|
5
|
+
*
|
|
6
|
+
* - BACKWARD: a pack written before this change (edge kinds as the 11 legacy codes, no SITE section) decodes to the
|
|
7
|
+
* same pack, and re-encodes to the same bytes;
|
|
8
|
+
* - FORWARD: a pack written now decodes under a reader of before this change — the new kinds are written as strings
|
|
9
|
+
* (never as codes 12+ that reader refuses) and the SITE section is a new tag that reader skips.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { readFileSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { readFrame, writeFrame, writeSection } from '../knowledge/pack/frame.js';
|
|
15
|
+
import { TAG } from '../knowledge/pack/sections/index.js';
|
|
16
|
+
import { EDGE_KINDS, WRITTEN_EDGE_KINDS } from '../knowledge/pack/sections/columns.js';
|
|
17
|
+
import { writeKeys, writeNodes } from '../knowledge/pack/sections/extrLists.js';
|
|
18
|
+
import { collector, readStringTable, tablesOf, writeHashTable, writeStringTable, type Tables } from '../knowledge/pack/strings.js';
|
|
19
|
+
import { ByteReader, ByteWriter } from '../knowledge/pack/varint.js';
|
|
20
|
+
import { applyEntryDiff, decodePack, diffEntry, encodePack, ZERO_DIGEST, type Pack } from '../knowledge/pack/index.js';
|
|
21
|
+
import { buildGraph, truncateGraph, dedupeSymbolEdges, SYMBOL_EDGE_KINDS, type CallSite, type Extracted, type KEdge, type NodeRef } from '../knowledge/index.js';
|
|
22
|
+
|
|
23
|
+
const H1 = 'a'.repeat(64), H2 = 'b'.repeat(64);
|
|
24
|
+
const HEAD = { rootId: 'r', baseGeneration: 0, targetDigest: ZERO_DIGEST };
|
|
25
|
+
const FILE = 'src:r::src/a.ts' as NodeRef;
|
|
26
|
+
const sym = (name: string, line: number, path = 'src/a.ts') => `src:r::${path}#${name}@${line}` as NodeRef;
|
|
27
|
+
const site = (line: number, column: number, order: number, path = 'src/a.ts'): CallSite => ({ path, line, column, order });
|
|
28
|
+
|
|
29
|
+
/** The 11 kinds a reader of before 2026-11-10 knows as codes (index + 1); a higher code makes it throw. */
|
|
30
|
+
const LEGACY_EDGE_KINDS = [
|
|
31
|
+
'references', 'links', 'contains', 'mentions', 'duplicate', 'near-duplicate', 'contradicts', 'agrees', 'supersedes', 'about', 'co-changed',
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
function extraction(edges: KEdge[]): Extracted {
|
|
35
|
+
return {
|
|
36
|
+
sourceRef: FILE, sourceHash: H1,
|
|
37
|
+
nodes: [{ ref: FILE, kind: 'file', label: 'a.ts', pack: 'code', importance: 0.5, origin: 'extracted', sourceHash: H1 }],
|
|
38
|
+
edges, keys: [{ ref: FILE, key: 'a.ts' }],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const packOf = (edges: KEdge[]): Pack => ({ ...HEAD, extracted: [{ kind: 'full', hash: H1, entries: [extraction(edges)] }] });
|
|
42
|
+
const edge = (from: NodeRef, to: NodeRef, kind: string, sites?: CallSite[]): KEdge =>
|
|
43
|
+
({ from, to, kind, weight: 1, origin: 'extracted', ...(sites ? { sites } : {}) });
|
|
44
|
+
|
|
45
|
+
async function sectionsOf(bytes: Uint8Array): Promise<Map<number, Uint8Array>> {
|
|
46
|
+
const { stored } = readFrame(bytes);
|
|
47
|
+
const r = new ByteReader(stored);
|
|
48
|
+
const out = new Map<number, Uint8Array>();
|
|
49
|
+
while (!r.done) { const tag = r.u8(); out.set(tag, r.bytes(r.varint())); }
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
const stringsOf = (sections: Map<number, Uint8Array>): string[] => readStringTable(sections.get(TAG.STR)!, 1e5, 1e7);
|
|
53
|
+
|
|
54
|
+
async function roundTrip(pack: Pack): Promise<Pack> {
|
|
55
|
+
return decodePack(await encodePack(pack));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
describe('regression: symbol-level edge kinds', () => {
|
|
59
|
+
it('regression: an `extends` edge (class → its base) survives the pack and is written as a string an older reader decodes', async () => {
|
|
60
|
+
const e = edge(sym('Repo', 3), sym('BaseRepo', 1, 'src/base.ts'), 'extends');
|
|
61
|
+
const back = await roundTrip(packOf([e]));
|
|
62
|
+
expect((back.extracted![0]!.entries[0] as Extracted).edges).toEqual([e]);
|
|
63
|
+
expect(stringsOf(await sectionsOf(await encodePack(packOf([e]), { deflate: false })))).toContain('extends');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('regression: an `implements` edge (class → interface) survives the pack', async () => {
|
|
67
|
+
const e = edge(sym('Repo', 3), sym('Store', 1, 'src/store.ts'), 'implements');
|
|
68
|
+
expect(((await roundTrip(packOf([e]))).extracted![0]!.entries[0] as Extracted).edges).toEqual([e]);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('regression: a `composes` edge (class → the class of a field) survives the pack', async () => {
|
|
72
|
+
const e = edge(sym('Service', 5), sym('Repo', 3), 'composes');
|
|
73
|
+
expect(((await roundTrip(packOf([e]))).extracted![0]!.entries[0] as Extracted).edges).toEqual([e]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('regression: a `uses` edge (symbol → a type it names) survives the pack', async () => {
|
|
77
|
+
const e = edge(sym('Service.load', 9), sym('Row', 1, 'src/types.ts'), 'uses');
|
|
78
|
+
expect(((await roundTrip(packOf([e]))).extracted![0]!.entries[0] as Extracted).edges).toEqual([e]);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('regression: a `calls` edge keeps EVERY call site — repeats included — with path, line, column and order', async () => {
|
|
82
|
+
const sites = [site(10, 5, 0), site(12, 9, 2), site(14, 9, 3)];
|
|
83
|
+
const other = [site(11, 5, 1)];
|
|
84
|
+
const edges = [
|
|
85
|
+
edge(sym('Service.load', 9), sym('Repo.get', 4), 'calls', sites),
|
|
86
|
+
edge(sym('Service.load', 9), sym('missing', 0, 'node_modules/zod'), 'calls', other),
|
|
87
|
+
edge(sym('Service.load', 9), sym('Row', 1, 'src/types.ts'), 'uses'),
|
|
88
|
+
];
|
|
89
|
+
const back = (await roundTrip(packOf(edges))).extracted![0]!.entries[0] as Extracted;
|
|
90
|
+
expect(back.edges).toEqual(edges);
|
|
91
|
+
// The caller's calls in source order: the order index interleaves the two callees.
|
|
92
|
+
const ordered = back.edges.flatMap((e) => (e.sites ?? []).map((s) => [s.order, e.to] as const)).sort((a, b) => a[0] - b[0]);
|
|
93
|
+
expect(ordered.map(([o]) => o)).toEqual([0, 1, 2, 3]);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe('symbol edges: pack round trip', () => {
|
|
98
|
+
const edges = SYMBOL_EDGE_KINDS.map((kind, i) => edge(sym(`S${i}`, i + 1), sym(`T${i}`, 1, 'src/t.ts'), kind, kind === 'calls' ? [site(3, 1, 0), site(4, 7, 1)] : undefined));
|
|
99
|
+
|
|
100
|
+
it('encode → decode keeps every new kind and the call sites, deflated or plain, and re-encodes to the same bytes', async () => {
|
|
101
|
+
const pack = packOf([edge(FILE, 'src:r::src/t.ts' as NodeRef, 'references'), ...edges]);
|
|
102
|
+
for (const deflate of [true, false]) {
|
|
103
|
+
const bytes = await encodePack(pack, { deflate });
|
|
104
|
+
const back = await decodePack(bytes);
|
|
105
|
+
expect((back.extracted![0]!.entries[0] as Extracted).edges).toEqual(pack.extracted![0]!.entries[0]!.edges);
|
|
106
|
+
expect(Buffer.from(await encodePack(back, { deflate })).equals(Buffer.from(bytes))).toBe(true);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('a diff entry carries the sites of the edges it adds', async () => {
|
|
111
|
+
const prior = extraction(edges.slice(0, 2));
|
|
112
|
+
const next: Extracted = { ...extraction([...edges.slice(0, 2), edge(sym('S9', 9), sym('T9', 2), 'calls', [site(9, 3, 0)])]), sourceHash: H2 };
|
|
113
|
+
const diff = diffEntry(prior, next)!;
|
|
114
|
+
const pack: Pack = { ...HEAD, extracted: [{ kind: 'full', hash: H1, entries: [prior] }, { kind: 'diff', hash: H2, prior: H1, entries: [diff] }] };
|
|
115
|
+
const back = await roundTrip(pack);
|
|
116
|
+
const backDiff = back.extracted!.find((x) => x.kind === 'diff')!.entries[0]!;
|
|
117
|
+
expect(applyEntryDiff(prior, backDiff as never)).toEqual(applyEntryDiff(prior, diff));
|
|
118
|
+
expect(applyEntryDiff(prior, backDiff as never).edges.at(-1)!.sites).toEqual([site(9, 3, 0)]);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('regression: a malformed SITE section never rejects the pack — it decodes whole, without any sites', async () => {
|
|
122
|
+
const good = edge(sym('A', 1), sym('B', 2), 'calls', [site(1, 1, 0)]);
|
|
123
|
+
const other = edge(sym('A', 1), sym('C', 3), 'calls', [site(2, 1, 1)]);
|
|
124
|
+
const bytes = await encodePack(packOf([good, other]), { deflate: false });
|
|
125
|
+
const withSite = async (site: Uint8Array): Promise<Pack> => {
|
|
126
|
+
const sections = await sectionsOf(bytes);
|
|
127
|
+
sections.set(TAG.SITE, site);
|
|
128
|
+
const body = new ByteWriter();
|
|
129
|
+
for (const [tag, b] of sections) writeSection(body, tag, b);
|
|
130
|
+
const plain = body.finish();
|
|
131
|
+
return decodePack(writeFrame({ flags: 0, ...HEAD }, plain, plain));
|
|
132
|
+
};
|
|
133
|
+
const bad = (fill: (w: ByteWriter) => void): Uint8Array => { const w = new ByteWriter(); fill(w); return w.finish(); };
|
|
134
|
+
const variants = [
|
|
135
|
+
bad((w) => { w.varint(1); w.varint(0); w.varint(0); w.varint(7); w.varint(1); w.varint(0); w.varint(1); w.varint(1); w.varint(0); }), // no edge 7
|
|
136
|
+
// a VALID first group, then a repeat: nothing may be attached, not even the first
|
|
137
|
+
bad((w) => { w.varint(2); for (let g = 0; g < 2; g++) { w.varint(0); w.varint(0); w.varint(0); w.varint(1); w.varint(0); w.varint(1); w.varint(1); w.varint(0); } }),
|
|
138
|
+
bad((w) => { w.varint(1); w.varint(0); w.varint(0); w.varint(0); w.varint(0); }), // empty list
|
|
139
|
+
bad((w) => { w.varint(1); w.varint(0); w.varint(0); w.varint(0); w.varint(1); w.varint(99_999); w.varint(1); w.varint(1); w.varint(0); }), // bad STR index
|
|
140
|
+
bad((w) => { w.varint(5); }), // truncated
|
|
141
|
+
bad((w) => { w.varint(1); w.varint(0); w.varint(0); w.varint(0); w.varint(1); w.varint(0); w.varint(1); w.varint(1); w.varint(0); w.u8(7); }), // trailing byte
|
|
142
|
+
];
|
|
143
|
+
for (const v of variants) {
|
|
144
|
+
const back = await withSite(v);
|
|
145
|
+
expect((back.extracted![0]!.entries[0] as Extracted).edges).toEqual([good, other].map(({ sites: _, ...e }) => e));
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('regression: an invalid site is dropped on write instead of refusing the pack', async () => {
|
|
150
|
+
const e = edge(sym('A', 1), sym('B', 2), 'calls', [site(1, 1, 0), { path: 'src/a.ts', line: -1, column: 1, order: 1 }, { path: 'src/a.ts', line: 2, column: 1.5, order: 2 }]);
|
|
151
|
+
const back = await roundTrip(packOf([e]));
|
|
152
|
+
expect((back.extracted![0]!.entries[0] as Extracted).edges[0]!.sites).toEqual([site(1, 1, 0)]);
|
|
153
|
+
const allBad = edge(sym('A', 1), sym('B', 2), 'calls', [{ path: 'src/a.ts', line: Number.NaN, column: 1, order: 0 }]);
|
|
154
|
+
expect((((await roundTrip(packOf([allBad]))).extracted![0]!.entries[0]) as Extracted).edges[0]!.sites).toBeUndefined();
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('regression: a diff where only an edge\'s sites change carries the new sites (SITE in a diff entry)', async () => {
|
|
158
|
+
const before = edge(sym('A.run', 3), sym('B.get', 2), 'calls', [site(4, 5, 0)]);
|
|
159
|
+
const afterSites = [site(4, 5, 0), site(6, 9, 2)];
|
|
160
|
+
const prior = extraction([edge(sym('A', 1), sym('B', 1), 'extends'), before]);
|
|
161
|
+
const next: Extracted = { ...extraction([edge(sym('A', 1), sym('B', 1), 'extends'), { ...before, sites: afterSites }]), sourceHash: H2 };
|
|
162
|
+
const diff = diffEntry(prior, next)!;
|
|
163
|
+
expect(diff.edges.remove).toHaveLength(1);
|
|
164
|
+
expect(diff.edges.add.map((a) => a.item.sites)).toEqual([afterSites]);
|
|
165
|
+
const back = await roundTrip({ ...HEAD, extracted: [{ kind: 'full', hash: H1, entries: [prior] }, { kind: 'diff', hash: H2, prior: H1, entries: [diff] }] });
|
|
166
|
+
const backDiff = back.extracted!.find((x) => x.kind === 'diff')!.entries[0]!;
|
|
167
|
+
expect(applyEntryDiff(prior, backDiff as never).edges).toEqual(next.edges);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('regression: `sites: []` and absent `sites` are the same edge to diffEntry (no spurious remove/add)', () => {
|
|
171
|
+
const a = edge(sym('A', 1), sym('B', 2), 'calls');
|
|
172
|
+
const prior = extraction([{ ...a, sites: [] }]);
|
|
173
|
+
const next: Extracted = { ...extraction([a]), sourceHash: H2 };
|
|
174
|
+
const diff = diffEntry(prior, next)!;
|
|
175
|
+
expect(diff.edges).toEqual({ remove: [], add: [] });
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
describe('symbol edges: compatibility', () => {
|
|
180
|
+
it('the writer codes only the 11 legacy kinds; the reader knows the symbol kinds after them, append-only', () => {
|
|
181
|
+
expect(WRITTEN_EDGE_KINDS).toEqual(LEGACY_EDGE_KINDS);
|
|
182
|
+
expect(EDGE_KINDS.slice(0, 11)).toEqual(LEGACY_EDGE_KINDS);
|
|
183
|
+
expect(EDGE_KINDS.slice(11)).toEqual([...SYMBOL_EDGE_KINDS]);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('BACKWARD: a pack written before this change (legacy codes, no SITE section) decodes identically and re-encodes to its bytes', async () => {
|
|
187
|
+
const legacy = [edge(FILE, 'src:r::src/b.ts' as NodeRef, 'references'), edge(FILE, 'src:r::src/c.ts' as NodeRef, 'co-changed'), edge(FILE, 'src:r::x' as NodeRef, 'custom-kind')];
|
|
188
|
+
const x = extraction(legacy);
|
|
189
|
+
// EXTR as a writer of before 2026-11-10 wrote it, edge columns by hand from the legacy vocabulary.
|
|
190
|
+
const write = (t: Tables): Uint8Array => {
|
|
191
|
+
const w = new ByteWriter();
|
|
192
|
+
w.varint(1); w.u8(0); w.varint(t.hash(H1)); w.varint(1);
|
|
193
|
+
w.varint(t.str(x.sourceRef)); w.varint(t.hash(x.sourceHash)); w.u8(0);
|
|
194
|
+
writeNodes(w, t, x.nodes);
|
|
195
|
+
w.varint(legacy.length);
|
|
196
|
+
let prev = 0;
|
|
197
|
+
for (const e of legacy) { const i = t.str(e.from); const d = i - prev; w.varint(d >= 0 ? d * 2 : -d * 2 - 1); prev = i; }
|
|
198
|
+
for (const e of legacy) w.varint(t.str(e.to));
|
|
199
|
+
for (const e of legacy) { const at = LEGACY_EDGE_KINDS.indexOf(e.kind); if (at >= 0) w.varint(at + 1); else { w.varint(0); w.varint(t.str(e.kind)); } }
|
|
200
|
+
for (const e of legacy) w.num(e.weight);
|
|
201
|
+
for (const _ of legacy) w.u8(0); // origin 'extracted'
|
|
202
|
+
for (const _ of legacy) w.varint(0); // no optional fields
|
|
203
|
+
writeKeys(w, t, x.keys);
|
|
204
|
+
return w.finish();
|
|
205
|
+
};
|
|
206
|
+
const col = collector(); write(col);
|
|
207
|
+
const t = tablesOf(col.strings, col.hashes);
|
|
208
|
+
const body = new ByteWriter();
|
|
209
|
+
writeSection(body, TAG.STR, writeStringTable(t.strings));
|
|
210
|
+
writeSection(body, TAG.HASH, writeHashTable(t.hashes));
|
|
211
|
+
writeSection(body, TAG.EXTR, write(t));
|
|
212
|
+
const plain = body.finish();
|
|
213
|
+
const old = writeFrame({ flags: 0, ...HEAD }, plain, plain);
|
|
214
|
+
|
|
215
|
+
const back = await decodePack(old);
|
|
216
|
+
expect(back).toEqual(packOf(legacy));
|
|
217
|
+
expect(Buffer.from(await encodePack(back, { deflate: false })).equals(Buffer.from(old))).toBe(true);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('FORWARD: a pack written now holds the symbol kinds as strings and its sites in a separate tag an older reader skips', async () => {
|
|
221
|
+
const edges = SYMBOL_EDGE_KINDS.map((kind, i) => edge(sym(`S${i}`, i + 1), sym(`T${i}`, 1), kind, kind === 'calls' ? [site(2, 4, 0)] : undefined));
|
|
222
|
+
const sections = await sectionsOf(await encodePack(packOf(edges), { deflate: false }));
|
|
223
|
+
expect(stringsOf(sections)).toEqual(expect.arrayContaining([...SYMBOL_EDGE_KINDS]));
|
|
224
|
+
expect(sections.has(TAG.SITE)).toBe(true);
|
|
225
|
+
// An older reader skips the SITE tag it does not know: the same pack, every edge and kind, without the sites.
|
|
226
|
+
sections.delete(TAG.SITE);
|
|
227
|
+
sections.set(99, new Uint8Array([1, 2, 3])); // and any other unknown tag, as it always has
|
|
228
|
+
const body = new ByteWriter();
|
|
229
|
+
for (const [tag, b] of sections) writeSection(body, tag, b);
|
|
230
|
+
const plain = body.finish();
|
|
231
|
+
const back = await decodePack(writeFrame({ flags: 0, ...HEAD }, plain, plain));
|
|
232
|
+
expect((back.extracted![0]!.entries[0] as Extracted).edges).toEqual(edges.map(({ sites: _, ...e }) => e));
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Goldens produced by the REAL previous release (@seanhogg/builderforce-memory@2026.10.68, installed under the alias
|
|
238
|
+
* `memory-prev`): a pack its writer wrote and what its reader decoded; this release's pack and what 2026.10.68's reader
|
|
239
|
+
* decoded from those exact bytes. Regenerate only with that script, never by hand.
|
|
240
|
+
*/
|
|
241
|
+
describe('symbol edges: compatibility against the published 2026.10.68 (goldens)', () => {
|
|
242
|
+
interface Golden {
|
|
243
|
+
prevVersion: string; prevPackHex: string; prevPackDecodedByPrev: Pack;
|
|
244
|
+
newPack: Pack; newPackHex: string; newPackDecodedByPrev: Pack;
|
|
245
|
+
}
|
|
246
|
+
const golden = JSON.parse(readFileSync(join(process.cwd(), 'src', 'contract', 'symbolEdges.golden.json'), 'utf8')) as Golden;
|
|
247
|
+
const bytes = (hex: string): Uint8Array => new Uint8Array(Buffer.from(hex, 'hex'));
|
|
248
|
+
|
|
249
|
+
it('BACKWARD (real): bytes written by 2026.10.68 decode here exactly as 2026.10.68 decoded them, and re-encode to the same bytes', async () => {
|
|
250
|
+
expect(golden.prevVersion).toBe('2026.10.68');
|
|
251
|
+
const back = await decodePack(bytes(golden.prevPackHex));
|
|
252
|
+
expect(back).toEqual(golden.prevPackDecodedByPrev);
|
|
253
|
+
expect(Buffer.from(await encodePack(back, { deflate: false })).toString('hex')).toBe(golden.prevPackHex);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('FORWARD (real): this release still writes the exact bytes 2026.10.68 was proven to read — every edge and kind, the sites skipped', async () => {
|
|
257
|
+
expect(Buffer.from(await encodePack(golden.newPack, { deflate: false })).toString('hex')).toBe(golden.newPackHex);
|
|
258
|
+
// What the previous reader decoded is this release's decode with the sites (an unknown tag to it) left out.
|
|
259
|
+
const stripSites = (p: Pack): unknown => JSON.parse(JSON.stringify(p, (k, v) => (k === 'sites' ? undefined : v)));
|
|
260
|
+
expect(golden.newPackDecodedByPrev).toEqual(stripSites(await decodePack(bytes(golden.newPackHex))));
|
|
261
|
+
// And this release reads its own golden with the sites, including the diff entry whose only change is an edge's sites.
|
|
262
|
+
const diff = (await decodePack(bytes(golden.newPackHex))).extracted!.find((x) => x.kind === 'diff')!.entries[0] as { edges: { add: Array<{ item: KEdge }> } };
|
|
263
|
+
expect(diff.edges.add[0]!.item.sites).toHaveLength(2);
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
describe('symbol edges in buildGraph', () => {
|
|
268
|
+
const file = (path: string, partition?: string): Extracted => ({
|
|
269
|
+
sourceRef: `src:r::${path}` as NodeRef, sourceHash: H1, keys: [],
|
|
270
|
+
nodes: [{ ref: `src:r::${path}` as NodeRef, kind: 'file', label: path, pack: 'p', importance: 0, origin: 'extracted', ...(partition ? { partition } : {}) }],
|
|
271
|
+
edges: [],
|
|
272
|
+
});
|
|
273
|
+
const pack = { id: 'p', parsers: [], partitions: { partitions: [{ id: 'ui', order: 0, match: ['ui/**'] }, { id: 'db', order: 1, match: ['db/**'] }], allow: { ui: ['db'], db: [] } } };
|
|
274
|
+
|
|
275
|
+
it('regression: a built graph keeps a calls edge\'s sites, and the symbol kinds neither re-weigh importance nor earn a layer verdict', () => {
|
|
276
|
+
const a = file('ui/a.ts'), b = file('db/b.ts');
|
|
277
|
+
const sites = [site(3, 4, 0), site(5, 4, 1)];
|
|
278
|
+
// db → ui is upward for an import; the same pair through `calls` is no finding and no verdict.
|
|
279
|
+
const base = [{ ...a }, { ...b, edges: [edge('src:r::db/b.ts' as NodeRef, 'src:r::ui/a.ts' as NodeRef, 'references')] }];
|
|
280
|
+
const withSymbols = [{ ...a }, { ...b, edges: [...base[1]!.edges, edge('src:r::db/b.ts' as NodeRef, 'src:r::ui/a.ts' as NodeRef, 'calls', sites)] }];
|
|
281
|
+
const before = buildGraph({ rootId: 'r', packs: [pack], extracted: base, facts: [], relations: [] });
|
|
282
|
+
const after = buildGraph({ rootId: 'r', packs: [pack], extracted: withSymbols, facts: [], relations: [] });
|
|
283
|
+
const calls = after.edges.find((e) => e.kind === 'calls')!;
|
|
284
|
+
expect(calls.sites).toEqual(sites);
|
|
285
|
+
expect(calls.verdict).toBeUndefined();
|
|
286
|
+
expect(after.nodes.map((n) => [n.ref, n.importance])).toEqual(before.nodes.map((n) => [n.ref, n.importance]));
|
|
287
|
+
expect(after.findings.filter((f) => f.kind === 'partition-violation')).toHaveLength(before.findings.filter((f) => f.kind === 'partition-violation').length);
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
describe('symbol edges in truncateGraph', () => {
|
|
292
|
+
it('regression: a symbol-level edge never earns a seed\'s neighbour a slot (only the import does)', () => {
|
|
293
|
+
const n = (path: string, importance: number) => ({ ref: `src:r::${path}` as NodeRef, kind: 'file', label: path, pack: 'p', importance, origin: 'extracted' as const });
|
|
294
|
+
const nodes = [n('seed.ts', 0.1), n('big.ts', 0.9), n('called.ts', 0.01), n('imported.ts', 0.02)];
|
|
295
|
+
const g = {
|
|
296
|
+
scope: { rootId: 'r', packs: ['p'], digest: 'd' }, nodes, findings: [], stats: { sources: 4, nodes: 4, edges: 2, stale: 0, truncated: false },
|
|
297
|
+
edges: [edge('src:r::seed.ts' as NodeRef, 'src:r::called.ts' as NodeRef, 'calls', [site(1, 1, 0)]), edge('src:r::seed.ts' as NodeRef, 'src:r::imported.ts' as NodeRef, 'references')],
|
|
298
|
+
} as unknown as Parameters<typeof truncateGraph>[0];
|
|
299
|
+
// A node that is not kept folds into an `area` node; the kept ones stay files.
|
|
300
|
+
const kept = truncateGraph(g, { maxNodes: 1, focus: ['src:r::seed.ts' as NodeRef], changed: [] }).nodes.filter((x) => x.kind === 'file').map((x) => x.ref);
|
|
301
|
+
expect(kept).toContain('src:r::imported.ts');
|
|
302
|
+
expect(kept).not.toContain('src:r::called.ts');
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
describe('dedupeSymbolEdges', () => {
|
|
307
|
+
it('keeps one edge per (from, to, kind), merges repeated calls into sites in source order, and caps edges per symbol and sites per edge', () => {
|
|
308
|
+
const a = sym('A.run', 1), b = sym('B.get', 2), c = sym('C', 3);
|
|
309
|
+
const out = dedupeSymbolEdges([
|
|
310
|
+
edge(a, b, 'calls', [site(5, 3, 2)]),
|
|
311
|
+
edge(a, b, 'calls', [site(4, 3, 0)]),
|
|
312
|
+
edge(a, c, 'uses'),
|
|
313
|
+
edge(a, c, 'uses'),
|
|
314
|
+
edge(FILE, b, 'references'),
|
|
315
|
+
edge(FILE, b, 'references'),
|
|
316
|
+
]);
|
|
317
|
+
expect(out).toEqual([edge(a, b, 'calls', [site(4, 3, 0), site(5, 3, 2)]), edge(a, c, 'uses'), edge(FILE, b, 'references'), edge(FILE, b, 'references')]);
|
|
318
|
+
const many = Array.from({ length: 10 }, (_, i) => edge(a, sym(`T${i}`, i), 'calls', Array.from({ length: 5 }, (_, s) => site(i, s, i * 5 + s))));
|
|
319
|
+
const capped = dedupeSymbolEdges(many, { maxPerSymbol: 3, maxSites: 2 });
|
|
320
|
+
expect(capped).toHaveLength(3);
|
|
321
|
+
expect(capped.every((e) => e.sites!.length === 2)).toBe(true);
|
|
322
|
+
});
|
|
323
|
+
});
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "Generated with @seanhogg/builderforce-memory@2026.10.68 (aliased memory-prev) by the P0b compat script; never edit by hand.",
|
|
3
|
+
"prevVersion": "2026.10.68",
|
|
4
|
+
"prevPackHex": "42464b50010001720300000000000000000000000000000000000000000000000000000000000000000145080004612e7473000563616c6c7301036f6465000c666163743a636c61696d3a3100087372632f612e74730404622e7473030c3a723a3a7372632f612e74730b04622e747302430200aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa00bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb030702040100017850042b0100000106000104010c01040281897a00800200030c0000070707010b0001040404000000000000010c0006070106030a0400007cdb87bb",
|
|
5
|
+
"prevPackDecodedByPrev": {
|
|
6
|
+
"rootId": "r",
|
|
7
|
+
"baseGeneration": 3,
|
|
8
|
+
"targetDigest": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
9
|
+
"files": [
|
|
10
|
+
{
|
|
11
|
+
"path": "src/a.ts",
|
|
12
|
+
"hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
13
|
+
"bytes": 120
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"path": "src/b.ts",
|
|
17
|
+
"hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
18
|
+
"bytes": 80
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"extracted": [
|
|
22
|
+
{
|
|
23
|
+
"kind": "full",
|
|
24
|
+
"hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
25
|
+
"entries": [
|
|
26
|
+
{
|
|
27
|
+
"sourceRef": "src:r::src/a.ts",
|
|
28
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
29
|
+
"extractorVersion": 4,
|
|
30
|
+
"nodes": [
|
|
31
|
+
{
|
|
32
|
+
"ref": "src:r::src/a.ts",
|
|
33
|
+
"kind": "file",
|
|
34
|
+
"label": "src/a.ts",
|
|
35
|
+
"pack": "code",
|
|
36
|
+
"importance": 0.5,
|
|
37
|
+
"origin": "extracted",
|
|
38
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"edges": [
|
|
42
|
+
{
|
|
43
|
+
"from": "src:r::src/a.ts",
|
|
44
|
+
"to": "src:r::src/b.ts",
|
|
45
|
+
"kind": "references",
|
|
46
|
+
"weight": 1,
|
|
47
|
+
"origin": "extracted"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"from": "src:r::src/a.ts",
|
|
51
|
+
"to": "src:r::src/b.ts",
|
|
52
|
+
"kind": "co-changed",
|
|
53
|
+
"weight": 1,
|
|
54
|
+
"origin": "extracted"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"from": "src:r::src/a.ts",
|
|
58
|
+
"to": "src:r::src/b.ts",
|
|
59
|
+
"kind": "calls",
|
|
60
|
+
"weight": 1,
|
|
61
|
+
"origin": "extracted"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"keys": [
|
|
65
|
+
{
|
|
66
|
+
"ref": "src:r::src/a.ts",
|
|
67
|
+
"key": "a.ts"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"relations": [
|
|
75
|
+
{
|
|
76
|
+
"from": "src:r::src/a.ts",
|
|
77
|
+
"to": "fact:claim:1",
|
|
78
|
+
"kind": "about",
|
|
79
|
+
"weight": 1,
|
|
80
|
+
"origin": "model"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"newPack": {
|
|
85
|
+
"rootId": "r",
|
|
86
|
+
"baseGeneration": 4,
|
|
87
|
+
"targetDigest": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
88
|
+
"extracted": [
|
|
89
|
+
{
|
|
90
|
+
"kind": "full",
|
|
91
|
+
"hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
92
|
+
"entries": [
|
|
93
|
+
{
|
|
94
|
+
"sourceRef": "src:r::src/a.ts",
|
|
95
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
96
|
+
"extractorVersion": 5,
|
|
97
|
+
"nodes": [
|
|
98
|
+
{
|
|
99
|
+
"ref": "src:r::src/a.ts",
|
|
100
|
+
"kind": "file",
|
|
101
|
+
"label": "src/a.ts",
|
|
102
|
+
"pack": "code",
|
|
103
|
+
"importance": 0.5,
|
|
104
|
+
"origin": "extracted",
|
|
105
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"edges": [
|
|
109
|
+
{
|
|
110
|
+
"from": "src:r::src/a.ts#A@1",
|
|
111
|
+
"to": "src:r::src/b.ts#B@1",
|
|
112
|
+
"kind": "extends",
|
|
113
|
+
"weight": 1,
|
|
114
|
+
"origin": "extracted"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"from": "src:r::src/a.ts#A@1",
|
|
118
|
+
"to": "src:r::src/b.ts#I@9",
|
|
119
|
+
"kind": "implements",
|
|
120
|
+
"weight": 1,
|
|
121
|
+
"origin": "extracted"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"from": "src:r::src/a.ts#A@1",
|
|
125
|
+
"to": "src:r::src/b.ts#B@1",
|
|
126
|
+
"kind": "composes",
|
|
127
|
+
"weight": 1,
|
|
128
|
+
"origin": "extracted"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"from": "src:r::src/a.ts#A.run@3",
|
|
132
|
+
"to": "src:r::src/b.ts#Row@20",
|
|
133
|
+
"kind": "uses",
|
|
134
|
+
"weight": 1,
|
|
135
|
+
"origin": "extracted"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"from": "src:r::src/a.ts#A.run@3",
|
|
139
|
+
"to": "src:r::src/b.ts#B.get@2",
|
|
140
|
+
"kind": "calls",
|
|
141
|
+
"weight": 1,
|
|
142
|
+
"origin": "extracted",
|
|
143
|
+
"sites": [
|
|
144
|
+
{
|
|
145
|
+
"path": "src/a.ts",
|
|
146
|
+
"line": 4,
|
|
147
|
+
"column": 5,
|
|
148
|
+
"order": 0
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"keys": []
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"kind": "diff",
|
|
159
|
+
"hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
160
|
+
"prior": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
161
|
+
"entries": [
|
|
162
|
+
{
|
|
163
|
+
"sourceRef": "src:r::src/a.ts",
|
|
164
|
+
"sourceHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
165
|
+
"extractorVersion": 5,
|
|
166
|
+
"nodes": {
|
|
167
|
+
"remove": [
|
|
168
|
+
"src:r::src/a.ts"
|
|
169
|
+
],
|
|
170
|
+
"add": [
|
|
171
|
+
{
|
|
172
|
+
"at": 0,
|
|
173
|
+
"item": {
|
|
174
|
+
"ref": "src:r::src/a.ts",
|
|
175
|
+
"kind": "file",
|
|
176
|
+
"label": "src/a.ts",
|
|
177
|
+
"pack": "code",
|
|
178
|
+
"importance": 0.5,
|
|
179
|
+
"origin": "extracted",
|
|
180
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
"edges": {
|
|
186
|
+
"remove": [
|
|
187
|
+
"src:r::src/a.ts#A.run@3\u0000src:r::src/b.ts#B.get@2\u0000calls"
|
|
188
|
+
],
|
|
189
|
+
"add": [
|
|
190
|
+
{
|
|
191
|
+
"at": 4,
|
|
192
|
+
"item": {
|
|
193
|
+
"from": "src:r::src/a.ts#A.run@3",
|
|
194
|
+
"to": "src:r::src/b.ts#B.get@2",
|
|
195
|
+
"kind": "calls",
|
|
196
|
+
"weight": 1,
|
|
197
|
+
"origin": "extracted",
|
|
198
|
+
"sites": [
|
|
199
|
+
{
|
|
200
|
+
"path": "src/a.ts",
|
|
201
|
+
"line": 4,
|
|
202
|
+
"column": 5,
|
|
203
|
+
"order": 0
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"path": "src/a.ts",
|
|
207
|
+
"line": 6,
|
|
208
|
+
"column": 9,
|
|
209
|
+
"order": 2
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"keys": {
|
|
217
|
+
"remove": [],
|
|
218
|
+
"add": []
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"newPackHex": "42464b50010001720400000000000000000000000000000000000000000000000000000000000000000195010f000563616c6c7301036f646502066d706f7365730007657874656e6473000a696d706c656d656e747300087372632f612e7473030c3a723a3a7372632f612e74730f0823412e72756e4033171e007372633a723a3a7372632f622e747323422e67657440320063616c6c73110240310b0c622e747323422e67657440321102403110034940391006526f7740323000047573657302430200aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa00bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb04600200000106000105010c01050181897a008002000512000003000b0c0b0d0a000300040002000e000004040404040000000000000000000000010100010601010501060100010c01050181897a0080020001080104010e0a00000400000000000d150200000401050405000100000205040500050609025ab5ca20",
|
|
226
|
+
"newPackDecodedByPrev": {
|
|
227
|
+
"rootId": "r",
|
|
228
|
+
"baseGeneration": 4,
|
|
229
|
+
"targetDigest": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
230
|
+
"extracted": [
|
|
231
|
+
{
|
|
232
|
+
"kind": "full",
|
|
233
|
+
"hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
234
|
+
"entries": [
|
|
235
|
+
{
|
|
236
|
+
"sourceRef": "src:r::src/a.ts",
|
|
237
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
238
|
+
"extractorVersion": 5,
|
|
239
|
+
"nodes": [
|
|
240
|
+
{
|
|
241
|
+
"ref": "src:r::src/a.ts",
|
|
242
|
+
"kind": "file",
|
|
243
|
+
"label": "src/a.ts",
|
|
244
|
+
"pack": "code",
|
|
245
|
+
"importance": 0.5,
|
|
246
|
+
"origin": "extracted",
|
|
247
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"edges": [
|
|
251
|
+
{
|
|
252
|
+
"from": "src:r::src/a.ts#A@1",
|
|
253
|
+
"to": "src:r::src/b.ts#B@1",
|
|
254
|
+
"kind": "extends",
|
|
255
|
+
"weight": 1,
|
|
256
|
+
"origin": "extracted"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"from": "src:r::src/a.ts#A@1",
|
|
260
|
+
"to": "src:r::src/b.ts#I@9",
|
|
261
|
+
"kind": "implements",
|
|
262
|
+
"weight": 1,
|
|
263
|
+
"origin": "extracted"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"from": "src:r::src/a.ts#A@1",
|
|
267
|
+
"to": "src:r::src/b.ts#B@1",
|
|
268
|
+
"kind": "composes",
|
|
269
|
+
"weight": 1,
|
|
270
|
+
"origin": "extracted"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"from": "src:r::src/a.ts#A.run@3",
|
|
274
|
+
"to": "src:r::src/b.ts#Row@20",
|
|
275
|
+
"kind": "uses",
|
|
276
|
+
"weight": 1,
|
|
277
|
+
"origin": "extracted"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"from": "src:r::src/a.ts#A.run@3",
|
|
281
|
+
"to": "src:r::src/b.ts#B.get@2",
|
|
282
|
+
"kind": "calls",
|
|
283
|
+
"weight": 1,
|
|
284
|
+
"origin": "extracted"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"keys": []
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"kind": "diff",
|
|
293
|
+
"hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
294
|
+
"prior": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
295
|
+
"entries": [
|
|
296
|
+
{
|
|
297
|
+
"sourceRef": "src:r::src/a.ts",
|
|
298
|
+
"sourceHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
299
|
+
"extractorVersion": 5,
|
|
300
|
+
"nodes": {
|
|
301
|
+
"remove": [
|
|
302
|
+
"src:r::src/a.ts"
|
|
303
|
+
],
|
|
304
|
+
"add": [
|
|
305
|
+
{
|
|
306
|
+
"at": 0,
|
|
307
|
+
"item": {
|
|
308
|
+
"ref": "src:r::src/a.ts",
|
|
309
|
+
"kind": "file",
|
|
310
|
+
"label": "src/a.ts",
|
|
311
|
+
"pack": "code",
|
|
312
|
+
"importance": 0.5,
|
|
313
|
+
"origin": "extracted",
|
|
314
|
+
"sourceHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
"edges": {
|
|
320
|
+
"remove": [
|
|
321
|
+
"src:r::src/a.ts#A.run@3\u0000src:r::src/b.ts#B.get@2\u0000calls"
|
|
322
|
+
],
|
|
323
|
+
"add": [
|
|
324
|
+
{
|
|
325
|
+
"at": 4,
|
|
326
|
+
"item": {
|
|
327
|
+
"from": "src:r::src/a.ts#A.run@3",
|
|
328
|
+
"to": "src:r::src/b.ts#B.get@2",
|
|
329
|
+
"kind": "calls",
|
|
330
|
+
"weight": 1,
|
|
331
|
+
"origin": "extracted"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
"keys": {
|
|
337
|
+
"remove": [],
|
|
338
|
+
"add": []
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
}
|