@myrialabs/clopen 0.4.37 → 0.4.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/backend/auth/permissions.ts +39 -0
- package/backend/bootstrap.ts +16 -0
- package/backend/chat/stream-manager.ts +1 -1
- package/backend/database/crypto/envelope.test.ts +93 -0
- package/backend/database/crypto/envelope.ts +127 -0
- package/backend/database/crypto/index.ts +22 -0
- package/backend/database/crypto/master-key.ts +129 -0
- package/backend/database/crypto/secret-columns.ts +151 -0
- package/backend/database/migrations/071_create_notes_tables.ts +90 -0
- package/backend/database/migrations/072_encrypt_stored_secrets.ts +107 -0
- package/backend/database/migrations/073_create_integration_tables.ts +119 -0
- package/backend/database/migrations/074_create_work_tables.ts +94 -0
- package/backend/database/migrations/075_create_deploy_bindings.ts +54 -0
- package/backend/database/migrations/076_remove_memory_code_graph.ts +229 -0
- package/backend/database/migrations/077_create_integration_db_links.ts +150 -0
- package/backend/database/migrations/index.ts +49 -0
- package/backend/database/queries/db-client-connection-queries.ts +42 -12
- package/backend/database/queries/deploy-queries.ts +124 -0
- package/backend/database/queries/engine-queries.ts +23 -10
- package/backend/database/queries/graph-queries.ts +291 -247
- package/backend/database/queries/index.ts +10 -1
- package/backend/database/queries/integration-db-link-queries.ts +168 -0
- package/backend/database/queries/integration-queries.ts +325 -0
- package/backend/database/queries/mcp-server-queries.ts +38 -11
- package/backend/database/queries/note-queries.test.ts +190 -0
- package/backend/database/queries/note-queries.ts +269 -0
- package/backend/database/queries/profile-queries.ts +1 -1
- package/backend/database/queries/ssh-connection-queries.ts +19 -8
- package/backend/database/queries/work-queries.ts +210 -0
- package/backend/db-client/integrations/index.ts +37 -0
- package/backend/db-client/integrations/links.ts +533 -0
- package/backend/db-client/integrations/projector.test.ts +280 -0
- package/backend/db-client/integrations/projector.ts +256 -0
- package/backend/db-client/integrations/supabase-service.ts +266 -0
- package/backend/db-client/providers/registry.ts +27 -0
- package/backend/db-client/providers/supabase/adapter.ts +500 -0
- package/backend/db-client/providers/supabase/api-types.ts +92 -0
- package/backend/db-client/providers/supabase/apply-migration.ts +104 -0
- package/backend/db-client/providers/supabase/client.ts +259 -0
- package/backend/db-client/providers/supabase/features.ts +502 -0
- package/backend/db-client/providers/supabase/local.test.ts +78 -0
- package/backend/db-client/providers/supabase/local.ts +137 -0
- package/backend/db-client/providers/types.ts +137 -0
- package/backend/deployments/bindings.test.ts +43 -0
- package/backend/deployments/bindings.ts +216 -0
- package/backend/deployments/index.ts +53 -0
- package/backend/deployments/log-streams.ts +214 -0
- package/backend/deployments/prompts.ts +70 -0
- package/backend/deployments/providers/vercel/adapter.ts +757 -0
- package/backend/deployments/providers/vercel/build-logs.test.ts +80 -0
- package/backend/deployments/providers/vercel/build-logs.ts +211 -0
- package/backend/deployments/providers/vercel/client.ts +203 -0
- package/backend/deployments/providers/vercel/list.test.ts +624 -0
- package/backend/deployments/providers/vercel/normalise.test.ts +115 -0
- package/backend/deployments/providers/vercel/normalise.ts +113 -0
- package/backend/deployments/providers/vercel/types.ts +104 -0
- package/backend/deployments/registry.ts +27 -0
- package/backend/deployments/service.ts +458 -0
- package/backend/deployments/types.ts +278 -0
- package/backend/engine/docs/artifacts.md +22 -9
- package/backend/files/os-clipboard.test.ts +209 -0
- package/backend/files/os-clipboard.ts +567 -0
- package/backend/http/integration-hooks.ts +42 -0
- package/backend/http/notes-images.test.ts +228 -0
- package/backend/http/notes-images.ts +196 -0
- package/backend/index.ts +13 -0
- package/backend/integrations/accounts.ts +229 -0
- package/backend/integrations/health.ts +146 -0
- package/backend/integrations/index.ts +36 -0
- package/backend/integrations/projections/index.ts +0 -0
- package/backend/integrations/projections/mcp-projector.test.ts +204 -0
- package/backend/integrations/projections/mcp-projector.ts +163 -0
- package/backend/integrations/projections/types.ts +63 -0
- package/backend/integrations/registry/define.ts +38 -0
- package/backend/integrations/registry/index.ts +60 -0
- package/backend/integrations/registry/providers/context7.ts +44 -0
- package/backend/integrations/registry/providers/firecrawl.ts +41 -0
- package/backend/integrations/registry/providers/github.ts +78 -0
- package/backend/integrations/registry/providers/supabase.ts +61 -0
- package/backend/integrations/registry/providers/vercel.ts +46 -0
- package/backend/integrations/registry/types.ts +96 -0
- package/backend/integrations/webhooks/gateway.ts +160 -0
- package/backend/integrations/webhooks/verify.ts +65 -0
- package/backend/mcp/README.md +25 -3
- package/backend/mcp/external/config.ts +35 -1
- package/backend/mcp/index.ts +1 -1
- package/backend/mcp/internal/config.ts +1 -1
- package/backend/mcp/internal/servers/memory-graph/description.ts +3 -3
- package/backend/mcp/internal/servers/memory-graph/runner.ts +4 -9
- package/backend/mcp/internal/servers/memory-graph/schema.ts +0 -4
- package/backend/memory/README.md +57 -34
- package/backend/memory/compose.test.ts +3 -3
- package/backend/memory/compose.ts +6 -9
- package/backend/memory/config.ts +0 -5
- package/backend/memory/consolidate.ts +1 -2
- package/backend/memory/context.test.ts +8 -54
- package/backend/memory/context.ts +19 -25
- package/backend/memory/extract/episodic.ts +10 -12
- package/backend/memory/extract/index.ts +23 -52
- package/backend/memory/extract/scheduler.ts +3 -6
- package/backend/memory/index.ts +6 -5
- package/backend/memory/invalidate.ts +36 -48
- package/backend/memory/layout.ts +319 -130
- package/backend/memory/retention.ts +12 -42
- package/backend/memory/retrieval.eval.test.ts +2 -2
- package/backend/memory/retrieval.test.ts +228 -183
- package/backend/memory/retrieval.ts +22 -21
- package/backend/memory/revise.test.ts +62 -116
- package/backend/memory/revise.ts +0 -1
- package/backend/memory/view.ts +8 -5
- package/backend/notes/access.test.ts +82 -0
- package/backend/notes/access.ts +27 -0
- package/backend/notes/storage.test.ts +77 -0
- package/backend/notes/storage.ts +114 -0
- package/backend/permissions/service.ts +2 -2
- package/backend/profiles/service.ts +1 -1
- package/backend/projects/project-cleanup.ts +6 -0
- package/backend/snapshot/helpers.ts +35 -41
- package/backend/snapshot/snapshot-service.ts +90 -0
- package/backend/snapshot/turn-changes.test.ts +163 -0
- package/backend/snapshot/turn-changes.ts +131 -0
- package/backend/work/bindings.ts +124 -0
- package/backend/work/index.ts +42 -0
- package/backend/work/prompts.ts +150 -0
- package/backend/work/providers/github/actions-logs.ts +180 -0
- package/backend/work/providers/github/adapter.test.ts +88 -0
- package/backend/work/providers/github/adapter.ts +1255 -0
- package/backend/work/providers/github/client.ts +280 -0
- package/backend/work/providers/github/list-range.test.ts +158 -0
- package/backend/work/providers/github/token-kind.test.ts +42 -0
- package/backend/work/pull-requests.ts +242 -0
- package/backend/work/registry.ts +27 -0
- package/backend/work/service.ts +436 -0
- package/backend/work/start-work.test.ts +71 -0
- package/backend/work/start-work.ts +232 -0
- package/backend/work/types.ts +180 -0
- package/backend/ws/db-client/accounts.ts +225 -0
- package/backend/ws/db-client/connections.ts +34 -3
- package/backend/ws/db-client/context.ts +37 -0
- package/backend/ws/db-client/index.ts +20 -1
- package/backend/ws/db-client/supabase.ts +188 -0
- package/backend/ws/deployments/actions.ts +360 -0
- package/backend/ws/deployments/context.ts +43 -0
- package/backend/ws/deployments/crud.ts +152 -0
- package/backend/ws/deployments/index.ts +15 -0
- package/backend/ws/deployments/schemas.ts +183 -0
- package/backend/ws/files/clipboard.ts +78 -0
- package/backend/ws/files/index.ts +5 -0
- package/backend/ws/git/diff-budget.ts +70 -11
- package/backend/ws/index.ts +16 -2
- package/backend/ws/integrations/crud.ts +219 -0
- package/backend/ws/integrations/index.ts +22 -0
- package/backend/ws/mcp/crud.ts +25 -1
- package/backend/ws/memory/crud.ts +4 -16
- package/backend/ws/notes/index.ts +278 -0
- package/backend/ws/profiles/crud.ts +1 -1
- package/backend/ws/snapshot/changes.ts +279 -0
- package/backend/ws/snapshot/index.ts +4 -3
- package/backend/ws/work/actions.ts +206 -0
- package/backend/ws/work/context.ts +51 -0
- package/backend/ws/work/crud.ts +347 -0
- package/backend/ws/work/index.ts +17 -0
- package/backend/ws/work/pull-requests.ts +177 -0
- package/backend/ws/work/schemas.ts +226 -0
- package/dist/assets/{index-sJmS_CCm.js → index-BrF6nqld.js} +1 -1
- package/dist/assets/{index-Bik9TCBi.js → index-C8Gi-b6U.js} +1 -1
- package/dist/assets/main-Bd3gb79F.css +1 -0
- package/dist/assets/main-Bo1hD7mt.js +1191 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/shared/constants/engine-tools.ts +1 -1
- package/shared/constants/tool-icons.ts +42 -0
- package/shared/types/database/schema.ts +41 -0
- package/shared/types/db-client/connection.ts +6 -0
- package/shared/types/db-client/index.ts +2 -0
- package/shared/types/db-client/integrations.ts +174 -0
- package/shared/types/db-client/supabase.ts +131 -0
- package/shared/types/deployments.ts +382 -0
- package/shared/types/integrations.ts +140 -0
- package/shared/types/memory.ts +34 -51
- package/shared/types/stores/settings.ts +8 -0
- package/shared/types/ui/components.ts +1 -1
- package/shared/types/work.ts +426 -0
- package/shared/utils/diff-calculator.test.ts +89 -0
- package/shared/utils/diff-calculator.ts +30 -65
- package/shared/utils/logger.ts +4 -0
- package/backend/memory/extract/languages.ts +0 -176
- package/backend/memory/extract/structural.test.ts +0 -215
- package/backend/memory/extract/structural.ts +0 -364
- package/backend/ws/snapshot/content.ts +0 -85
- package/dist/assets/main-DLqolBI2.css +0 -1
- package/dist/assets/main-Df1I3hnw.js +0 -1096
package/backend/memory/layout.ts
CHANGED
|
@@ -36,9 +36,30 @@ import Graph from 'graphology';
|
|
|
36
36
|
import louvain from 'graphology-communities-louvain';
|
|
37
37
|
import forceAtlas2 from 'graphology-layout-forceatlas2';
|
|
38
38
|
import { graphQueries, graphLayoutQueries, type GraphLayoutRow } from '$backend/database/queries/graph-queries';
|
|
39
|
+
import { settingsQueries } from '$backend/database/queries/settings-queries';
|
|
39
40
|
import { broadcastGraphChanged } from './notify';
|
|
40
41
|
import { debug } from '$shared/utils/logger';
|
|
41
42
|
|
|
43
|
+
/**
|
|
44
|
+
* What produced the stored arrangement. BUMP IT whenever that changes — either
|
|
45
|
+
* the edges this pass lays out, or how it places them.
|
|
46
|
+
*
|
|
47
|
+
* A pass is warm by default: every node is seeded at the position it already had
|
|
48
|
+
* and only lightly re-settled, which is what stops one new memory rearranging a
|
|
49
|
+
* map somebody has learned. That is exactly wrong after the pass itself changes,
|
|
50
|
+
* because the arrangement it would preserve was computed by different rules —
|
|
51
|
+
* when removing the code half took the store from 1,351 components to one, the
|
|
52
|
+
* surviving memories stayed in the shell those nine thousand nodes had shaped.
|
|
53
|
+
*
|
|
54
|
+
* So the marker is stored alongside the arrangement, and a mismatch drops the
|
|
55
|
+
* arrangement once. It costs one cold pass, which the store pays for anyway the
|
|
56
|
+
* first time it is laid out.
|
|
57
|
+
*/
|
|
58
|
+
const LAYOUT_VERSION = '6';
|
|
59
|
+
const LAYOUT_VERSION_KEY = 'memory_layout_version';
|
|
60
|
+
/** The key this used before it covered placement as well as derivation. */
|
|
61
|
+
const LEGACY_LAYOUT_KEY = 'memory_layout_derivation';
|
|
62
|
+
|
|
42
63
|
/**
|
|
43
64
|
* Two caps, because the two halves of a pass scale differently.
|
|
44
65
|
*
|
|
@@ -138,6 +159,16 @@ export async function runGraphLayout(): Promise<void> {
|
|
|
138
159
|
return;
|
|
139
160
|
}
|
|
140
161
|
|
|
162
|
+
// Before anything reads the stored arrangement: if a different version of
|
|
163
|
+
// this pass produced it, it is not an arrangement of this graph.
|
|
164
|
+
if (settingsQueries.get(LAYOUT_VERSION_KEY)?.value !== LAYOUT_VERSION) {
|
|
165
|
+
graphLayoutQueries.clear();
|
|
166
|
+
settingsQueries.set(LAYOUT_VERSION_KEY, LAYOUT_VERSION);
|
|
167
|
+
settingsQueries.delete(LEGACY_LAYOUT_KEY);
|
|
168
|
+
lastMembership = '';
|
|
169
|
+
debug.log('memory', 'Memory layout: the pass changed, arranging from scratch');
|
|
170
|
+
}
|
|
171
|
+
|
|
141
172
|
const membership = membershipOf(ids);
|
|
142
173
|
// Same nodes as last time and nothing waiting to be placed: the answer is
|
|
143
174
|
// the one already in the table.
|
|
@@ -337,8 +368,9 @@ async function arrange(
|
|
|
337
368
|
const anchor = existingCentroid(member, existing);
|
|
338
369
|
seedComponent(part, communities, existing, anchor);
|
|
339
370
|
await settle(part, cold || !anchor ? iterationsFor(part.order) : warmIterationsFor(part.order));
|
|
371
|
+
const lobes = spreadCommunities(part, communities);
|
|
340
372
|
|
|
341
|
-
placed.push(measure(part, anchor));
|
|
373
|
+
placed.push(measure(part, anchor, lobes));
|
|
342
374
|
}
|
|
343
375
|
|
|
344
376
|
packComponents(placed);
|
|
@@ -356,10 +388,170 @@ async function arrange(
|
|
|
356
388
|
}
|
|
357
389
|
}
|
|
358
390
|
|
|
359
|
-
|
|
391
|
+
// The field is where the LOBES are. Lone nodes are dropped into it rather than
|
|
392
|
+
// onto a disc of their own, which is what stopped them deciding how far the
|
|
393
|
+
// map reaches — see `placeLoneNodes`.
|
|
394
|
+
const field: Disc[] = [];
|
|
395
|
+
for (const component of placed) {
|
|
396
|
+
for (const lobe of component.lobes) {
|
|
397
|
+
field.push({ x: lobe.x + component.offsetX, y: lobe.y + component.offsetY, radius: lobe.radius });
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
for (const row of placeLoneNodes(singletons, field, communities, existing)) rows.push(row);
|
|
360
402
|
return rows;
|
|
361
403
|
}
|
|
362
404
|
|
|
405
|
+
/**
|
|
406
|
+
* Push the lobes apart from each other, leaving each one's interior alone.
|
|
407
|
+
*
|
|
408
|
+
* The forces cannot do this on their own. Repulsion is between NODES, so it is
|
|
409
|
+
* strongest exactly where nodes are dense — inside a lobe — while the edges
|
|
410
|
+
* between two lobes pull them together with nothing pushing back at the same
|
|
411
|
+
* scale. A well-clustered graph therefore settles as one field of colour with
|
|
412
|
+
* its groups readable only by hue.
|
|
413
|
+
*
|
|
414
|
+
* Raising `scalingRatio` would not fix it: global repulsion inflates the lobes
|
|
415
|
+
* and the gaps together, so the picture gets bigger and reads the same.
|
|
416
|
+
*
|
|
417
|
+
* SEPARATION IS SOLVED, NOT SCALED, and the difference matters. Multiplying each
|
|
418
|
+
* lobe's distance from the centre — by one constant, or by a draw per lobe —
|
|
419
|
+
* cannot promise any particular lobe clear space: the constant preserves the
|
|
420
|
+
* silhouette and only inflates it, and the draw flings a few lobes far out while
|
|
421
|
+
* the rest stay exactly as crowded as they were. Measured, that second version
|
|
422
|
+
* put the whole store's extent in the hands of two outliers and left the other
|
|
423
|
+
* fifty-six in a clump.
|
|
424
|
+
*
|
|
425
|
+
* So each lobe is treated as a disc, and the discs are relaxed apart until none
|
|
426
|
+
* of them overlap — the same collision pass `packComponents` runs over
|
|
427
|
+
* components, one level down. Every lobe ends up with room, the field grows only
|
|
428
|
+
* as far as it has to, and `GAP` is the dial: clear space between two lobes as a
|
|
429
|
+
* fraction of the smaller one's radius.
|
|
430
|
+
*
|
|
431
|
+
* Each lobe moves RIGIDLY. Every node keeps its offset from its own lobe's
|
|
432
|
+
* centroid, so the interior the forces worked out is preserved exactly and only
|
|
433
|
+
* the distance between lobes changes. Deterministic, and it cannot destabilise a
|
|
434
|
+
* simulation that has already finished.
|
|
435
|
+
*
|
|
436
|
+
* Returns the discs, because they are the FIELD: what the map covers is where
|
|
437
|
+
* the lobes are, and the nodes that connect to nothing are placed inside it
|
|
438
|
+
* rather than on a disc of their own. See `placeLoneNodes`.
|
|
439
|
+
*/
|
|
440
|
+
function spreadCommunities(part: Graph, communities: Record<string, number>): Disc[] {
|
|
441
|
+
/**
|
|
442
|
+
* Clear space between two lobes, as a fraction of the smaller one's radius.
|
|
443
|
+
* This is the "multiverse rather than one universe" dial. `packComponents`
|
|
444
|
+
* uses 0.15 between whole components; lobes want far more, because unlike
|
|
445
|
+
* components they are joined by edges that read as bridges.
|
|
446
|
+
*/
|
|
447
|
+
const GAP = 0.9;
|
|
448
|
+
const PASSES = 240;
|
|
449
|
+
/**
|
|
450
|
+
* The percentile of member distances taken as a lobe's radius.
|
|
451
|
+
*
|
|
452
|
+
* Not the maximum: Louvain leaves the occasional member stretched toward a
|
|
453
|
+
* neighbouring lobe by one edge, and sizing the disc to that straggler would
|
|
454
|
+
* separate on a distance almost none of the lobe occupies.
|
|
455
|
+
*/
|
|
456
|
+
const RADIUS_PERCENTILE = 0.9;
|
|
457
|
+
|
|
458
|
+
const members = new Map<number, string[]>();
|
|
459
|
+
part.forEachNode(id => {
|
|
460
|
+
const community = communities[id] ?? 0;
|
|
461
|
+
const list = members.get(community);
|
|
462
|
+
if (list) list.push(id);
|
|
463
|
+
else members.set(community, [id]);
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
interface Lobe extends Disc {
|
|
467
|
+
ids: string[];
|
|
468
|
+
originX: number;
|
|
469
|
+
originY: number;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
const lobes: Lobe[] = [];
|
|
473
|
+
for (const [, ids] of [...members.entries()].sort((a, b) => a[0] - b[0])) {
|
|
474
|
+
let sumX = 0;
|
|
475
|
+
let sumY = 0;
|
|
476
|
+
for (const id of ids) {
|
|
477
|
+
sumX += part.getNodeAttribute(id, 'x') as number;
|
|
478
|
+
sumY += part.getNodeAttribute(id, 'y') as number;
|
|
479
|
+
}
|
|
480
|
+
const x = sumX / ids.length;
|
|
481
|
+
const y = sumY / ids.length;
|
|
482
|
+
|
|
483
|
+
const distances = ids
|
|
484
|
+
.map(id =>
|
|
485
|
+
Math.hypot((part.getNodeAttribute(id, 'x') as number) - x, (part.getNodeAttribute(id, 'y') as number) - y)
|
|
486
|
+
)
|
|
487
|
+
.sort((a, b) => a - b);
|
|
488
|
+
const radius = Math.max(distances[Math.floor(distances.length * RADIUS_PERCENTILE)] ?? 0, 20);
|
|
489
|
+
|
|
490
|
+
lobes.push({ ids, x, y, radius, originX: x, originY: y });
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// One lobe has nothing to be spread away from, but it is still the field.
|
|
494
|
+
if (lobes.length < 2) return lobes.map(lobe => ({ x: lobe.x, y: lobe.y, radius: lobe.radius }));
|
|
495
|
+
|
|
496
|
+
for (let pass = 0; pass < PASSES; pass++) {
|
|
497
|
+
// Over-relaxed early and settling toward an exact correction, for the same
|
|
498
|
+
// reason `packComponents` does it: separating one pair nudges both into
|
|
499
|
+
// their other neighbours.
|
|
500
|
+
const relax = 1.4 - 0.4 * (pass / PASSES);
|
|
501
|
+
let collided = false;
|
|
502
|
+
|
|
503
|
+
for (let i = 0; i < lobes.length; i++) {
|
|
504
|
+
for (let j = i + 1; j < lobes.length; j++) {
|
|
505
|
+
const a = lobes[i];
|
|
506
|
+
const b = lobes[j];
|
|
507
|
+
const minimum = a.radius + b.radius + GAP * Math.min(a.radius, b.radius);
|
|
508
|
+
let dx = b.x - a.x;
|
|
509
|
+
let dy = b.y - a.y;
|
|
510
|
+
const squared = dx * dx + dy * dy;
|
|
511
|
+
if (squared >= minimum * minimum) continue;
|
|
512
|
+
|
|
513
|
+
let distance = Math.sqrt(squared);
|
|
514
|
+
if (distance < 1e-9) {
|
|
515
|
+
// Two centroids on the same point have no direction to separate
|
|
516
|
+
// along; take one from the ids, so it is still the same every pass.
|
|
517
|
+
const angle = jitterOf(a.ids[0] + b.ids[0]).angle;
|
|
518
|
+
dx = Math.cos(angle);
|
|
519
|
+
dy = Math.sin(angle);
|
|
520
|
+
distance = 1;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const push = (relax * (minimum - distance)) / distance / 2;
|
|
524
|
+
a.x -= dx * push;
|
|
525
|
+
a.y -= dy * push;
|
|
526
|
+
b.x += dx * push;
|
|
527
|
+
b.y += dy * push;
|
|
528
|
+
collided = true;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
if (!collided) break;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
for (const lobe of lobes) {
|
|
536
|
+
const shiftX = lobe.x - lobe.originX;
|
|
537
|
+
const shiftY = lobe.y - lobe.originY;
|
|
538
|
+
if (shiftX === 0 && shiftY === 0) continue;
|
|
539
|
+
for (const id of lobe.ids) {
|
|
540
|
+
part.setNodeAttribute(id, 'x', (part.getNodeAttribute(id, 'x') as number) + shiftX);
|
|
541
|
+
part.setNodeAttribute(id, 'y', (part.getNodeAttribute(id, 'y') as number) + shiftY);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return lobes.map(lobe => ({ x: lobe.x, y: lobe.y, radius: lobe.radius }));
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/** A circle something occupies — a lobe, or a whole component. */
|
|
549
|
+
interface Disc {
|
|
550
|
+
x: number;
|
|
551
|
+
y: number;
|
|
552
|
+
radius: number;
|
|
553
|
+
}
|
|
554
|
+
|
|
363
555
|
/** One component, laid out in local space and waiting to be given a place. */
|
|
364
556
|
interface PlacedComponent {
|
|
365
557
|
ids: string[];
|
|
@@ -371,6 +563,8 @@ interface PlacedComponent {
|
|
|
371
563
|
offsetY: number;
|
|
372
564
|
/** Where it already sat, when it was on the map before this pass. */
|
|
373
565
|
anchored: boolean;
|
|
566
|
+
/** Its lobes, in the same local space as `xs`/`ys`. See `placeLoneNodes`. */
|
|
567
|
+
lobes: Disc[];
|
|
374
568
|
}
|
|
375
569
|
|
|
376
570
|
/**
|
|
@@ -567,7 +761,7 @@ function communityMetaSeed(
|
|
|
567
761
|
}
|
|
568
762
|
|
|
569
763
|
/** Centre a settled component on its own centroid and measure what it needs. */
|
|
570
|
-
function measure(part: Graph, anchor: { x: number; y: number } | null): PlacedComponent {
|
|
764
|
+
function measure(part: Graph, anchor: { x: number; y: number } | null, lobes: Disc[]): PlacedComponent {
|
|
571
765
|
const ids = part.nodes();
|
|
572
766
|
const xs = new Float64Array(ids.length);
|
|
573
767
|
const ys = new Float64Array(ids.length);
|
|
@@ -594,6 +788,9 @@ function measure(part: Graph, anchor: { x: number; y: number } | null): PlacedCo
|
|
|
594
788
|
ids,
|
|
595
789
|
xs,
|
|
596
790
|
ys,
|
|
791
|
+
// Re-centred with the nodes, so a lobe keeps describing where its members
|
|
792
|
+
// actually are once the component is given a place.
|
|
793
|
+
lobes: lobes.map(lobe => ({ x: lobe.x - centreX, y: lobe.y - centreY, radius: lobe.radius })),
|
|
597
794
|
radius: Math.max(radius, 20),
|
|
598
795
|
// An anchored component keeps its old centroid; the drift the settle
|
|
599
796
|
// introduced is absorbed by re-centring rather than accumulating.
|
|
@@ -606,32 +803,51 @@ function measure(part: Graph, anchor: { x: number; y: number } | null): PlacedCo
|
|
|
606
803
|
/**
|
|
607
804
|
* Give every unanchored component a place, and separate any that overlap.
|
|
608
805
|
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
* cost two attempts.
|
|
806
|
+
* A store this feature has been running in for any length of time is ONE mass
|
|
807
|
+
* and a handful of stragglers, so the placement is built around that rather than
|
|
808
|
+
* around components being comparable: the largest holds the origin and does not
|
|
809
|
+
* move, the others are put just outside it, and the relaxation pushes apart
|
|
810
|
+
* whatever still collides. The silhouette is then decided by how big the mass is
|
|
811
|
+
* and how many stragglers there are, both of which are properties of the data.
|
|
616
812
|
*
|
|
617
813
|
* Anchored components do not move: they are where the user last saw them.
|
|
618
814
|
*/
|
|
619
815
|
function packComponents(placed: PlacedComponent[]): void {
|
|
620
816
|
if (placed.length === 0) return;
|
|
621
817
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
818
|
+
// THE LARGEST COMPONENT HOLDS THE ORIGIN, and the rest are placed around it.
|
|
819
|
+
//
|
|
820
|
+
// Both halves of that are corrections, and both came from the same measurement.
|
|
821
|
+
// Once a store has grown its components are not comparable: the measured graph
|
|
822
|
+
// is one of 2,036 memories, one of three, one of two, and twenty-six lone
|
|
823
|
+
// nodes. Scattering all of them into a box sized by TOTAL area — which is what
|
|
824
|
+
// this did — flung the giant half a box width, so it settled at (6960, 5095)
|
|
825
|
+
// and took the whole map off the origin with it, while every other placement
|
|
826
|
+
// in this file measures from the middle. It also threw the two tiny components
|
|
827
|
+
// tens of thousands of units out, which then set how far the map reached.
|
|
828
|
+
//
|
|
829
|
+
// So the biggest mass is pinned at the origin and marked as fixed, and the
|
|
830
|
+
// others are placed in a ring just outside it — near the thing they are small
|
|
831
|
+
// against, rather than lost in a box scaled to it. The relaxation below then
|
|
832
|
+
// resolves whatever still overlaps. `componentsOf` returns them largest first.
|
|
833
|
+
const movable = placed.filter(component => !component.anchored);
|
|
834
|
+
const anchorRadius = movable.length > 0 ? movable[0].radius : 0;
|
|
835
|
+
for (let i = 0; i < movable.length; i++) {
|
|
836
|
+
const component = movable[i];
|
|
837
|
+
if (i === 0) {
|
|
838
|
+
component.offsetX = 0;
|
|
839
|
+
component.offsetY = 0;
|
|
840
|
+
// Fixed for the relaxation too. Without this a three-node component
|
|
841
|
+
// landing on it pushes the mass — and the map — aside to make room.
|
|
842
|
+
component.anchored = true;
|
|
843
|
+
continue;
|
|
844
|
+
}
|
|
632
845
|
const jitter = jitterOf(component.ids[0]);
|
|
633
|
-
|
|
634
|
-
|
|
846
|
+
// Deterministic angle, and a radius just clear of the mass with enough
|
|
847
|
+
// variation that the satellites do not draw a circle around it.
|
|
848
|
+
const distance = anchorRadius + component.radius * (1.4 + 0.9 * ((jitter.y + 1) / 2));
|
|
849
|
+
component.offsetX = Math.cos(jitter.angle) * distance;
|
|
850
|
+
component.offsetY = Math.sin(jitter.angle) * distance;
|
|
635
851
|
}
|
|
636
852
|
|
|
637
853
|
/** Clear space between two components, as a fraction of the smaller radius. */
|
|
@@ -683,20 +899,38 @@ function packComponents(placed: PlacedComponent[]): void {
|
|
|
683
899
|
}
|
|
684
900
|
|
|
685
901
|
/**
|
|
686
|
-
* Place the nodes that connect to nothing,
|
|
902
|
+
* Place the nodes that connect to nothing, inside the field the lobes occupy.
|
|
903
|
+
*
|
|
904
|
+
* These were the ring. With no edges there is no force to arrange them, so under
|
|
905
|
+
* the old global gravity they all settled at one radius and drew a circle around
|
|
906
|
+
* everything else. Two attempts to fix that each failed in their own way, and
|
|
907
|
+
* both failures are why this is shaped as it is.
|
|
908
|
+
*
|
|
909
|
+
* A GRID OF FREE CELLS over the bounding RECTANGLE of the components, filled
|
|
910
|
+
* from the middle out, worked while the graph was many small components with
|
|
911
|
+
* gaps between them. It stopped working the moment the store became one
|
|
912
|
+
* connected mass: there is no interior gap left, so every free cell was a corner
|
|
913
|
+
* or an edge of the rectangle, and the lone nodes lined up along two sides of a
|
|
914
|
+
* box.
|
|
915
|
+
*
|
|
916
|
+
* A DISC OF THEIR OWN, sized from the component's reach, put them off the box —
|
|
917
|
+
* and made them the largest thing on the map. Measured on a real store their
|
|
918
|
+
* span was 40,998 against the clusters' 26,065, so the view fitted to THEM and
|
|
919
|
+
* zoomed the clusters, which are the thing worth looking at, down into a clump
|
|
920
|
+
* in one corner. Nodes that connect to nothing were setting the scale of
|
|
921
|
+
* everything that does.
|
|
687
922
|
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
*
|
|
923
|
+
* So there is no second field. The lobes ARE the field: a lone node is drawn
|
|
924
|
+
* somewhere inside it — angle and radius from its own id, the radius
|
|
925
|
+
* square-rooted so the draws are uniform over the AREA rather than bunched at
|
|
926
|
+
* the centre — and pushed clear if it lands on a lobe. It fills the gaps between
|
|
927
|
+
* the islands, and it cannot make the map larger than the islands already do.
|
|
693
928
|
*
|
|
694
|
-
*
|
|
695
|
-
* fine one would cost more than the question is worth.
|
|
929
|
+
* Deterministic: an id does not change, so neither does where its memory sits.
|
|
696
930
|
*/
|
|
697
|
-
function
|
|
931
|
+
function placeLoneNodes(
|
|
698
932
|
singletons: string[],
|
|
699
|
-
|
|
933
|
+
field: Disc[],
|
|
700
934
|
communities: Record<string, number>,
|
|
701
935
|
existing: Map<string, GraphLayoutRow>
|
|
702
936
|
): GraphLayoutRow[] {
|
|
@@ -708,10 +942,9 @@ function scatterSingletons(
|
|
|
708
942
|
* One that was already on the map stays exactly where it was.
|
|
709
943
|
*
|
|
710
944
|
* Anchoring these matters more than anchoring components, and measurement is
|
|
711
|
-
* what showed it: the free-cell grid
|
|
712
|
-
* ended up, so a single memory arriving anywhere
|
|
713
|
-
*
|
|
714
|
-
* pass moved a hundred of them clear across the map — the one thing a
|
|
945
|
+
* what showed it: the old free-cell grid was derived from where the components
|
|
946
|
+
* ended up, so a single memory arriving anywhere reassigned EVERY lone node. A
|
|
947
|
+
* warm pass moved a hundred of them clear across the map — the one thing a
|
|
715
948
|
* background pass must never do to a view somebody is reading.
|
|
716
949
|
*/
|
|
717
950
|
const ordered: string[] = [];
|
|
@@ -731,117 +964,73 @@ function scatterSingletons(
|
|
|
731
964
|
}
|
|
732
965
|
if (ordered.length === 0) return rows;
|
|
733
966
|
|
|
734
|
-
// Nothing else on the map —
|
|
735
|
-
//
|
|
736
|
-
if (
|
|
967
|
+
// Nothing else on the map — a field of their own, which is the only case where
|
|
968
|
+
// they set the scale, because there is nothing else to set it.
|
|
969
|
+
if (field.length === 0) {
|
|
737
970
|
const span = 120 * Math.sqrt(ordered.length);
|
|
738
971
|
for (const id of ordered) {
|
|
739
|
-
const
|
|
972
|
+
const draw = jitterOf(id);
|
|
973
|
+
const radius = span * Math.sqrt((draw.x + 1) / 2);
|
|
740
974
|
rows.push({
|
|
741
975
|
nodeId: id,
|
|
742
976
|
community: communities[id] ?? 0,
|
|
743
|
-
x:
|
|
744
|
-
y: (
|
|
977
|
+
x: Math.cos(draw.angle) * radius,
|
|
978
|
+
y: Math.sin(draw.angle) * radius,
|
|
745
979
|
placed: 1
|
|
746
980
|
});
|
|
747
981
|
}
|
|
748
982
|
return rows;
|
|
749
983
|
}
|
|
750
984
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
let
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
maxY = Math.max(maxY, component.offsetY + component.radius);
|
|
985
|
+
// The field's own centre and reach, taken from the lobes rather than from the
|
|
986
|
+
// origin: a component is re-centred on its own centroid and then given a
|
|
987
|
+
// place, so the origin is not where the map is.
|
|
988
|
+
let centreX = 0;
|
|
989
|
+
let centreY = 0;
|
|
990
|
+
for (const lobe of field) {
|
|
991
|
+
centreX += lobe.x;
|
|
992
|
+
centreY += lobe.y;
|
|
760
993
|
}
|
|
994
|
+
centreX /= field.length;
|
|
995
|
+
centreY /= field.length;
|
|
761
996
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
// components reached 7,996, which is the ring reappearing one layer out. Just
|
|
766
|
-
// enough air that a tightly packed store still has somewhere to put them.
|
|
767
|
-
const margin = 0.04 * Math.max(maxX - minX, maxY - minY);
|
|
768
|
-
minX -= margin;
|
|
769
|
-
maxX += margin;
|
|
770
|
-
minY -= margin;
|
|
771
|
-
maxY += margin;
|
|
772
|
-
|
|
773
|
-
// Roughly four candidate cells per node, which leaves enough free ones to
|
|
774
|
-
// spread across after the occupied ones are struck out.
|
|
775
|
-
const columns = Math.max(4, Math.round(Math.sqrt(ordered.length * 4 * 1.45)));
|
|
776
|
-
const rowsCount = Math.max(4, Math.round(columns / 1.45));
|
|
777
|
-
const cellWidth = (maxX - minX) / columns;
|
|
778
|
-
const cellHeight = (maxY - minY) / rowsCount;
|
|
779
|
-
|
|
780
|
-
const free: { x: number; y: number; distance: number }[] = [];
|
|
781
|
-
for (let column = 0; column < columns; column++) {
|
|
782
|
-
for (let row = 0; row < rowsCount; row++) {
|
|
783
|
-
const x = minX + (column + 0.5) * cellWidth;
|
|
784
|
-
const y = minY + (row + 0.5) * cellHeight;
|
|
785
|
-
|
|
786
|
-
let occupied = false;
|
|
787
|
-
for (const component of placed) {
|
|
788
|
-
const dx = x - component.offsetX;
|
|
789
|
-
const dy = y - component.offsetY;
|
|
790
|
-
if (dx * dx + dy * dy < component.radius * component.radius) {
|
|
791
|
-
occupied = true;
|
|
792
|
-
break;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
// And the lone nodes already anchored here, so an arrival does not land
|
|
796
|
-
// on top of one that has been sitting there since a previous pass.
|
|
797
|
-
if (!occupied) {
|
|
798
|
-
const reach = Math.min(cellWidth, cellHeight) * 0.5;
|
|
799
|
-
for (const row of rows) {
|
|
800
|
-
if (Math.abs(row.x - x) < reach && Math.abs(row.y - y) < reach) {
|
|
801
|
-
occupied = true;
|
|
802
|
-
break;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
if (occupied) continue;
|
|
807
|
-
free.push({ x, y, distance: Math.hypot(x, y) });
|
|
808
|
-
}
|
|
997
|
+
let reach = 0;
|
|
998
|
+
for (const lobe of field) {
|
|
999
|
+
reach = Math.max(reach, Math.hypot(lobe.x - centreX, lobe.y - centreY) + lobe.radius);
|
|
809
1000
|
}
|
|
810
1001
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1002
|
+
/** Clear space kept around a lobe a lone node was drawn on top of. */
|
|
1003
|
+
const CLEARANCE = 0.12;
|
|
1004
|
+
|
|
1005
|
+
for (const id of ordered) {
|
|
1006
|
+
const draw = jitterOf(id);
|
|
1007
|
+
const radius = reach * Math.sqrt((draw.x + 1) / 2);
|
|
1008
|
+
let x = centreX + Math.cos(draw.angle) * radius;
|
|
1009
|
+
let y = centreY + Math.sin(draw.angle) * radius;
|
|
1010
|
+
|
|
1011
|
+
// Nudged off any lobe it landed on, along the line out of that lobe's
|
|
1012
|
+
// centre. A lone memory drawn on top of a cluster reads as a member of it,
|
|
1013
|
+
// which is the one thing it is not. Bounded, because pushing off one lobe
|
|
1014
|
+
// can land it on the next.
|
|
1015
|
+
for (let attempt = 0; attempt < 8; attempt++) {
|
|
1016
|
+
const hit = field.find(lobe => Math.hypot(x - lobe.x, y - lobe.y) < lobe.radius);
|
|
1017
|
+
if (!hit) break;
|
|
1018
|
+
let dx = x - hit.x;
|
|
1019
|
+
let dy = y - hit.y;
|
|
1020
|
+
let distance = Math.hypot(dx, dy);
|
|
1021
|
+
if (distance < 1e-9) {
|
|
1022
|
+
// Dead centre of a lobe has no direction to leave by; take one from the
|
|
1023
|
+
// id, so it is still the same on every pass.
|
|
1024
|
+
dx = Math.cos(draw.angle);
|
|
1025
|
+
dy = Math.sin(draw.angle);
|
|
1026
|
+
distance = 1;
|
|
1027
|
+
}
|
|
1028
|
+
const target = hit.radius * (1 + CLEARANCE);
|
|
1029
|
+
x = hit.x + (dx / distance) * target;
|
|
1030
|
+
y = hit.y + (dy / distance) * target;
|
|
828
1031
|
}
|
|
829
1032
|
|
|
830
|
-
|
|
831
|
-
// fill the gaps between the components rather than reaching for the edge.
|
|
832
|
-
// Spreading across the whole list unconditionally was what sent them to the
|
|
833
|
-
// outermost cells even when the interior had room to spare.
|
|
834
|
-
const cell =
|
|
835
|
-
ordered.length <= free.length
|
|
836
|
-
? free[i]
|
|
837
|
-
: free[Math.floor((i * free.length) / ordered.length)];
|
|
838
|
-
rows.push({
|
|
839
|
-
nodeId: id,
|
|
840
|
-
community: communities[id] ?? 0,
|
|
841
|
-
x: cell.x + jitter.x * cellWidth * 0.4,
|
|
842
|
-
y: cell.y + jitter.y * cellHeight * 0.4,
|
|
843
|
-
placed: 1
|
|
844
|
-
});
|
|
1033
|
+
rows.push({ nodeId: id, community: communities[id] ?? 0, x, y, placed: 1 });
|
|
845
1034
|
}
|
|
846
1035
|
|
|
847
1036
|
return rows;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Retention — the bound on how large the graph may grow.
|
|
3
3
|
*
|
|
4
|
-
* The store has no natural bound. Every turn writes
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* number of turns the instance had ever served. That is fine for a week and
|
|
4
|
+
* The store has no natural bound. Every turn writes what it concluded, and
|
|
5
|
+
* without this nothing would ever remove any of it, so the graph would grow
|
|
6
|
+
* linearly with the number of turns the instance had ever served. That is fine for a week and
|
|
8
7
|
* untenable for a year: the vector scan, the FTS index and the graph view all
|
|
9
8
|
* degrade together, and the user's only recourse would be "Clear All Data".
|
|
10
9
|
*
|
|
@@ -43,30 +42,15 @@ const EVICT_BELOW_CONFIDENCE = 0.45;
|
|
|
43
42
|
/** How long an archived node is kept so it can still be restored. */
|
|
44
43
|
const PURGE_ARCHIVED_AFTER_DAYS = 60;
|
|
45
44
|
|
|
46
|
-
/**
|
|
47
|
-
* How long an unreferenced symbol or module node survives without being touched.
|
|
48
|
-
*
|
|
49
|
-
* Longer than the episodic window on purpose, because a structural node costs
|
|
50
|
-
* far less to be wrong about: re-observing a file re-creates its symbols on the
|
|
51
|
-
* next turn that touches it, at microseconds and with no model involved. What is
|
|
52
|
-
* being bounded here is not error, it is COUNT.
|
|
53
|
-
*/
|
|
54
|
-
const PRUNE_STRUCTURAL_AFTER_DAYS = 120;
|
|
55
|
-
|
|
56
45
|
/** Work done per pass, so maintenance never becomes a long stall. */
|
|
57
46
|
const BATCH = 200;
|
|
58
47
|
|
|
59
|
-
/** Structural rows removed per pass — a bigger batch, because it is a plain delete. */
|
|
60
|
-
const STRUCTURAL_BATCH = 1_000;
|
|
61
|
-
|
|
62
48
|
/** Queue entries that outlived any chance of being summarised usefully. */
|
|
63
49
|
const QUEUE_MAX_AGE_DAYS = 14;
|
|
64
50
|
|
|
65
51
|
export interface RetentionResult {
|
|
66
52
|
evicted: number;
|
|
67
53
|
purged: number;
|
|
68
|
-
/** Symbol/module nodes no memory referred to, removed to bound growth. */
|
|
69
|
-
structural: number;
|
|
70
54
|
/** Extraction queue rows dropped as orphaned or stale. */
|
|
71
55
|
queue: number;
|
|
72
56
|
}
|
|
@@ -80,7 +64,7 @@ export interface RetentionResult {
|
|
|
80
64
|
* separated by sixty days, before it is actually gone.
|
|
81
65
|
*/
|
|
82
66
|
export function applyRetention(): RetentionResult {
|
|
83
|
-
const result: RetentionResult = { evicted: 0, purged: 0,
|
|
67
|
+
const result: RetentionResult = { evicted: 0, purged: 0, queue: 0 };
|
|
84
68
|
|
|
85
69
|
try {
|
|
86
70
|
const candidates = graphQueries.evictionCandidates({
|
|
@@ -92,31 +76,17 @@ export function applyRetention(): RetentionResult {
|
|
|
92
76
|
result.evicted = graphQueries.archiveNodes(candidates.map(node => node.id));
|
|
93
77
|
result.purged = graphQueries.purgeArchived(PURGE_ARCHIVED_AFTER_DAYS, BATCH);
|
|
94
78
|
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
// file's symbols,
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
// severing that edge would break the join both halves exist for.
|
|
103
|
-
//
|
|
104
|
-
// The vector cache is deliberately NOT reset here. Structural nodes are never
|
|
105
|
-
// vector-indexed, and even a stale entry left by an older build can only
|
|
106
|
-
// occupy a slot — candidates come from SQL, so nothing the cache no longer
|
|
107
|
-
// has a row for is ever asked about. Reloading a quarter of a million vectors
|
|
108
|
-
// on every retention tick to tidy that would be the expensive half of a
|
|
109
|
-
// problem that does not exist.
|
|
110
|
-
result.structural = graphQueries.pruneStructural({
|
|
111
|
-
maxAgeDays: PRUNE_STRUCTURAL_AFTER_DAYS,
|
|
112
|
-
limit: STRUCTURAL_BATCH
|
|
113
|
-
});
|
|
114
|
-
if (result.evicted > 0 || result.purged > 0 || result.structural > 0) {
|
|
79
|
+
// A pass that removed the codebase half used to run here too, and it was by
|
|
80
|
+
// far the largest term: a node per changed file, per directory and up to
|
|
81
|
+
// twenty-five per file's symbols, every turn. Migration 076 removed the half
|
|
82
|
+
// rather than the growth, so what is left to bound is the memories — which
|
|
83
|
+
// grow with what was CONCLUDED rather than with what was touched, and are
|
|
84
|
+
// therefore bounded by the work itself.
|
|
85
|
+
if (result.evicted > 0 || result.purged > 0) {
|
|
115
86
|
notifyGraphChanged('retention');
|
|
116
87
|
debug.log(
|
|
117
88
|
'memory',
|
|
118
|
-
`Retention: archived ${result.evicted}, removed ${result.purged} archived
|
|
119
|
-
`${result.structural} unreferenced code node(s)`
|
|
89
|
+
`Retention: archived ${result.evicted}, removed ${result.purged} archived node(s)`
|
|
120
90
|
);
|
|
121
91
|
}
|
|
122
92
|
} catch (error) {
|