@titan-design/code-graph 0.1.0 → 0.2.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/README.md +209 -15
- package/dist/change-coupling-CyqHgRsm.d.ts +73 -0
- package/dist/chunk-PFI5XMUG.js +332 -0
- package/dist/chunk-PFI5XMUG.js.map +1 -0
- package/dist/history/index.d.ts +56 -0
- package/dist/history/index.js +29 -0
- package/dist/history/index.js.map +1 -0
- package/dist/index.d.ts +583 -38
- package/dist/index.js +1904 -216
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Db, Migration } from '@titan-design/store-sqlite';
|
|
2
|
-
import {
|
|
2
|
+
import { Extractor, ParsedFile } from '@titan-design/code-parser';
|
|
3
|
+
export { Extractor, ParsedFile, getLanguageFromPath, getSupportedLanguages, parseFile, shouldIncludeFile } from '@titan-design/code-parser';
|
|
3
4
|
import { Project } from 'ts-morph';
|
|
5
|
+
import { c as CoEditPair, a as ChurnWindow, C as ChurnEntry } from './change-coupling-CyqHgRsm.js';
|
|
6
|
+
import { Embedder } from '@titan-design/embed';
|
|
4
7
|
|
|
5
8
|
type NodeKind = "package" | "module" | "file" | "symbol" | "external";
|
|
6
9
|
type EdgeKind = "imports" | "re-exports" | "calls" | "extends" | "implements" | "references" | "depends-on";
|
|
7
|
-
|
|
10
|
+
/** `requalify` maps a bare-name symbol id from before index version 0.14.0 to its scope-qualified successor. */
|
|
11
|
+
type IdAliasReason = "rename" | "move" | "merge" | "requalify";
|
|
8
12
|
type NodeRole = "test" | "fixture" | "barrel" | "types" | "config" | "script" | "entry" | "generated" | "source";
|
|
9
13
|
interface GraphNode {
|
|
10
14
|
id: string;
|
|
@@ -123,13 +127,15 @@ declare const KIT: {
|
|
|
123
127
|
*/
|
|
124
128
|
declare const DOMAIN_DDL = "\n CREATE TABLE IF NOT EXISTS edge (\n snapshot_id INTEGER NOT NULL,\n src_id TEXT NOT NULL,\n dst_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n attrs TEXT,\n PRIMARY KEY (snapshot_id, src_id, dst_id, kind)\n );\n CREATE INDEX IF NOT EXISTS idx_edge_dst ON edge(snapshot_id, dst_id);\n CREATE INDEX IF NOT EXISTS idx_edge_kind ON edge(snapshot_id, kind);\n\n CREATE TABLE IF NOT EXISTS metric (\n snapshot_id INTEGER NOT NULL,\n node_id TEXT NOT NULL,\n name TEXT NOT NULL,\n value REAL,\n unit TEXT,\n PRIMARY KEY (snapshot_id, node_id, name)\n );\n CREATE INDEX IF NOT EXISTS idx_metric_name ON metric(snapshot_id, name);\n\n CREATE TABLE IF NOT EXISTS id_alias (\n snapshot_id INTEGER NOT NULL,\n old_id TEXT NOT NULL,\n new_id TEXT NOT NULL,\n reason TEXT NOT NULL,\n PRIMARY KEY (snapshot_id, old_id, new_id)\n );\n\n CREATE TABLE IF NOT EXISTS file_fingerprint (\n snapshot_id INTEGER NOT NULL,\n file_id TEXT NOT NULL,\n content_hash TEXT NOT NULL,\n structural_hash TEXT,\n PRIMARY KEY (snapshot_id, file_id)\n );\n";
|
|
125
129
|
declare const MIGRATIONS: Migration[];
|
|
130
|
+
/** The top of this package's schema. A code graph database is never shared, so this is the top of one. */
|
|
131
|
+
declare const SCHEMA_VERSION: number;
|
|
126
132
|
|
|
127
133
|
/**
|
|
128
134
|
* Bumping this invalidates every reuse basis: a snapshot written by a different
|
|
129
|
-
* index version is never reused, so a change to node/edge shape
|
|
130
|
-
* carried forward from an incompatible graph.
|
|
135
|
+
* index version is never reused, so a change to node/edge shape or to a metric's
|
|
136
|
+
* value for the same bytes can never be carried forward from an incompatible graph.
|
|
131
137
|
*/
|
|
132
|
-
declare const INDEX_VERSION = "0.
|
|
138
|
+
declare const INDEX_VERSION = "0.14.0";
|
|
133
139
|
interface IndexOptions {
|
|
134
140
|
/** Roots to walk. Node ids are still rooted at the git toplevel, so importers across roots share an id space. */
|
|
135
141
|
paths: string[];
|
|
@@ -145,6 +151,14 @@ interface IndexOptions {
|
|
|
145
151
|
* reason to disable it is to rebuild from scratch.
|
|
146
152
|
*/
|
|
147
153
|
incremental?: boolean;
|
|
154
|
+
/** Git churn, recency, and ownership metrics. Defaults to `true`; history is skipped silently outside git. */
|
|
155
|
+
computeChurn?: boolean;
|
|
156
|
+
/** Primary churn window in days (default 30); scopes ownership. */
|
|
157
|
+
churnWindowDays?: number;
|
|
158
|
+
/** Windows to store churn for (default 30, 90, 180); the primary window is always included. */
|
|
159
|
+
churnWindows?: number[];
|
|
160
|
+
/** Also store an all-time `lifetime` churn and ownership window over full git history. */
|
|
161
|
+
lifetime?: boolean;
|
|
148
162
|
}
|
|
149
163
|
interface IndexResult {
|
|
150
164
|
snapshotId: number;
|
|
@@ -170,23 +184,6 @@ interface IndexResult {
|
|
|
170
184
|
*/
|
|
171
185
|
declare function indexPaths(store: CodeGraphStore, options: IndexOptions): Promise<IndexResult>;
|
|
172
186
|
|
|
173
|
-
interface ParsedFile {
|
|
174
|
-
tree: Tree;
|
|
175
|
-
content: string;
|
|
176
|
-
filePath: string;
|
|
177
|
-
language: string;
|
|
178
|
-
}
|
|
179
|
-
interface Extractor<T> {
|
|
180
|
-
name: string;
|
|
181
|
-
extract(file: ParsedFile): T[];
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
declare function parseFile(content: string, filePath: string, language: string): Promise<ParsedFile>;
|
|
185
|
-
declare function getSupportedLanguages(): string[];
|
|
186
|
-
|
|
187
|
-
declare function shouldIncludeFile(filePath: string, languages: string[]): boolean;
|
|
188
|
-
declare function getLanguageFromPath(filePath: string): string | null;
|
|
189
|
-
|
|
190
187
|
interface LanguageExtractorOptions {
|
|
191
188
|
repoRoot: string;
|
|
192
189
|
tsConfigPath?: string;
|
|
@@ -298,10 +295,10 @@ declare function moduleId(repoRoot: string, absPath: string): string;
|
|
|
298
295
|
declare function parentModuleId(id: string): string | null;
|
|
299
296
|
declare function packageId(name: string): string;
|
|
300
297
|
declare const SYMBOL_ID_SEP = "#";
|
|
301
|
-
declare function symbolId(fileId: string,
|
|
298
|
+
declare function symbolId(fileId: string, qualifiedName: string): string;
|
|
302
299
|
/**
|
|
303
300
|
* Inverse of {@link symbolId}: split a `<fileId>#<name>` symbol id back into its
|
|
304
|
-
* declaring file and
|
|
301
|
+
* declaring file and qualified name. Returns null for an id with no separator (a
|
|
305
302
|
* plain file id), so callers can filter the symbol layer cleanly. `#` is illegal
|
|
306
303
|
* in both posix paths and JS identifiers, so the first occurrence is the split.
|
|
307
304
|
*/
|
|
@@ -368,15 +365,10 @@ interface LineSpan {
|
|
|
368
365
|
endLine: number;
|
|
369
366
|
}
|
|
370
367
|
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
* their complexity + coverage) even though nothing imports them. Names come from
|
|
376
|
-
* the same tree-sitter walk that computes complexity, so they never drift.
|
|
377
|
-
* Anonymous declarations (a default-exported arrow, inline callbacks) contribute
|
|
378
|
-
* no name and are skipped. A name declared more than once keeps its last span
|
|
379
|
-
* (overloads / same-named methods are rare; range lookup still resolves most).
|
|
368
|
+
* Qualified declared names mapped to their 1-based line span (C-63 coverage
|
|
369
|
+
* range-containment). One scope binds a name once, as TypeScript and Python do,
|
|
370
|
+
* so a getter/setter pair, a Python property's accessors, and `@overload` stubs
|
|
371
|
+
* share one entry; when a qualified name repeats, the last span wins.
|
|
380
372
|
*/
|
|
381
373
|
declare function collectDeclaredSpans(file: ParsedFile): Map<string, LineSpan>;
|
|
382
374
|
/** Declared names only — the Set view over {@link collectDeclaredSpans}. */
|
|
@@ -458,6 +450,8 @@ declare function canonicalMetricName(name: string): string;
|
|
|
458
450
|
declare function canonicalRole(name: string): NodeRole;
|
|
459
451
|
declare function canonicalEdgeKind(name: string): EdgeKind;
|
|
460
452
|
|
|
453
|
+
declare function detectGitToplevel(cwd: string): string | null;
|
|
454
|
+
|
|
461
455
|
interface RenamePair {
|
|
462
456
|
oldPath: string;
|
|
463
457
|
newPath: string;
|
|
@@ -471,7 +465,7 @@ interface DetectRenamesOptions {
|
|
|
471
465
|
}
|
|
472
466
|
declare function detectGitHead(repoRoot: string): string | null;
|
|
473
467
|
declare function isInsideGitRepo(repoRoot: string): boolean;
|
|
474
|
-
|
|
468
|
+
|
|
475
469
|
declare function detectRenames(options: DetectRenamesOptions): RenamePair[];
|
|
476
470
|
declare function buildAliases(repoRoot: string, pairs: readonly RenamePair[]): IdAlias[];
|
|
477
471
|
|
|
@@ -494,6 +488,62 @@ declare const SOURCE_METRIC_NAMES: ReadonlySet<string>;
|
|
|
494
488
|
*/
|
|
495
489
|
declare function computeSourceMetrics(files: readonly ParsedFile[], fileIdOf: (filePath: string) => string, symbolNamesByFile?: ReadonlyMap<string, ReadonlySet<string>>): GraphMetric[];
|
|
496
490
|
|
|
491
|
+
/** How a test↔source pairing was inferred. */
|
|
492
|
+
type LinkMethod = "path" | "coedit";
|
|
493
|
+
interface TestSourceLink {
|
|
494
|
+
/** Node id of the test file. */
|
|
495
|
+
testId: string;
|
|
496
|
+
/** Node id of the (non-test) file it covers. */
|
|
497
|
+
sourceId: string;
|
|
498
|
+
method: LinkMethod;
|
|
499
|
+
}
|
|
500
|
+
interface LinkTestsOptions {
|
|
501
|
+
/** Minimum co-edit count for a pass-2 (coedit) link. Default 2. */
|
|
502
|
+
minCoEditCount?: number;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Two-pass test↔source linker. Pass 1 pairs each test file with non-test files
|
|
506
|
+
* matching its path conventions (high confidence). Pass 2 supplements tests
|
|
507
|
+
* left unpaired by pass 1 with their strongest co-edited non-test partner from
|
|
508
|
+
* change-coupling. Handles orphan tests (no pairing), orphan/untested sources
|
|
509
|
+
* (no incoming link), and one-to-many pairings (a test matching several
|
|
510
|
+
* sources, or a source covered by several tests).
|
|
511
|
+
*/
|
|
512
|
+
declare function linkTestsToSources(nodes: readonly GraphNode[], coEditPairs: readonly CoEditPair[], options?: LinkTestsOptions): TestSourceLink[];
|
|
513
|
+
/**
|
|
514
|
+
* Per-source coverage breadth: how many distinct test files link to each
|
|
515
|
+
* covered source. Emitted only for sources with at least one linked test.
|
|
516
|
+
*/
|
|
517
|
+
declare function testCoverageCountMetrics(links: readonly TestSourceLink[]): GraphMetric[];
|
|
518
|
+
/** Map each covered source to the set of test files that link to it. */
|
|
519
|
+
declare function groupTestsBySource(links: readonly TestSourceLink[]): Map<string, Set<string>>;
|
|
520
|
+
|
|
521
|
+
interface HistoryMetricsOptions {
|
|
522
|
+
/** Primary window: scopes ownership. Default 30. */
|
|
523
|
+
churnWindowDays?: number;
|
|
524
|
+
/** Windows to store churn and recency for; default {@link DEFAULT_CHURN_WINDOWS}, primary always included. */
|
|
525
|
+
churnWindows?: number[];
|
|
526
|
+
/** Also store an all-time `lifetime` window over full git history. */
|
|
527
|
+
includeLifetime?: boolean;
|
|
528
|
+
/** Epoch seconds that windows end at; defaults to the current time. */
|
|
529
|
+
nowEpoch?: number;
|
|
530
|
+
}
|
|
531
|
+
interface TestCoverageOwnershipOptions {
|
|
532
|
+
/** Window named in the metric suffix. Default 30. */
|
|
533
|
+
windowDays?: ChurnWindow;
|
|
534
|
+
/** Coverage threshold for bus factor (default 0.5 = 50% of churn). */
|
|
535
|
+
busFactorThreshold?: number;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Bus-factor / top-author-share of the *test coverage* for each source, keyed
|
|
539
|
+
* on the source node. Aggregates churn authorship across all test files linked
|
|
540
|
+
* to a source (via the two-pass linker) and summarises it the same way as
|
|
541
|
+
* production ownership — so a file can read as well-spread on production code
|
|
542
|
+
* yet a single-author silo on its tests (or vice versa). Emitted only for
|
|
543
|
+
* sources with at least one linked test that has churn in the window.
|
|
544
|
+
*/
|
|
545
|
+
declare function computeTestCoverageOwnership(entries: readonly ChurnEntry[], links: readonly TestSourceLink[], options?: TestCoverageOwnershipOptions): GraphMetric[];
|
|
546
|
+
|
|
497
547
|
interface IndexerMetricsInput {
|
|
498
548
|
nodes: Map<string, GraphNode>;
|
|
499
549
|
edges: Map<string, GraphEdge>;
|
|
@@ -502,6 +552,8 @@ interface IndexerMetricsInput {
|
|
|
502
552
|
/** Source metrics carried forward verbatim for reused (unchanged) files. */
|
|
503
553
|
reusedSourceMetrics: GraphMetric[];
|
|
504
554
|
idRoot: string;
|
|
555
|
+
/** Git-history metrics (churn, recency, ownership); omitted means none. */
|
|
556
|
+
history?: HistoryMetricsOptions;
|
|
505
557
|
}
|
|
506
558
|
/**
|
|
507
559
|
* Assemble the metric set for a snapshot: graph-wide degree metrics over the
|
|
@@ -510,12 +562,233 @@ interface IndexerMetricsInput {
|
|
|
510
562
|
* reused source metrics is recomputed over the full set, so the result matches a
|
|
511
563
|
* full index regardless of how much was reused.
|
|
512
564
|
*
|
|
513
|
-
* Git-history metrics
|
|
514
|
-
*
|
|
515
|
-
* the rest of codewatch's analyses.
|
|
565
|
+
* Git-history metrics come from the path-based engine in `./history/` through
|
|
566
|
+
* the `history-metrics.ts` adapter. Test-coverage metrics run with or without it.
|
|
516
567
|
*/
|
|
517
568
|
declare function buildIndexerMetrics(input: IndexerMetricsInput): GraphMetric[];
|
|
518
569
|
|
|
570
|
+
/**
|
|
571
|
+
* Function-local dead-code metrics (C-65 Phase 1). Pure functions of one file's
|
|
572
|
+
* bytes — the same class as the source metrics in source-metrics.ts — so they
|
|
573
|
+
* ride the content-hash incremental reuse gate. Kept in their own module (not
|
|
574
|
+
* appended to source-metrics.ts) so the already-churn-hot source-metrics.ts is
|
|
575
|
+
* not touched; the reuse machinery folds these names in alongside
|
|
576
|
+
* SOURCE_METRIC_NAMES (see incremental.ts) and index-metrics.ts computes them
|
|
577
|
+
* fresh for (re)parsed files.
|
|
578
|
+
*/
|
|
579
|
+
declare const DEAD_CODE_METRIC_NAMES: ReadonlySet<string>;
|
|
580
|
+
/**
|
|
581
|
+
* Per-file dead-code metrics for TypeScript files. Emitted sparsely — only when
|
|
582
|
+
* a count is > 0 — so a clean file adds no rows (a full index and an incremental
|
|
583
|
+
* re-index therefore produce the identical metric set). Non-TypeScript files are
|
|
584
|
+
* skipped for now.
|
|
585
|
+
*/
|
|
586
|
+
declare function computeDeadCodeMetrics(files: readonly ParsedFile[], fileIdOf: (filePath: string) => string): GraphMetric[];
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Growth-risk / scaling-smell metrics (C-66 Phase 2). Cheap, function-local
|
|
590
|
+
* *heuristics* — NOT Big-O or a proven complexity class (real asymptotic
|
|
591
|
+
* inference is undecidable; see the roadmap's hard NO). Pure functions of one
|
|
592
|
+
* file's bytes, so they ride the content-hash incremental reuse gate, folded
|
|
593
|
+
* into the carry-forward set in incremental.ts alongside the source/dead-code
|
|
594
|
+
* metric names. Emitted sparsely (only when a smell is present).
|
|
595
|
+
*/
|
|
596
|
+
declare const GROWTH_RISK_METRIC_NAMES: ReadonlySet<string>;
|
|
597
|
+
/**
|
|
598
|
+
* Per-file growth-risk metrics for TS/Python files, all SMELLS not bounds:
|
|
599
|
+
* - `loop_depth` — max *lexical* loop nesting (triple-nested → 3), emitted at
|
|
600
|
+
* depth ≥ 2 (depth-2 loops over two *different* collections are actually linear).
|
|
601
|
+
* - `recursive_functions` — named functions that call themselves directly.
|
|
602
|
+
* - `search_in_loop` — linear-scan method calls (`.includes`/`.find`/…) inside a
|
|
603
|
+
* loop (an O(n) scan per iteration; `.includes` on a `Set` is O(1)).
|
|
604
|
+
* All emitted sparsely (only when present). Non-TS/Python files are skipped.
|
|
605
|
+
*/
|
|
606
|
+
declare function computeGrowthRiskMetrics(files: readonly ParsedFile[], fileIdOf: (filePath: string) => string): GraphMetric[];
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Coverage is a whole-suite DYNAMIC artifact — a function of *which tests ran*,
|
|
610
|
+
* not of any file's bytes — so it must NOT ride the content-hash reuse gate. It
|
|
611
|
+
* is emitted as a `coverage_pct` metric that is deliberately absent from every
|
|
612
|
+
* *_METRIC_NAMES reuse set, so an incremental index never carries it forward: a
|
|
613
|
+
* later index produces a snapshot with NO coverage until re-ingested. That is the
|
|
614
|
+
* overlay semantics — coverage is attached to the snapshot it was measured
|
|
615
|
+
* against and never inferred for another.
|
|
616
|
+
*/
|
|
617
|
+
declare const COVERAGE_METRIC_NAME = "coverage_pct";
|
|
618
|
+
/** Minimal Istanbul `coverage-final.json` shape we read (function-level). */
|
|
619
|
+
interface IstanbulFn {
|
|
620
|
+
loc: {
|
|
621
|
+
start: {
|
|
622
|
+
line: number;
|
|
623
|
+
};
|
|
624
|
+
end: {
|
|
625
|
+
line: number;
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
interface IstanbulFileCoverage {
|
|
630
|
+
fnMap: Record<string, IstanbulFn>;
|
|
631
|
+
/** Per-function hit counts, keyed to fnMap ids. */
|
|
632
|
+
f: Record<string, number>;
|
|
633
|
+
}
|
|
634
|
+
type IstanbulCoverage = Record<string, IstanbulFileCoverage>;
|
|
635
|
+
/** A symbol node's 1-based line span, for range-containment attribution. */
|
|
636
|
+
interface SymbolSpan {
|
|
637
|
+
id: string;
|
|
638
|
+
startLine: number;
|
|
639
|
+
endLine: number;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Attribute an Istanbul coverage report to graph nodes as `coverage_pct` metrics:
|
|
643
|
+
* one per covered FILE (covered functions / total functions), and one per SYMBOL
|
|
644
|
+
* a covered function maps into by RANGE containment (symbol spans) — matching
|
|
645
|
+
* by range, not name, so anonymous/mangled Istanbul function names are handled.
|
|
646
|
+
* A symbol spanning several functions (a class) reports its methods' coverage
|
|
647
|
+
* ratio. Files Istanbul reports but the graph doesn't know are skipped.
|
|
648
|
+
*/
|
|
649
|
+
declare function attributeCoverage(coverage: IstanbulCoverage, fileIdOf: (absPath: string) => string | null, symbolsByFile: ReadonlyMap<string, readonly SymbolSpan[]>): GraphMetric[];
|
|
650
|
+
|
|
651
|
+
interface PageRankOptions {
|
|
652
|
+
/** Per-node teleport weight. Unset or empty → uniform teleport across all nodes. */
|
|
653
|
+
personalization?: ReadonlyMap<string, number>;
|
|
654
|
+
/** Probability of following an edge vs teleporting (default 0.85). */
|
|
655
|
+
damping?: number;
|
|
656
|
+
/** L1 convergence threshold (default 1e-6). */
|
|
657
|
+
tolerance?: number;
|
|
658
|
+
/** Cap on power-iteration steps (default 100). */
|
|
659
|
+
maxIterations?: number;
|
|
660
|
+
/** Per-kind edge weight; missing kinds default to 1.0. */
|
|
661
|
+
edgeWeights?: Partial<Record<EdgeKind, number>>;
|
|
662
|
+
}
|
|
663
|
+
interface PageRankRow {
|
|
664
|
+
nodeId: string;
|
|
665
|
+
score: number;
|
|
666
|
+
}
|
|
667
|
+
interface PageRankResult {
|
|
668
|
+
/** Sorted descending by score; ties broken by node id ascending. */
|
|
669
|
+
rows: PageRankRow[];
|
|
670
|
+
iterations: number;
|
|
671
|
+
converged: boolean;
|
|
672
|
+
}
|
|
673
|
+
/** Edge weight used by PageRank for a given edge kind, honoring user overrides. */
|
|
674
|
+
declare function getEdgeWeight(kind: EdgeKind, overrides?: Partial<Record<EdgeKind, number>>): number;
|
|
675
|
+
declare function computePageRank(nodes: readonly GraphNode[], edges: readonly GraphEdge[], options?: PageRankOptions): PageRankResult;
|
|
676
|
+
|
|
677
|
+
interface RelevanceOptions {
|
|
678
|
+
/** Probability of following an edge vs teleporting back to the seeds (default 0.85). */
|
|
679
|
+
damping?: number;
|
|
680
|
+
/** Per-kind edge weight override, forwarded to PageRank. */
|
|
681
|
+
edgeWeights?: PageRankOptions["edgeWeights"];
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* C-89 — **seeded (personalized) PageRank as a relevance-to-target proximity
|
|
685
|
+
* measure** (Aider RepoMap-style). The teleport vector is concentrated on
|
|
686
|
+
* `seedIds`, so the stationary distribution scores every node by how tightly it
|
|
687
|
+
* couples to the seeds through the resolved dependency graph: near neighbours
|
|
688
|
+
* score high, decaying with graph distance. This is "relevance to what I'm
|
|
689
|
+
* looking at," distinct from global PageRank centrality ("globally famous"),
|
|
690
|
+
* which stays the no-seed cold path.
|
|
691
|
+
*
|
|
692
|
+
* The edge set is **symmetrized** (each edge added in both directions) so
|
|
693
|
+
* relevance flows to a target's callers AND its dependencies — a purely forward
|
|
694
|
+
* walk from the seed would only reach what the seed depends on, never who
|
|
695
|
+
* depends on it. Edge kind (and therefore weight) is preserved on the reversed
|
|
696
|
+
* copy, so a heavier `calls` edge stays heavier in both directions.
|
|
697
|
+
*
|
|
698
|
+
* Returns a Map from node id to relevance score (seeds included). An empty seed
|
|
699
|
+
* set returns an empty map — callers then fall back to global centrality.
|
|
700
|
+
*/
|
|
701
|
+
declare function computeRelevance(nodes: readonly GraphNode[], edges: readonly GraphEdge[], seedIds: readonly string[], options?: RelevanceOptions): Map<string, number>;
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Symbol-level change coupling (C-60). Decomposes a god-file the file-level
|
|
705
|
+
* coupling view rolls up as one blob (e.g. `types.ts`) into *which symbol* is
|
|
706
|
+
* used where. Built on the C-53 `references` edge substrate: `src` is the
|
|
707
|
+
* importing file, `dst` is the imported symbol node id (`<fileId>#<name>`).
|
|
708
|
+
*
|
|
709
|
+
* Two slices, both pure functions of the assembled reference edge set (a
|
|
710
|
+
* whole-graph rollup like utilization/PageRank, sound under incremental reuse
|
|
711
|
+
* since it reads the reassembled edges, not a per-file cache):
|
|
712
|
+
*
|
|
713
|
+
* - **Slice C — per-symbol consumers**: invert the edges by `dst`, giving the
|
|
714
|
+
* set of files that import each symbol. Directly answers "what IN this file is
|
|
715
|
+
* used where"; covers span-less types/consts that a git-hunk approach cannot.
|
|
716
|
+
* - **Slice B — co-import coupling**: group edges by `src`, and every pair of
|
|
717
|
+
* symbols co-imported by the same file is a coupling pair. Two symbols that
|
|
718
|
+
* are always imported together travel together — structural (used-together),
|
|
719
|
+
* drift-free coupling, as opposed to the temporal (changed-together) git
|
|
720
|
+
* co-edit signal.
|
|
721
|
+
*/
|
|
722
|
+
/** The minimal shape of a `references` edge this module consumes. */
|
|
723
|
+
interface ReferenceEdgeLite {
|
|
724
|
+
/** Importing file id. */
|
|
725
|
+
srcId: string;
|
|
726
|
+
/** Imported symbol node id (`<fileId>#<name>`). */
|
|
727
|
+
dstId: string;
|
|
728
|
+
}
|
|
729
|
+
/** One symbol's consumer set (Slice C). */
|
|
730
|
+
interface SymbolConsumers {
|
|
731
|
+
symbolId: string;
|
|
732
|
+
/** Declaring file, parsed from the symbol id. */
|
|
733
|
+
fileId: string;
|
|
734
|
+
/** Export name. */
|
|
735
|
+
name: string;
|
|
736
|
+
/** Distinct importing file ids, sorted. */
|
|
737
|
+
consumers: string[];
|
|
738
|
+
}
|
|
739
|
+
/** A pair of symbols co-imported by the same file (Slice B). */
|
|
740
|
+
interface SymbolCouplingPair {
|
|
741
|
+
aId: string;
|
|
742
|
+
aFile: string;
|
|
743
|
+
aName: string;
|
|
744
|
+
bId: string;
|
|
745
|
+
bFile: string;
|
|
746
|
+
bName: string;
|
|
747
|
+
/** Distinct files that import both symbols. */
|
|
748
|
+
coImports: number;
|
|
749
|
+
/** True when the two symbols are declared in different files. */
|
|
750
|
+
crossFile: boolean;
|
|
751
|
+
}
|
|
752
|
+
interface SymbolCouplingOptions {
|
|
753
|
+
/** Skip pairs co-imported by fewer than this many files. Default 2. */
|
|
754
|
+
minCoImports?: number;
|
|
755
|
+
/**
|
|
756
|
+
* Skip importing files that reference more than this many distinct symbols —
|
|
757
|
+
* a wide barrel-style importer would otherwise explode into O(n²) noise
|
|
758
|
+
* pairs, mirroring change-coupling's large-commit guard. Default 40.
|
|
759
|
+
*/
|
|
760
|
+
largeImporterThreshold?: number;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Group reference edges by imported symbol, yielding each symbol's distinct
|
|
764
|
+
* consuming files (Slice C). Sorted by consumer count desc, then symbol id, so
|
|
765
|
+
* the most broadly-depended-on exports lead.
|
|
766
|
+
*/
|
|
767
|
+
declare function computeSymbolConsumers(edges: readonly ReferenceEdgeLite[]): SymbolConsumers[];
|
|
768
|
+
/**
|
|
769
|
+
* Every pair of symbols co-imported by the same file becomes a coupling pair,
|
|
770
|
+
* counted by how many distinct files co-import them (Slice B). Wide importers
|
|
771
|
+
* are dropped to keep the pairing near-linear. Sorted by co-import count desc,
|
|
772
|
+
* cross-file pairs preferred at a tie (they are the actionable ones — a
|
|
773
|
+
* same-file pair is just cohesion within one module).
|
|
774
|
+
*/
|
|
775
|
+
declare function computeSymbolCoupling(edges: readonly ReferenceEdgeLite[], options?: SymbolCouplingOptions): SymbolCouplingPair[];
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* PageRank over one snapshot's file-level graph (symbol nodes and `references`
|
|
779
|
+
* edges excluded, as codewatch's `graph relevant` reads it). Pass
|
|
780
|
+
* `personalization` to seed the walk toward target node ids.
|
|
781
|
+
*/
|
|
782
|
+
declare function snapshotPageRank(store: CodeGraphStore, snapshotId: number, options?: PageRankOptions): PageRankResult;
|
|
783
|
+
/** Relevance of every file-level node to `seedIds`, as codewatch's `graph context` computes it. */
|
|
784
|
+
declare function snapshotRelevance(store: CodeGraphStore, snapshotId: number, seedIds: readonly string[], options?: RelevanceOptions): Map<string, number>;
|
|
785
|
+
/** The snapshot's `references` edges: importing file to imported symbol. */
|
|
786
|
+
declare function snapshotReferenceEdges(store: CodeGraphStore, snapshotId: number): ReferenceEdgeLite[];
|
|
787
|
+
/** Per-symbol consumer files for one snapshot. */
|
|
788
|
+
declare function snapshotSymbolConsumers(store: CodeGraphStore, snapshotId: number): SymbolConsumers[];
|
|
789
|
+
/** Co-import symbol coupling pairs for one snapshot. */
|
|
790
|
+
declare function snapshotSymbolCoupling(store: CodeGraphStore, snapshotId: number, options?: SymbolCouplingOptions): SymbolCouplingPair[];
|
|
791
|
+
|
|
519
792
|
/**
|
|
520
793
|
* The free-function reading surface named in the package API. Each delegates to
|
|
521
794
|
* the store's method of the same name, so a caller that only reads a snapshot
|
|
@@ -529,4 +802,276 @@ declare function listEdges(store: CodeGraphStore, snapshotId: number, opts?: {
|
|
|
529
802
|
}): GraphEdge[];
|
|
530
803
|
declare function listMetrics(store: CodeGraphStore, snapshotId: number): GraphMetric[];
|
|
531
804
|
|
|
532
|
-
|
|
805
|
+
type Severity = "error" | "warning";
|
|
806
|
+
interface MetricMaxRule {
|
|
807
|
+
type: "metric-max";
|
|
808
|
+
id: string;
|
|
809
|
+
metric: string;
|
|
810
|
+
max: number;
|
|
811
|
+
kind?: NodeKind;
|
|
812
|
+
severity?: Severity;
|
|
813
|
+
exclude?: string[];
|
|
814
|
+
excludeRoles?: NodeRole[];
|
|
815
|
+
}
|
|
816
|
+
interface MetricMinRule {
|
|
817
|
+
type: "metric-min";
|
|
818
|
+
id: string;
|
|
819
|
+
metric: string;
|
|
820
|
+
min: number;
|
|
821
|
+
kind?: NodeKind;
|
|
822
|
+
severity?: Severity;
|
|
823
|
+
exclude?: string[];
|
|
824
|
+
excludeRoles?: NodeRole[];
|
|
825
|
+
}
|
|
826
|
+
interface MetricProductMaxRule {
|
|
827
|
+
type: "metric-product-max";
|
|
828
|
+
id: string;
|
|
829
|
+
metrics: string[];
|
|
830
|
+
max: number;
|
|
831
|
+
kind?: NodeKind;
|
|
832
|
+
severity?: Severity;
|
|
833
|
+
exclude?: string[];
|
|
834
|
+
excludeRoles?: NodeRole[];
|
|
835
|
+
}
|
|
836
|
+
interface ForbidImportRule {
|
|
837
|
+
type: "forbid-import";
|
|
838
|
+
id: string;
|
|
839
|
+
from: string;
|
|
840
|
+
to: string;
|
|
841
|
+
severity?: Severity;
|
|
842
|
+
}
|
|
843
|
+
interface LayeredDepsRule {
|
|
844
|
+
type: "layered-deps";
|
|
845
|
+
id: string;
|
|
846
|
+
layers: string[][];
|
|
847
|
+
severity?: Severity;
|
|
848
|
+
}
|
|
849
|
+
interface NoInternalOnlyBarrelsRule {
|
|
850
|
+
type: "no-internal-only-barrels";
|
|
851
|
+
id: string;
|
|
852
|
+
/** Path prefixes marking package roots; node ids carry no intrinsic package membership. */
|
|
853
|
+
packageRoots: string[];
|
|
854
|
+
severity?: Severity;
|
|
855
|
+
/** Globs or substrings to skip, such as CLI bin entries the role classifier calls barrels. */
|
|
856
|
+
exclude?: string[];
|
|
857
|
+
}
|
|
858
|
+
type CheckRule = MetricMaxRule | MetricMinRule | MetricProductMaxRule | ForbidImportRule | LayeredDepsRule | NoInternalOnlyBarrelsRule;
|
|
859
|
+
interface CheckRulesFile {
|
|
860
|
+
rules: CheckRule[];
|
|
861
|
+
}
|
|
862
|
+
interface CheckViolation {
|
|
863
|
+
ruleId: string;
|
|
864
|
+
severity: Severity;
|
|
865
|
+
nodeId: string;
|
|
866
|
+
message: string;
|
|
867
|
+
metric?: string;
|
|
868
|
+
value?: number;
|
|
869
|
+
threshold?: number;
|
|
870
|
+
destinationId?: string;
|
|
871
|
+
isCarryover?: boolean;
|
|
872
|
+
}
|
|
873
|
+
interface CheckResult {
|
|
874
|
+
snapshotId: number;
|
|
875
|
+
baselineSnapshotId?: number;
|
|
876
|
+
rulesEvaluated: number;
|
|
877
|
+
nodesEvaluated: number;
|
|
878
|
+
violations: CheckViolation[];
|
|
879
|
+
newErrors: number;
|
|
880
|
+
newWarnings: number;
|
|
881
|
+
carryoverErrors: number;
|
|
882
|
+
carryoverWarnings: number;
|
|
883
|
+
passed: boolean;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
interface RunChecksOptions {
|
|
887
|
+
snapshotId: number;
|
|
888
|
+
rules: readonly CheckRule[];
|
|
889
|
+
baselineSnapshotId?: number;
|
|
890
|
+
}
|
|
891
|
+
declare function runChecks(store: CodeGraphStore, options: RunChecksOptions): CheckResult;
|
|
892
|
+
|
|
893
|
+
interface ValidateRulesOptions {
|
|
894
|
+
/** Called with a human-readable message when a deprecated alias is healed. */
|
|
895
|
+
onWarn?: (message: string) => void;
|
|
896
|
+
}
|
|
897
|
+
declare function validateRules(input: unknown, options?: ValidateRulesOptions): readonly CheckRule[];
|
|
898
|
+
|
|
899
|
+
/** A snapshot id, or a ref name resolved to that ref's newest snapshot. */
|
|
900
|
+
type SnapshotSpec = number | string;
|
|
901
|
+
interface CheckSnapshotOptions {
|
|
902
|
+
snapshot: SnapshotSpec;
|
|
903
|
+
rules: readonly CheckRule[];
|
|
904
|
+
baseline?: SnapshotSpec;
|
|
905
|
+
}
|
|
906
|
+
interface CheckSnapshotResult {
|
|
907
|
+
snapshot: SnapshotRow;
|
|
908
|
+
baselineSnapshot?: SnapshotRow;
|
|
909
|
+
result: CheckResult;
|
|
910
|
+
}
|
|
911
|
+
declare function resolveSnapshot(store: CodeGraphStore, spec: SnapshotSpec): SnapshotRow;
|
|
912
|
+
/** Check one snapshot against a rule set, marking violations already present in the baseline as carryover. */
|
|
913
|
+
declare function checkSnapshot(store: CodeGraphStore, options: CheckSnapshotOptions): CheckSnapshotResult;
|
|
914
|
+
/** Read and validate a `check.json` rules file; deprecated aliases heal through `onWarn`. */
|
|
915
|
+
declare function loadCheckRules(path: string, options?: ValidateRulesOptions): Promise<readonly CheckRule[]>;
|
|
916
|
+
|
|
917
|
+
interface MetricDelta {
|
|
918
|
+
nodeId: string;
|
|
919
|
+
name: string;
|
|
920
|
+
before: number | null;
|
|
921
|
+
after: number | null;
|
|
922
|
+
delta: number | null;
|
|
923
|
+
}
|
|
924
|
+
interface NodeRename {
|
|
925
|
+
oldId: string;
|
|
926
|
+
newId: string;
|
|
927
|
+
reason: IdAliasReason;
|
|
928
|
+
node: GraphNode;
|
|
929
|
+
}
|
|
930
|
+
interface GraphDiffSummary {
|
|
931
|
+
fromSnapshotId: number;
|
|
932
|
+
toSnapshotId: number;
|
|
933
|
+
addedNodes: number;
|
|
934
|
+
removedNodes: number;
|
|
935
|
+
renamedNodes: number;
|
|
936
|
+
unchangedNodes: number;
|
|
937
|
+
addedEdges: number;
|
|
938
|
+
removedEdges: number;
|
|
939
|
+
metricChanges: number;
|
|
940
|
+
}
|
|
941
|
+
interface GraphDiff {
|
|
942
|
+
summary: GraphDiffSummary;
|
|
943
|
+
addedNodes: GraphNode[];
|
|
944
|
+
removedNodes: GraphNode[];
|
|
945
|
+
renamedNodes: NodeRename[];
|
|
946
|
+
addedEdges: GraphEdge[];
|
|
947
|
+
removedEdges: GraphEdge[];
|
|
948
|
+
metricDeltas: MetricDelta[];
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
interface DiffSnapshotsOptions {
|
|
952
|
+
fromSnapshotId: number;
|
|
953
|
+
toSnapshotId: number;
|
|
954
|
+
}
|
|
955
|
+
/** Structural diff of two snapshots; the to-snapshot's id aliases carry renamed nodes across so a move is not a delete plus an add. */
|
|
956
|
+
declare function diffSnapshots(store: CodeGraphStore, options: DiffSnapshotsOptions): GraphDiff;
|
|
957
|
+
|
|
958
|
+
interface UnchangedViolation {
|
|
959
|
+
from: CheckViolation;
|
|
960
|
+
to: CheckViolation;
|
|
961
|
+
delta: number | null;
|
|
962
|
+
}
|
|
963
|
+
interface CheckDiff {
|
|
964
|
+
fromSnapshotId: number;
|
|
965
|
+
toSnapshotId: number;
|
|
966
|
+
rulesEvaluated: number;
|
|
967
|
+
newViolations: CheckViolation[];
|
|
968
|
+
resolvedViolations: CheckViolation[];
|
|
969
|
+
unchanged: UnchangedViolation[];
|
|
970
|
+
worsened: UnchangedViolation[];
|
|
971
|
+
improved: UnchangedViolation[];
|
|
972
|
+
}
|
|
973
|
+
interface DiffCheckResultsOptions {
|
|
974
|
+
fromSnapshotId: number;
|
|
975
|
+
toSnapshotId: number;
|
|
976
|
+
rules: readonly CheckRule[];
|
|
977
|
+
}
|
|
978
|
+
/** Run the rules on both snapshots and bucket each violation as new, resolved, or unchanged (worsened or improved by value). */
|
|
979
|
+
declare function diffCheckResults(store: CodeGraphStore, options: DiffCheckResultsOptions): CheckDiff;
|
|
980
|
+
|
|
981
|
+
interface EmbeddableSymbol {
|
|
982
|
+
id: string;
|
|
983
|
+
name: string;
|
|
984
|
+
file: string;
|
|
985
|
+
signature: string;
|
|
986
|
+
purpose?: string;
|
|
987
|
+
text: string;
|
|
988
|
+
textHash: string;
|
|
989
|
+
}
|
|
990
|
+
interface EmbedCoverage {
|
|
991
|
+
/** Embeddable exported symbols in the snapshot. */
|
|
992
|
+
symbols: number;
|
|
993
|
+
/** How many symbols have a stored vector for this model. */
|
|
994
|
+
embedded: number;
|
|
995
|
+
/** How many carry docstring purpose text (where recall is strongest). */
|
|
996
|
+
withPurpose: number;
|
|
997
|
+
}
|
|
998
|
+
interface EmbedSnapshotResult extends EmbedCoverage {
|
|
999
|
+
model: string;
|
|
1000
|
+
/** Unique new texts sent to the embedder (symbols can share a text). */
|
|
1001
|
+
newlyEmbedded: number;
|
|
1002
|
+
/** Symbols whose vector was already stored (content-addressed cache hits). */
|
|
1003
|
+
reused: number;
|
|
1004
|
+
}
|
|
1005
|
+
/** Outcome of the non-fatal indexing pass: a down backend is reported, never thrown. */
|
|
1006
|
+
type EmbedAttempt = {
|
|
1007
|
+
ok: true;
|
|
1008
|
+
result: EmbedSnapshotResult;
|
|
1009
|
+
} | {
|
|
1010
|
+
ok: false;
|
|
1011
|
+
model: string;
|
|
1012
|
+
error: string;
|
|
1013
|
+
};
|
|
1014
|
+
interface SimilarCandidate {
|
|
1015
|
+
id: string;
|
|
1016
|
+
name: string;
|
|
1017
|
+
file: string;
|
|
1018
|
+
signature: string;
|
|
1019
|
+
purpose?: string;
|
|
1020
|
+
/** Cosine similarity to the query, in [-1, 1]. */
|
|
1021
|
+
score: number;
|
|
1022
|
+
}
|
|
1023
|
+
interface SimilarResult {
|
|
1024
|
+
query: string;
|
|
1025
|
+
model: string;
|
|
1026
|
+
coverage: EmbedCoverage;
|
|
1027
|
+
candidates: SimilarCandidate[];
|
|
1028
|
+
}
|
|
1029
|
+
/** Query prefixes are the embedder's to apply; configure them with its `prefixes` option. */
|
|
1030
|
+
interface FindSimilarOptions {
|
|
1031
|
+
limit?: number;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/** Mirrors the gate harness: purpose text is appended to the signature when present. */
|
|
1035
|
+
declare function buildEmbedText(signature: string, purpose?: string | null): string;
|
|
1036
|
+
declare function hashEmbedText(text: string): string;
|
|
1037
|
+
/**
|
|
1038
|
+
* The embeddable corpus of a snapshot: exported symbols that carry a signature,
|
|
1039
|
+
* excluding test/fixture/generated code (matching the validated gate corpus).
|
|
1040
|
+
*/
|
|
1041
|
+
declare function listEmbeddableSymbols(store: CodeGraphStore, snapshotId: number): EmbeddableSymbol[];
|
|
1042
|
+
|
|
1043
|
+
/** The blob_cache namespace for symbol vectors; the model column holds `embedder.model`, which names the vector space including its prefixes. */
|
|
1044
|
+
declare const SYMBOL_EMBEDDING_NAMESPACE = "code-graph/symbol-embedding";
|
|
1045
|
+
interface CachedEmbedResult {
|
|
1046
|
+
/** L2-normalized vectors for every input text, keyed by its text hash. */
|
|
1047
|
+
byHash: Map<string, number[]>;
|
|
1048
|
+
/** Hashes that had no stored vector and were embedded on this call. */
|
|
1049
|
+
newHashes: Set<string>;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Embed texts through the content-addressed store: only texts whose hash has
|
|
1053
|
+
* no vector for this model reach the embedder; new vectors are normalized and
|
|
1054
|
+
* persisted batch by batch so the next call (or a retry after a failure) is a cache hit.
|
|
1055
|
+
*/
|
|
1056
|
+
declare function embedTextsCached(store: CodeGraphStore, embedder: Embedder, texts: readonly string[]): Promise<CachedEmbedResult>;
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* Precompute capability embeddings for a snapshot. Only texts whose hash has no
|
|
1060
|
+
* stored vector are sent to the embedder, so re-runs and unchanged symbols cost
|
|
1061
|
+
* nothing: the content-addressed store is the incremental-reuse mechanism.
|
|
1062
|
+
*/
|
|
1063
|
+
declare function embedSnapshot(store: CodeGraphStore, snapshotId: number, embedder: Embedder): Promise<EmbedSnapshotResult>;
|
|
1064
|
+
/**
|
|
1065
|
+
* The post-index pass. A backend failure (ollama down, model missing) must not
|
|
1066
|
+
* fail the index: the snapshot is already persisted and valid without vectors.
|
|
1067
|
+
*/
|
|
1068
|
+
declare function tryEmbedSnapshot(store: CodeGraphStore, snapshotId: number, embedder: Embedder): Promise<EmbedAttempt>;
|
|
1069
|
+
/**
|
|
1070
|
+
* The query-time "about to write X: does it exist?" surface. Embeds the query
|
|
1071
|
+
* (an intent sentence, a pseudo-signature, or both as `sig -- intent`), ranks
|
|
1072
|
+
* the snapshot's embedded symbols by cosine similarity, and returns the top-K
|
|
1073
|
+
* with coverage so the caller can weigh how much of the repo was searchable.
|
|
1074
|
+
*/
|
|
1075
|
+
declare function findSimilarCapability(store: CodeGraphStore, snapshotId: number, query: string, embedder: Embedder, opts?: FindSimilarOptions): Promise<SimilarResult>;
|
|
1076
|
+
|
|
1077
|
+
export { ALL_ROLES, COVERAGE_METRIC_NAME, type CachedEmbedResult, type CheckDiff, type CheckResult, type CheckRule, type CheckRulesFile, type CheckSnapshotOptions, type CheckSnapshotResult, type CheckViolation, CodeGraphStore, DEAD_CODE_METRIC_NAMES, DOMAIN_DDL, type DiffCheckResultsOptions, type DiffSnapshotsOptions, type EdgeKind, type EmbedAttempt, type EmbedCoverage, type EmbedSnapshotResult, type EmbeddableSymbol, type FileFingerprint, type FindSimilarOptions, type ForbidImportRule, GROWTH_RISK_METRIC_NAMES, type GraphDiff, type GraphDiffSummary, type GraphEdge, type GraphFragment, type GraphMetric, type GraphNode, INDEX_VERSION, type IdAlias, type IdAliasReason, type IndexOptions, type IndexResult, type IstanbulCoverage, KIT, LanguageExtractor, type LanguageExtractorOptions, type LayeredDepsRule, type LineSpan, type LinkMethod, type LinkTestsOptions, MIGRATIONS, type MetricDelta, type MetricMaxRule, type MetricMinRule, type MetricProductMaxRule, type NoInternalOnlyBarrelsRule, type NodeKind, type NodeRename, type NodeRole, type PageRankOptions, type PageRankResult, type PageRankRow, PythonGraphExtractor, type ReadFile, type ReferenceEdgeLite, type RelevanceOptions, type ReuseBasis, type RunChecksOptions, SCHEMA_VERSION, SOURCE_METRIC_NAMES, SYMBOL_EMBEDDING_NAMESPACE, SYMBOL_ID_SEP, type Severity, type SimilarCandidate, type SimilarResult, type SnapshotInsert, type SnapshotRow, type SnapshotSpec, type SourceLanguage, type SymbolConsumers, type SymbolCouplingOptions, type SymbolCouplingPair, type SymbolSpan, type TestCoverageOwnershipOptions, type TestSourceLink, TsMorphGraphExtractor, type TsMorphGraphExtractorOptions, type UnchangedViolation, type ValidateRulesOptions, annotateRoles, attributeCoverage, buildAliases, buildEmbedText, buildFileModuleNodes, buildIndexerMetrics, canonicalEdgeKind, canonicalMetricName, canonicalRole, checkSnapshot, classifyRole, collectDeclaredNames, collectDeclaredSpans, computeDeadCodeMetrics, computeGrowthRiskMetrics, computeMetrics, computePageRank, computeRelevance, computeRoleHints, computeSourceMetrics, computeSymbolConsumers, computeSymbolCoupling, computeTestCoverageOwnership, detectGitHead, detectGitToplevel, detectRenames, diffCheckResults, diffSnapshots, edgeWeight, embedSnapshot, embedTextsCached, externalId, fileId, findSimilarCapability, getEdgeWeight, groupTestsBySource, hashContent, hashEmbedText, indexPaths, isGeneratedByHeuristic, isGeneratedFile, isInsideGitRepo, linkTestsToSources, listEdges, listEmbeddableSymbols, listMetrics, listNodes, loadCheckRules, loadGeneratedPatterns, moduleId, openCodeGraph, packageId, parentModuleId, parseSymbolId, pruneDanglingReferences, readSourceFiles, resolveBarrelEdges, resolveSnapshot, runChecks, snapshotPageRank, snapshotReferenceEdges, snapshotRelevance, snapshotSymbolConsumers, snapshotSymbolCoupling, structuralSignature, symbolId, testCoverageCountMetrics, tryEmbedSnapshot, validateRules, walkSourceFiles };
|