Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2b6a00d
fix: scope codegraph batch complexity targets to file paths
carlos-alm Jul 5, 2026
b28051a
fix: exclude parameters and interface/type members from dead-role cla…
carlos-alm Jul 5, 2026
17fbcba
fix: credit import-type usages as exports consumers
carlos-alm Jul 5, 2026
26918bb
fix: prevent fn-impact/query crash when -f/--file is passed
carlos-alm Jul 5, 2026
be6432c
fix: correct exported-symbol detection for literal and object-literal…
carlos-alm Jul 5, 2026
4ead840
fix: exclude primitive type keywords from ast --kind string matching
carlos-alm Jul 5, 2026
f6326bf
fix: resolve call edges through renamed import specifiers
carlos-alm Jul 5, 2026
590f560
fix: couple file_hashes updates with edge regeneration in incremental…
carlos-alm Jul 5, 2026
d3ea4a4
fix: compare signature-change diffs using new-file line ranges
carlos-alm Jul 5, 2026
c306812
feat: add environment doctor check for stale native binary and missin…
carlos-alm Jul 5, 2026
8bb5893
fix: eliminate non-deterministic ordering in community detection
carlos-alm Jul 6, 2026
46037b1
fix: sync update-graph.sh hook extension allowlist with EXTENSIONS
carlos-alm Jul 6, 2026
6a84cf9
fix: recompute directory structure metrics for affected directories o…
carlos-alm Jul 6, 2026
8d936d1
refactor: register hardcoded execFileSync/execSync maxBuffer values i…
carlos-alm Jul 6, 2026
11c84be
fix: gate blast-radius check on newly introduced risk, not pre-existi…
carlos-alm Jul 6, 2026
963301a
fix: gate identifier-argument dynamic call edges on callback-acceptin…
carlos-alm Jul 6, 2026
3e8035d
fix: gate Array.from's callback arg by position, not just callee name
carlos-alm Jul 6, 2026
879635e
fix: scope reexportedSymbols to actually-named re-export specifiers
carlos-alm Jul 6, 2026
0fe9fc3
fix: stop CFG block/edge count from overriding AST-derived cyclomatic…
carlos-alm Jul 6, 2026
ccf3c19
fix: backfill edges.technique for incrementally-inserted calls edges
carlos-alm Jul 6, 2026
d5b1162
fix: wrap remote embedding JSON parse failure in EngineError
carlos-alm Jul 6, 2026
8971017
refactor: extract shared platform-default-path helper in config.ts
carlos-alm Jul 6, 2026
056c5e4
refactor: decompose loadConfig and related high-effort functions in c…
carlos-alm Jul 6, 2026
0738171
refactor: decompose findDbPath and openRepo in db/connection.ts (docs…
carlos-alm Jul 6, 2026
6f2423c
refactor: dedupe busy/locked error detection into isBusyOrLockedError
carlos-alm Jul 6, 2026
4c02378
fix: log statSync failures in findDbPath instead of silently swallowi…
carlos-alm Jul 6, 2026
0698e16
test: add direct unit coverage for closeDbPair/closeDbPairDeferred/cl…
carlos-alm Jul 6, 2026
4ac3b99
fix: correct blast-radius/fn-impact computation for line-shifted decl…
carlos-alm Jul 6, 2026
6767f09
feat: wire points-to solver max-iterations cap through DEFAULTS.analy…
carlos-alm Jul 6, 2026
5f6f30a
refactor: route console.log calls in domain/search through logger
carlos-alm Jul 6, 2026
b479318
refactor: reduce cyclomatic complexity of computeDeltaModularityDirected
carlos-alm Jul 6, 2026
c39ac40
refactor: unify impact-level rendering format between audit and fn-im…
carlos-alm Jul 6, 2026
067674f
refactor: dedupe computeSavings via pct helper and persist partial to…
carlos-alm Jul 6, 2026
f6807b4
fix: add main.rs driver to rust dynamic tracer fixture
carlos-alm Jul 6, 2026
1c07a54
fix: scope diff file-header detection to between-hunk positions
carlos-alm Jul 6, 2026
bf82aa2
fix: update titan-grind's dead-symbol script for current roles --json…
carlos-alm Jul 6, 2026
cd02d27
fix: thread configured busyTimeoutMs through remaining read-only quer…
carlos-alm Jul 6, 2026
980b5dc
fix: resolve computed string-literal keys in object-literal extractio…
carlos-alm Jul 6, 2026
4a873a3
fix: add same-class bare-call fallback to incremental rebuild path (d…
carlos-alm Jul 6, 2026
8f3348a
fix: unify Object.defineProperty accessor fallback kind-filtering bet…
carlos-alm Jul 6, 2026
acf804c
refactor: share chunked statement-cache primitive between builder and…
carlos-alm Jul 6, 2026
986c851
refactor: cache prepared statements in applyEdgeTechniquesAfterNative…
carlos-alm Jul 6, 2026
71e9174
fix: replace fixed-depth directory-proximity check with symmetric dis…
carlos-alm Jul 6, 2026
d2935cc
refactor: remove unreachable Partition delta-computation interface me…
carlos-alm Jul 6, 2026
6515186
fix: emit reference edges for function identifiers used as object-lit…
carlos-alm Jul 6, 2026
30c491a
refactor: unify call-ref and tests rendering format between audit and…
carlos-alm Jul 6, 2026
9db911b
fix: classify destructured bindings as constant, not function (docs c…
carlos-alm Jul 6, 2026
70559fc
refactor: adopt timeMedian in remaining benchmark timing loops
carlos-alm Jul 6, 2026
822e0eb
refactor: decompose runPerfBenchmarks in token-benchmark.ts
carlos-alm Jul 6, 2026
fcdfe7d
fix: attribute liveness to Lua functions assigned to global/builtin i…
carlos-alm Jul 6, 2026
ee6362c
refactor: extract shared sedi() helper for tracer scripts
carlos-alm Jul 6, 2026
d4e6212
fix: restore reflection dynamicKind for .call/.apply/.bind (docs chec…
carlos-alm Jul 6, 2026
aec5d2b
fix: restrict entry-role classification to function/method-kind symbo…
carlos-alm Jul 6, 2026
d250f8d
fix: credit destructured dynamic import() bindings as exports consumers
carlos-alm Jul 6, 2026
75978e2
fix: recognize Lua function nodes in complexity metrics computation (…
carlos-alm Jul 6, 2026
af17b6d
fix: scope global call-resolution fallback to same-language candidate…
carlos-alm Jul 6, 2026
dd447bc
fix: credit instanceof ClassName checks as exports consumers
carlos-alm Jul 6, 2026
a79a8a1
fix: update automated-review workflow to use current claude-code-acti…
carlos-alm Jul 6, 2026
d84f6b5
refactor: widen outputResult signature, remove redundant casts at cal…
carlos-alm Jul 6, 2026
d9ac301
fix: resolve merge conflicts with main (docs check acknowledged)
carlos-alm Jul 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/presentation/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function audit(
): void {
const data: AuditResult = auditData(target, customDbPath, opts);

if (outputResult(data as unknown as Record<string, unknown>, null, opts)) return;
if (outputResult(data, null, opts)) return;

if (data.functions.length === 0) {
console.log(`No ${data.kind === 'file' ? 'file' : 'function/symbol'} matching "${target}"`);
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/owners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface OwnersResult {

export function owners(customDbPath: string | undefined, opts: OwnersOpts = {}): void {
const data = ownersData(customDbPath, opts as any) as OwnersResult;
if (outputResult(data as unknown as Record<string, unknown>, null, opts)) return;
if (outputResult(data, null, opts)) return;

if (!data.codeownersFile) {
console.log('No CODEOWNERS file found.');
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/queries-cli/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function printReexportedSection(data: ExportsDataResult, opts: ExportsOpts): voi

export function fileExports(file: string, customDbPath: string, opts: ExportsOpts = {}): void {
const data = exportsData(file, customDbPath, opts) as ExportsDataResult;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

const hasReexported = data.reexportedSymbols && data.reexportedSymbols.length > 0;

Expand Down
10 changes: 5 additions & 5 deletions src/presentation/queries-cli/impact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ interface OutputOpts {

export function fileDeps(file: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = fileDepsData(file, customDbPath, opts) as unknown as FileDepsData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No file matching "${file}" in graph`);
Expand Down Expand Up @@ -181,7 +181,7 @@ function printFnDepsTransitive(transitiveCallers: Record<string, SymbolRef[]>):

export function fnDeps(name: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = fnDepsData(name, customDbPath, opts) as unknown as FnDepsData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No function/method/class matching "${name}"`);
Expand All @@ -202,7 +202,7 @@ export function fnDeps(name: string, customDbPath: string, opts: OutputOpts = {}

export function impactAnalysis(file: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = impactAnalysisData(file, customDbPath, opts) as unknown as ImpactData;
if (outputResult(data as unknown as Record<string, unknown>, 'sources', opts)) return;
if (outputResult(data, 'sources', opts)) return;

if (data.sources.length === 0) {
console.log(`No file matching "${file}" in graph`);
Expand Down Expand Up @@ -231,7 +231,7 @@ export function impactAnalysis(file: string, customDbPath: string, opts: OutputO

export function fnImpact(name: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = fnImpactData(name, customDbPath, opts) as unknown as FnImpactData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No function/method/class matching "${name}"`);
Expand Down Expand Up @@ -302,7 +302,7 @@ export function diffImpact(customDbPath: string, opts: OutputOpts = {}): void {
}
const data = diffImpactData(customDbPath, opts) as unknown as DiffImpactData;
if (opts.format === 'json') opts = { ...opts, json: true };
if (outputResult(data as unknown as Record<string, unknown>, 'affectedFunctions', opts)) return;
if (outputResult(data, 'affectedFunctions', opts)) return;

if (data.error) {
console.log(data.error);
Expand Down
14 changes: 7 additions & 7 deletions src/presentation/queries-cli/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function renderWhereFileResults(results: WhereFileResult[]): void {

export function where(target: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = whereData(target, customDbPath, opts as Record<string, unknown>) as WhereData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(
Expand All @@ -247,7 +247,7 @@ export function queryName(name: string, customDbPath: string, opts: OutputOpts =
limit: opts.limit,
offset: opts.offset,
}) as QueryNameData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No results for "${name}"`);
Expand Down Expand Up @@ -275,7 +275,7 @@ export function queryName(name: string, customDbPath: string, opts: OutputOpts =

export function context(name: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = contextData(name, customDbPath, opts as Record<string, unknown>) as ContextData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No function/method/class matching "${name}"`);
Expand All @@ -289,7 +289,7 @@ export function context(name: string, customDbPath: string, opts: OutputOpts = {

export function children(name: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = childrenData(name, customDbPath, opts as Record<string, unknown>) as ChildrenData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No symbol matching "${name}"`);
Expand Down Expand Up @@ -505,7 +505,7 @@ function renderFunctionExplain(r: FunctionExplainResult, indent = ''): void {

export function explain(target: string, customDbPath: string, opts: OutputOpts = {}): void {
const data = explainData(target, customDbPath, opts as Record<string, unknown>) as ExplainData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No ${data.kind === 'file' ? 'file' : 'function/symbol'} matching "${target}"`);
Expand All @@ -529,7 +529,7 @@ export function implementations(name: string, customDbPath: string, opts: Output
customDbPath,
opts as Record<string, unknown>,
) as ImplementationsData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No symbol matching "${name}"`);
Expand All @@ -556,7 +556,7 @@ export function interfaces(name: string, customDbPath: string, opts: OutputOpts
customDbPath,
opts as Record<string, unknown>,
) as InterfacesData;
if (outputResult(data as unknown as Record<string, unknown>, 'results', opts)) return;
if (outputResult(data, 'results', opts)) return;

if (data.results.length === 0) {
console.log(`No symbol matching "${name}"`);
Expand Down
12 changes: 4 additions & 8 deletions src/presentation/queries-cli/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export async function stats(customDbPath: string, opts: OutputOpts = {}): Promis
debug(`stats: community detection failed (optional): ${toErrorMessage(e)}`);
}

if (outputResult(data as unknown as Record<string, unknown>, null, opts)) return;
if (outputResult(data, null, opts)) return;

console.log('\n# Codegraph Stats\n');
printNodes(data);
Expand All @@ -280,7 +280,7 @@ export async function stats(customDbPath: string, opts: OutputOpts = {}): Promis

export function moduleMap(customDbPath: string, limit = 20, opts: OutputOpts = {}): void {
const data = moduleMapData(customDbPath, limit, { noTests: opts.noTests }) as ModuleMapData;
if (outputResult(data as unknown as Record<string, unknown>, 'topNodes', opts)) return;
if (outputResult(data, 'topNodes', opts)) return;

console.log(`\nModule map (top ${limit} most-connected nodes):\n`);
const dirs = new Map<string, TopNode[]>();
Expand Down Expand Up @@ -326,11 +326,7 @@ function printRoleGroup(role: string, symbols: RoleSymbol[]): void {
export function dynamicCalls(customDbPath: string, opts: OutputOpts = {}): void {
const rows = dynamicCallsData(customDbPath);
if (opts.json || opts.ndjson) {
outputResult(
{ dynamic_calls: rows } as unknown as Record<string, unknown>,
'dynamic_calls',
opts,
);
outputResult({ dynamic_calls: rows }, 'dynamic_calls', opts);
return;
}
if (rows.length === 0) {
Expand All @@ -353,7 +349,7 @@ export function dynamicCalls(customDbPath: string, opts: OutputOpts = {}): void

export function roles(customDbPath: string, opts: OutputOpts = {}): void {
const data = rolesData(customDbPath, opts) as RolesData;
if (outputResult(data as unknown as Record<string, unknown>, 'symbols', opts)) return;
if (outputResult(data, 'symbols', opts)) return;

if (data.count === 0) {
console.log('No classified symbols found. Run "codegraph build" first.');
Expand Down
4 changes: 2 additions & 2 deletions src/presentation/queries-cli/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function symbolPath(
}

const data = pathData(from, to, customDbPath, opts) as PathDataResult;
if (outputResult(data as unknown as Record<string, unknown>, null, opts)) return;
if (outputResult(data, null, opts)) return;

if (data.error) {
console.log(data.error);
Expand Down Expand Up @@ -160,7 +160,7 @@ function printFilePathSteps(data: FilePathDataResult): void {

function filePath(from: string, to: string, customDbPath: string, opts: PathOpts = {}): void {
const data = filePathData(from, to, customDbPath, opts) as FilePathDataResult;
if (outputResult(data as unknown as Record<string, unknown>, null, opts)) return;
if (outputResult(data, null, opts)) return;

if (data.error) {
console.log(data.error);
Expand Down
17 changes: 9 additions & 8 deletions src/presentation/result-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,18 @@ export interface OutputOpts {
display?: DisplayOpts;
}

export function outputResult(
data: Record<string, any>,
field: string | null,
opts: OutputOpts,
): boolean {
export function outputResult(data: object, field: string | null, opts: OutputOpts): boolean {
// The formatting helpers below need key/index access (NDJSON field pluck, CSV/table
// flattening). Callers only ever hand off a concrete result shape for serialization,
// so the cast lives here once instead of as a defensive `as unknown as Record<...>`
// at every call site.
const record = data as Record<string, unknown>;
if (opts.ndjson) {
if (field === null) {
// No field key — emit the whole object as a single NDJSON line
console.log(JSON.stringify(data));
} else {
printNdjson(data, field);
printNdjson(record, field);
}
return true;
}
Expand All @@ -151,11 +152,11 @@ export function outputResult(
return true;
}
if (opts.csv) {
return printCsv(data, field) !== false;
return printCsv(record, field) !== false;
}
if (opts.table) {
const displayOpts = opts.display ?? (loadConfig() as { display: DisplayOpts }).display;
return printAutoTable(data, field, displayOpts) !== false;
return printAutoTable(record, field, displayOpts) !== false;
}
return false;
}
2 changes: 1 addition & 1 deletion src/presentation/triage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function triage(customDbPath: string | undefined, opts: TriageOpts = {}):
summary: TriageSummary;
};

if (outputResult(data as unknown as Record<string, unknown>, 'items', opts)) return;
if (outputResult(data, 'items', opts)) return;

if (data.items.length === 0) {
if (data.summary.total === 0) {
Expand Down
Loading