Skip to content

Commit 6a58e39

Browse files
committed
fix linting
1 parent 024db0b commit 6a58e39

File tree

12 files changed

+126
-48
lines changed

12 files changed

+126
-48
lines changed

AGENTS.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ These are non-negotiable. Every PR, feature, and design decision must respect th
2222
- **Never stage/commit `.planning/**`\*\* (or any other local workflow artifacts) unless the user explicitly asks in that message.
2323
- **Never use `gsd-tools ... commit` wrappers** in this repo. Use plain `git add <exact files>` and `git commit -m "..."`.
2424
- **Before every commit:** run `git status --short` and confirm staged files match intent; abort if any `.planning/**` is staged.
25-
- **Avoid using `any` Type AT ALL COSTS.
25+
- \*\*Avoid using `any` Type AT ALL COSTS.
26+
2627
## Evaluation Integrity (NON-NEGOTIABLE)
2728

2829
These rules prevent metric gaming, overfitting, and false quality claims. Violation of these rules means the feature CANNOT ship.
@@ -158,6 +159,3 @@ These came from behavioral observation across multiple sessions. They're here so
158159
See `internal-docs/AGENTS.md` for internal-only guidelines and context.
159160

160161
---
161-
162-
**Current focus:** See `internal-docs/ISSUES.md` for active release blockers.
163-
For full project history and context handover, see `internal-docs/ARCHIVE/WALKTHROUGH-v1.6.1.md`.

