Skip to content

Commit 7a3f14d

Browse files
committed
style: satisfy launch readiness format checks
1 parent 0fb8b3f commit 7a3f14d

9 files changed

Lines changed: 55 additions & 25 deletions

File tree

src/core/codebase-map.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ export async function buildCodebaseMap(
220220
// --- Best examples ---
221221
const dominantPatternName =
222222
activePatterns.length > 0 ? activePatterns[0].name : 'high-quality example';
223-
const goldenFiles = (intelligence.goldenFiles ?? []).filter((gf) => isMapEligiblePath(gf.file, mode));
223+
const goldenFiles = (intelligence.goldenFiles ?? []).filter((gf) =>
224+
isMapEligiblePath(gf.file, mode)
225+
);
224226
const bestExamples: CodebaseMapExample[] = maybeLimit(
225227
goldenFiles,
226228
BOUNDED_SECTION_LIMITS.bestExamples,

src/eval/edit-preflight-harness.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ function summarizeEditPreflightResults(results: EditPreflightTaskResult[]): Edit
8686
};
8787
}
8888

89-
function evaluateTask(task: EditPreflightTask, response: EditPreflightResponse): EditPreflightTaskResult {
89+
function evaluateTask(
90+
task: EditPreflightTask,
91+
response: EditPreflightResponse
92+
): EditPreflightTaskResult {
9093
const topFiles = (response.results ?? [])
9194
.map((result) => (typeof result.file === 'string' ? stripLocationSuffix(result.file) : ''))
9295
.filter((filePath): filePath is string => Boolean(filePath));
@@ -202,7 +205,9 @@ export function formatEditPreflightReport({
202205

203206
lines.push(`\n=== Edit Preflight Eval Report: ${codebaseLabel} ===`);
204207
lines.push(`Fixture: ${fixturePath}`);
205-
lines.push(`Tasks: ${summary.totalTasks} (${summary.safeTasks} safe, ${summary.unsafeTasks} unsafe)`);
208+
lines.push(
209+
`Tasks: ${summary.totalTasks} (${summary.safeTasks} safe, ${summary.unsafeTasks} unsafe)`
210+
);
206211
lines.push(
207212
`Top-target in top-3: ${summary.topTargetInTop3Count}/${summary.targetableTasks} (${formatRate(summary.topTargetInTop3Rate)})`
208213
);

src/health/derive.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ function getHealthLevel(fileMetrics: FileMetrics): CodebaseHealthFile {
146146
reasons.push(`Moderate code complexity (cyclomatic ${fileMetrics.maxCyclomaticComplexity})`);
147147
}
148148

149-
const level =
150-
score >= 4 ? 'high' : score >= 2 ? 'medium' : ('low' as const);
149+
const level = score >= 4 ? 'high' : score >= 2 ? 'medium' : ('low' as const);
151150

152151
return {
153152
file: '',

src/health/store.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ function normalizeHealthFile(raw: unknown): CodebaseHealthFile | null {
2424
const rawSignals = isRecord(raw.signals) ? raw.signals : undefined;
2525
const signals = rawSignals
2626
? {
27-
...(typeof rawSignals.hotspotRank === 'number' ? { hotspotRank: rawSignals.hotspotRank } : {}),
27+
...(typeof rawSignals.hotspotRank === 'number'
28+
? { hotspotRank: rawSignals.hotspotRank }
29+
: {}),
2830
...(typeof rawSignals.importerCount === 'number'
2931
? { importerCount: rawSignals.importerCount }
3032
: {}),
31-
...(typeof rawSignals.importCount === 'number' ? { importCount: rawSignals.importCount } : {}),
33+
...(typeof rawSignals.importCount === 'number'
34+
? { importCount: rawSignals.importCount }
35+
: {}),
3236
...(typeof rawSignals.cycleCount === 'number' ? { cycleCount: rawSignals.cycleCount } : {}),
3337
...(typeof rawSignals.maxCyclomaticComplexity === 'number'
3438
? { maxCyclomaticComplexity: rawSignals.maxCyclomaticComplexity }
@@ -45,7 +49,12 @@ function normalizeHealthFile(raw: unknown): CodebaseHealthFile | null {
4549
}
4650

4751
export function normalizeHealthArtifact(raw: unknown): CodebaseHealthArtifact | null {
48-
if (!isRecord(raw) || !isRecord(raw.header) || !isRecord(raw.summary) || !Array.isArray(raw.files)) {
52+
if (
53+
!isRecord(raw) ||
54+
!isRecord(raw.header) ||
55+
!isRecord(raw.summary) ||
56+
!Array.isArray(raw.files)
57+
) {
4958
return null;
5059
}
5160

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,9 @@ export function registerHandlers(target: Server): void {
997997
{
998998
uri: CONTEXT_RESOURCE_URI,
999999
mimeType: 'text/plain',
1000-
text: project ? await generateCodebaseIntelligence(project) : buildProjectSelectionMessage()
1000+
text: project
1001+
? await generateCodebaseIntelligence(project)
1002+
: buildProjectSelectionMessage()
10011003
}
10021004
]
10031005
};

src/memory/store.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,16 @@ export function normalizeMemory(raw: unknown): Memory | null {
7373

7474
const source = m.source === 'git' ? ('git' as const) : undefined;
7575
const scope = normalizeMemoryScope(m.scope);
76-
return { id, type, category, memory, reason, date, ...(source && { source }), ...(scope && { scope }) };
76+
return {
77+
id,
78+
type,
79+
category,
80+
memory,
81+
reason,
82+
date,
83+
...(source && { source }),
84+
...(scope && { scope })
85+
};
7786
}
7887

7988
export function normalizeMemories(raw: unknown): Memory[] {

src/tools/get-codebase-health.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export async function handle(
3434
const file = typeof args.file === 'string' ? args.file.trim() : undefined;
3535
const limit = typeof args.limit === 'number' && Number.isFinite(args.limit) ? args.limit : 10;
3636
const level =
37-
args.level === 'low' || args.level === 'medium' || args.level === 'high' ? args.level : undefined;
37+
args.level === 'low' || args.level === 'medium' || args.level === 'high'
38+
? args.level
39+
: undefined;
3840

3941
const health = await readHealthFile(ctx.paths.health);
4042
if (!health) {
@@ -45,7 +47,8 @@ export async function handle(
4547
text: JSON.stringify(
4648
{
4749
status: 'no_data',
48-
message: 'No codebase health artifact found. Run refresh_index to generate health.json.'
50+
message:
51+
'No codebase health artifact found. Run refresh_index to generate health.json.'
4952
},
5053
null,
5154
2

src/tools/remember.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
22
import type { ToolContext, ToolResponse } from './types.js';
33
import type { Memory, MemoryCategory, MemoryScope, MemoryType } from '../types/index.js';
4-
import { appendMemoryFile, buildMemoryIdentityParts, normalizeMemoryScope } from '../memory/store.js';
4+
import {
5+
appendMemoryFile,
6+
buildMemoryIdentityParts,
7+
normalizeMemoryScope
8+
} from '../memory/store.js';
59

610
export const definition: Tool = {
711
name: 'remember',

src/tools/search-codebase.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ import {
2121
import { assessSearchQuality } from '../core/search-quality.js';
2222
import { getRerankerStatus } from '../core/reranker.js';
2323
import { IndexCorruptedError } from '../errors/index.js';
24-
import {
25-
formatMemoryScopeText,
26-
readMemoriesFile,
27-
withConfidence
28-
} from '../memory/store.js';
24+
import { formatMemoryScopeText, readMemoriesFile, withConfidence } from '../memory/store.js';
2925
import type { MemoryWithConfidence } from '../memory/store.js';
3026
import { indexHealthByFile, normalizeHealthLookupKey, readHealthFile } from '../health/store.js';
3127
import { InternalFileGraph } from '../utils/usage-tracker.js';
@@ -359,7 +355,8 @@ export async function handle(
359355
}
360356

361357
function getMemoryTextMatchCount(memory: MemoryWithConfidence): number {
362-
const haystack = `${memory.memory} ${memory.reason} ${formatMemoryScopeText(memory.scope)}`.toLowerCase();
358+
const haystack =
359+
`${memory.memory} ${memory.reason} ${formatMemoryScopeText(memory.scope)}`.toLowerCase();
363360
return queryTerms.filter((term) => haystack.includes(term)).length;
364361
}
365362

@@ -638,9 +635,9 @@ export async function handle(
638635
.slice(0, 2);
639636
}
640637

641-
function getResultHealth(filePath: string):
642-
| { level: 'low' | 'medium' | 'high'; reasons?: string[] }
643-
| undefined {
638+
function getResultHealth(
639+
filePath: string
640+
): { level: 'low' | 'medium' | 'high'; reasons?: string[] } | undefined {
644641
const fileHealth = healthByFile.get(normalizeHealthLookupKey(filePath, ctx.rootPath));
645642
if (!fileHealth || fileHealth.level === 'low') {
646643
return undefined;
@@ -651,9 +648,9 @@ export async function handle(
651648
};
652649
}
653650

654-
function summarizeResultHealth(resultPaths: string[]):
655-
| { level: 'low' | 'medium' | 'high'; reasons?: string[] }
656-
| undefined {
651+
function summarizeResultHealth(
652+
resultPaths: string[]
653+
): { level: 'low' | 'medium' | 'high'; reasons?: string[] } | undefined {
657654
const matched = resultPaths
658655
.map((filePath) => healthByFile.get(normalizeHealthLookupKey(filePath, ctx.rootPath)))
659656
.filter((entry): entry is NonNullable<typeof entry> => Boolean(entry));

0 commit comments

Comments
 (0)