Skip to content

Commit dcf2628

Browse files
sharon77242claude
andcommitted
fix: remove unused safeChannel import + apply Prettier formatting
ESLint flagged 'safeChannel' as defined but never used in engine.ts — removed from the import. Four files reformatted to satisfy CI format:check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent de8c973 commit dcf2628

5 files changed

Lines changed: 15 additions & 19 deletions

File tree

packages/agent/src/diagnostic-agent.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import {
55
type RuntimeMonitorOptions,
66
type ProfilerEvent,
77
} from "./profiling/runtime-monitor.ts";
8-
import {
9-
InstrumentationEngine,
10-
type InstrumentationOptions,
11-
} from "./instrumentation/engine.ts";
8+
import { InstrumentationEngine, type InstrumentationOptions } from "./instrumentation/engine.ts";
129
import { MetricsAggregator, type AggregatorEvent } from "./export/aggregator.ts";
1310
import { OTLPExporter, type ExporterConfig } from "./export/exporter.ts";
1411
import { EntropyChecker } from "./sanitization/entropy-checker.ts";
@@ -60,10 +57,7 @@ import { writeExpirySignal } from "./licensing/expiry-signal.ts";
6057
import { GracefulShutdown, type GracefulShutdownOptions } from "./profiling/graceful-shutdown.ts";
6158
import { buildAgentProfile } from "./internal/profile-factory.ts";
6259
import { createQueryHandler } from "./internal/query-handler.ts";
63-
import {
64-
installConsoleLogger,
65-
type DebugListener,
66-
} from "./internal/console-logger.ts";
60+
import { installConsoleLogger, type DebugListener } from "./internal/console-logger.ts";
6761

6862
// WeakMap-based private storage for license claims — avoids exposing internal field on agent
6963
const licenseClaims = new WeakMap<DiagnosticAgent, LicenseClaims>();

packages/agent/src/instrumentation/engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EventEmitter } from "node:events";
22
import { performance } from "node:perf_hooks";
3-
import { safeChannel, dcSubscribe, dcUnsubscribe } from "./safe-channel.ts";
3+
import { dcSubscribe, dcUnsubscribe } from "./safe-channel.ts";
44
import { AstSanitizer } from "../sanitization/ast-sanitizer.ts";
55
import { getCurrentContext } from "./correlation.ts";
66

packages/agent/src/internal/console-logger.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ export function installConsoleLogger(
9292
};
9393
const hints = ev.suggestions?.map((s) => s.message).join(" | ");
9494
const suffix = hints ? `\n ⚠ ${hints}` : "";
95-
console.log(`${prefix} QUERY [${ev.durationMs.toFixed(1)}ms] ${ev.sanitizedQuery}${suffix}`);
95+
console.log(
96+
`${prefix} QUERY [${ev.durationMs.toFixed(1)}ms] ${ev.sanitizedQuery}${suffix}`,
97+
);
9698
});
9799
add("http", (r) => {
98100
const ev = r as { method: string; url: string; statusCode?: number; durationMs: number };

packages/agent/src/internal/query-handler.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ export function createQueryHandler(deps: QueryHandlerDeps): (traced: TracedQuery
3939
if (adaptiveSampler && !adaptiveSampler.shouldSample("query")) return;
4040

4141
// 2. Query analysis — enrich with fix suggestions
42-
const enriched =
43-
queryAnalyzer
44-
? { ...traced, suggestions: queryAnalyzer.analyze(traced.sanitizedQuery) }
45-
: traced;
42+
const enriched = queryAnalyzer
43+
? { ...traced, suggestions: queryAnalyzer.analyze(traced.sanitizedQuery) }
44+
: traced;
4645

4746
// 3. Slow query monitor — driver may be absent for manual traceQuery() calls
4847
if (slowQueryMonitor) {
@@ -56,7 +55,11 @@ export function createQueryHandler(deps: QueryHandlerDeps): (traced: TracedQuery
5655
traced.traceId,
5756
);
5857
if (slow) {
59-
aggregator.record("slow-query", slow.durationMs, slow as unknown as Record<string, unknown>);
58+
aggregator.record(
59+
"slow-query",
60+
slow.durationMs,
61+
slow as unknown as Record<string, unknown>,
62+
);
6063
emit("slow-query", slow);
6164
}
6265
}

packages/agent/tests/analysis/static-scanner.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import type { ScanResult } from "../../src/analysis/types.ts";
88
// tsconfig.json. Using process.cwd() (the full agent project) is fragile
99
// because the agent's tsconfig includes tests/, so any TS issue introduced
1010
// in ANY test file would cause this assertion to fail non-deterministically.
11-
const CLEAN_FIXTURE_DIR = join(
12-
import.meta.dirname,
13-
"../fixtures/static-scanner-clean",
14-
);
11+
const CLEAN_FIXTURE_DIR = join(import.meta.dirname, "../fixtures/static-scanner-clean");
1512

1613
describe("StaticScanner", () => {
1714
it("should run TypeScript scan and return a ScanResult", async () => {

0 commit comments

Comments
 (0)