src/analyzers/angular/index.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ export class AngularAnalyzer implements FrameworkAnalyzer {
172172
const specifier = s as TSESTree.ImportSpecifier;
173173
return specifier.imported.name || specifier.local.name;
174174
}),
175-
isDefault: node.specifiers.some((s: TSESTree.ImportClause) => s.type === 'ImportDefaultSpecifier'),
175+
isDefault: node.specifiers.some(
176+
(s: TSESTree.ImportClause) => s.type === 'ImportDefaultSpecifier'
177+
),
176178
isDynamic: false,
177179
line: node.loc?.start.line
178180
});
@@ -566,7 +568,8 @@ export class AngularAnalyzer implements FrameworkAnalyzer {
566568
for (const param of member.value.params) {
567569
const typedParam = param as TSESTree.Identifier;
568570
if (typedParam.typeAnnotation?.typeAnnotation?.type === 'TSTypeReference') {
569-
const typeRef = typedParam.typeAnnotation.typeAnnotation as TSESTree.TSTypeReference;
571+
const typeRef = typedParam.typeAnnotation
572+
.typeAnnotation as TSESTree.TSTypeReference;
570573
if (typeRef.typeName.type === 'Identifier') {
571574
services.push(typeRef.typeName.name);
572575
}
@@ -601,14 +604,20 @@ export class AngularAnalyzer implements FrameworkAnalyzer {
601604
if (hasInput && member.key && 'name' in member.key) {
602605
inputs.push({
603606
name: member.key.name,
604-
type: (member.typeAnnotation?.typeAnnotation?.type as string | undefined) || 'unknown',
607+
type:
608+
(member.typeAnnotation?.typeAnnotation?.type as string | undefined) || 'unknown',
605609
style: 'decorator'
606610
});
607611
}
608612
}
609613

610614
// Check for signal-based input() (Angular v17.1+)
611-
if (member.value && member.key && 'name' in member.key && member.value.type === 'CallExpression') {
615+
if (
616+
member.value &&
617+
member.key &&
618+
'name' in member.key &&
619+
member.value.type === 'CallExpression'
620+
) {
612621
const callee = member.value.callee;
613622
let valueStr: string | null = null;
614623
let isRequired = false;
@@ -668,7 +677,12 @@ export class AngularAnalyzer implements FrameworkAnalyzer {
668677
}
669678

670679
// Check for signal-based output() (Angular v17.1+)
671-
if (member.value && member.key && 'name' in member.key && member.value.type === 'CallExpression') {
680+
if (
681+
member.value &&
682+
member.key &&
683+
'name' in member.key &&
684+
member.value.type === 'CallExpression'
685+
) {
672686
const callee = member.value.callee;
673687
const valueStr = callee.type === 'Identifier' ? callee.name : null;
674688

@@ -949,9 +963,8 @@ export class AngularAnalyzer implements FrameworkAnalyzer {
949963
}
950964

951965
const parsedObj = parsed as { chunks?: unknown };
952-
const chunks = parsedObj && Array.isArray(parsedObj.chunks)
953-
? (parsedObj.chunks as IndexChunk[])
954-
: null;
966+
const chunks =
967+
parsedObj && Array.isArray(parsedObj.chunks) ? (parsedObj.chunks as IndexChunk[]) : null;
955968
if (Array.isArray(chunks) && chunks.length > 0) {
956969
console.error(`Loading statistics from ${indexPath}: ${chunks.length} chunks`);
957970

@@ -1046,7 +1059,9 @@ export class AngularAnalyzer implements FrameworkAnalyzer {
10461059

10471060
case 'module': {
10481061
const imports = Array.isArray(metadata?.imports) ? metadata.imports.length : 0;
1049-
const declarations = Array.isArray(metadata?.declarations) ? metadata.declarations.length : 0;
1062+
const declarations = Array.isArray(metadata?.declarations)
1063+
? metadata.declarations.length
1064+
: 0;
10501065
return `Angular module '${className}' with ${declarations} declarations and ${imports} imports.`;
10511066
}
10521067

src/analyzers/generic/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ export class GenericAnalyzer implements FrameworkAnalyzer {
248248
workspaceType !== 'single' ? await scanWorkspacePackageJsons(rootPath) : [];
249249

250250
const pkgPath = path.join(rootPath, 'package.json');
251-
let packageJson: { name?: string; dependencies?: Record<string, string>; devDependencies?: Record<string, string> } = {};
251+
let packageJson: {
252+
name?: string;
253+
dependencies?: Record<string, string>;
254+
devDependencies?: Record<string, string>;
255+
} = {};
252256
try {
253257
packageJson = JSON.parse(await fs.readFile(pkgPath, 'utf-8'));
254258
projectName = packageJson.name || projectName;
@@ -360,7 +364,9 @@ export class GenericAnalyzer implements FrameworkAnalyzer {
360364
const specifier = s as TSESTree.ImportSpecifier;
361365
return specifier.imported.name || specifier.local.name;
362366
}),
363-
isDefault: node.specifiers.some((s: TSESTree.ImportClause) => s.type === 'ImportDefaultSpecifier'),
367+
isDefault: node.specifiers.some(
368+
(s: TSESTree.ImportClause) => s.type === 'ImportDefaultSpecifier'
369+
),
364370
isDynamic: false,
365371
line: node.loc?.start.line
366372
});

src/core/indexer.ts

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ export class CodebaseIndexer {
365365

366366
console.error(
367367
`Incremental diff: ${diff.added.length} added, ${diff.changed.length} changed, ` +
368-
`${diff.deleted.length} deleted, ${diff.unchanged.length} unchanged`
368+
`${diff.deleted.length} deleted, ${diff.unchanged.length} unchanged`
369369
);
370370

371371
stats.incremental = {
@@ -440,9 +440,9 @@ export class CodebaseIndexer {
440440
// Build the set of files that need analysis + embedding (incremental: only added/changed)
441441
const filesToProcess = diff
442442
? files.filter((f) => {
443-
const rel = path.relative(this.rootPath, f).replace(/\\/g, '/');
444-
return diff!.added.includes(rel) || diff!.changed.includes(rel);
445-
})
443+
const rel = path.relative(this.rootPath, f).replace(/\\/g, '/');
444+
return diff!.added.includes(rel) || diff!.changed.includes(rel);
445+
})
446446
: files;
447447

448448
// Phase 2: Analyzing & Parsing
@@ -549,8 +549,14 @@ export class CodebaseIndexer {
549549
// GENERIC PATTERN FORWARDING
550550
// Framework analyzers return detectedPatterns in metadata - we just forward them
551551
// This keeps the indexer framework-agnostic
552-
if (result.metadata?.detectedPatterns && Array.isArray(result.metadata.detectedPatterns)) {
553-
for (const pattern of result.metadata.detectedPatterns as Array<{ category: string; name: string }>) {
552+
if (
553+
result.metadata?.detectedPatterns &&
554+
Array.isArray(result.metadata.detectedPatterns)
555+
) {
556+
for (const pattern of result.metadata.detectedPatterns as Array<{
557+
category: string;
558+
name: string;
559+
}>) {
554560
// Try to extract a relevant snippet for the pattern
555561
// Ask analyzer registry for snippet pattern (framework-agnostic delegation)
556562
const analyzer = analyzerRegistry.findAnalyzer(file);
@@ -569,12 +575,12 @@ export class CodebaseIndexer {
569575
// Track file for Golden File scoring (framework-agnostic)
570576
// A golden file = file with patterns in ≥3 distinct categories
571577
const rawPatterns = result.metadata?.detectedPatterns;
572-
const detectedPatterns: Array<{ category: string; name: string }> = Array.isArray(rawPatterns)
578+
const detectedPatterns: Array<{ category: string; name: string }> = Array.isArray(
579+
rawPatterns
580+
)
573581
? (rawPatterns as Array<{ category: string; name: string }>)
574582
: [];
575-
const uniqueCategories = new Set(
576-
detectedPatterns.map((p) => p.category)
577-
);
583+
const uniqueCategories = new Set(detectedPatterns.map((p) => p.category));
578584
const patternScore = uniqueCategories.size;
579585
if (patternScore >= 3) {
580586
const patternFlags: Record<string, boolean> = {};
@@ -638,8 +644,8 @@ export class CodebaseIndexer {
638644
this.updateProgress('embedding', 50);
639645
console.error(
640646
`Creating embeddings for ${chunksToEmbed.length} chunks` +
641-
(diff ? ` (${allChunks.length} total, ${chunksToEmbed.length} changed)` : '') +
642-
'...'
647+
(diff ? ` (${allChunks.length} total, ${chunksToEmbed.length} changed)` : '') +
648+
'...'
643649
);
644650

645651
// Initialize embedding provider
@@ -685,7 +691,8 @@ export class CodebaseIndexer {
685691

686692
if ((i + batchSize) % 100 === 0 || i + batchSize >= chunksToEmbed.length) {
687693
console.error(
688-
`Embedded ${Math.min(i + batchSize, chunksToEmbed.length)}/${chunksToEmbed.length
694+
`Embedded ${Math.min(i + batchSize, chunksToEmbed.length)}/${
695+
chunksToEmbed.length
689696
} chunks`
690697
);
691698
}
@@ -738,7 +745,7 @@ export class CodebaseIndexer {
738745
}
739746
console.error(
740747
`Incremental store: deleted chunks for ${diff.changed.length + diff.deleted.length} files, ` +
741-
`added ${chunksWithEmbeddings.length} new chunks`
748+
`added ${chunksWithEmbeddings.length} new chunks`
742749
);
743750
} else {
744751
// Full rebuild: store to staging (no clear - fresh directory)
@@ -911,8 +918,8 @@ export class CodebaseIndexer {
911918
if (diff) {
912919
console.error(
913920
`Incremental indexing complete in ${stats.duration}ms ` +
914-
`(${diff.added.length} added, ${diff.changed.length} changed, ` +
915-
`${diff.deleted.length} deleted, ${diff.unchanged.length} unchanged)`
921+
`(${diff.added.length} added, ${diff.changed.length} changed, ` +
922+
`${diff.deleted.length} deleted, ${diff.unchanged.length} unchanged)`
916923
);
917924
} else {
918925
console.error(`Indexing complete in ${stats.duration}ms`);

src/core/reranker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const RERANK_TOP_K = 10;
1919
const AMBIGUITY_THRESHOLD = 0.08;
2020

2121
interface CrossEncoderTokenizer {
22-
(query: string, passage: string, options: { padding: boolean; truncation: boolean; max_length: number }): unknown;
22+
(
23+
query: string,
24+
passage: string,
25+
options: { padding: boolean; truncation: boolean; max_length: number }
26+
): unknown;
2327
}
2428

2529
interface CrossEncoderModel {

src/core/search.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ export class CodebaseSearcher {
230230
// Extract pattern indicators from intelligence data
231231
if (intelligence.patterns) {
232232
for (const [_category, patternData] of Object.entries(intelligence.patterns)) {
233-
234233
// Track primary pattern
235234
if (patternData.primary?.trend === 'Rising') {
236235
risingPatterns.add(patternData.primary.name.toLowerCase());

src/core/symbol-references.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ export async function findSymbolReferences(
9595
}
9696

9797
const chunks =
98-
chunksRaw !== null && typeof chunksRaw === 'object' && 'chunks' in chunksRaw && Array.isArray(chunksRaw.chunks)
98+
chunksRaw !== null &&
99+
typeof chunksRaw === 'object' &&
100+
'chunks' in chunksRaw &&
101+
Array.isArray(chunksRaw.chunks)
99102
? (chunksRaw.chunks as unknown[])
100103
: null;
101104

src/embeddings/transformers.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ export class TransformersEmbeddingProvider implements EmbeddingProvider {
5454

5555
// TS2590: pipeline() resolves AllTasks[T] — a union too complex for TSC to represent.
5656
// Cast to a simpler signature; the actual return type IS FeatureExtractionPipelineType.
57-
type PipelineFn = (task: 'feature-extraction', model: string, opts: Record<string, unknown>) => Promise<FeatureExtractionPipelineType>;
58-
this.pipeline = await (pipeline as PipelineFn)('feature-extraction', this.modelName, { dtype: 'q8' });
57+
type PipelineFn = (
58+
task: 'feature-extraction',
59+
model: string,
60+
opts: Record<string, unknown>
61+
) => Promise<FeatureExtractionPipelineType>;
62+
this.pipeline = await (pipeline as PipelineFn)('feature-extraction', this.modelName, {
63+
dtype: 'q8'
64+
});
5965

6066
this.ready = true;
6167
console.error(`Model loaded successfully: ${this.modelName}`);

src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ import {
1818
Resource
1919
} from '@modelcontextprotocol/sdk/types.js';
2020
import { CodebaseIndexer } from './core/indexer.js';
21-
import type { IndexingStats, IntelligenceData, PatternsData, PatternEntry, PatternCandidate } from './types/index.js';
21+
import type {
22+
IndexingStats,
23+
IntelligenceData,
24+
PatternsData,
25+
PatternEntry,
26+
PatternCandidate
27+
} from './types/index.js';
2228
import { analyzerRegistry } from './core/analyzer-registry.js';
2329
import { AngularAnalyzer } from './analyzers/angular/index.js';
2430
import { GenericAnalyzer } from './analyzers/generic/index.js';

src/tools/detect-circular-dependencies.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export async function handle(
3131

3232
try {
3333
// Try relationships sidecar first (preferred), then intelligence
34-
let graphDataSource: { imports?: Record<string, string[]>; exports?: Record<string, FileExport[]> } | null = null;
34+
let graphDataSource: {
35+
imports?: Record<string, string[]>;
36+
exports?: Record<string, FileExport[]>;
37+
} | null = null;
3538
let graphStats: unknown = null;
3639

3740
const relationshipsPath = path.join(

0 commit comments

Comments
 (0)