Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
953651d
Refactor markup symbol extractors by language
Widthdom Aug 11, 2026
257fd0f
Refactor MCP tool catalog into families
Widthdom Aug 11, 2026
f283dee
Consolidate C# base-list parsing
Widthdom Aug 11, 2026
eba355c
Decompose the symbol extraction pipeline
Widthdom Aug 11, 2026
3293288
Unify caller and callee graph queries
Widthdom Aug 11, 2026
d108060
Decompose file content loading
Widthdom Aug 11, 2026
cf6d582
Decompose bounded indexed content reading
Widthdom Aug 11, 2026
bf743c9
Decompose cross-language reference extraction loop
Widthdom Aug 11, 2026
9bcb7a5
Unify indexed find scanning
Widthdom Aug 11, 2026
2223e25
Unify JVM triple-string masking
Widthdom Aug 11, 2026
0eaa1f8
Extract cross-language symbol query normalization
Widthdom Aug 11, 2026
5e67fff
Decompose symbol search execution
Widthdom Aug 11, 2026
852aad6
Decompose cross-language call reference extraction
Widthdom Aug 12, 2026
75c386d
Decompose transitive impact traversal
Widthdom Aug 12, 2026
06ff15d
Decompose cross-language type reference extraction
Widthdom Aug 12, 2026
dfe8599
Decompose impact definition resolution
Widthdom Aug 12, 2026
2d4e745
Decompose MCP per-file indexing
Widthdom Aug 12, 2026
12c489c
Decompose Python and R reference phases
Widthdom Aug 12, 2026
3c7ada4
Decompose file dependency queries
Widthdom Aug 12, 2026
abddf5c
Decompose dependency cycle queries
Widthdom Aug 12, 2026
17b803c
Decompose documentation reference extraction
Widthdom Aug 12, 2026
c471e7f
Decompose existing database validation
Widthdom Aug 12, 2026
593e849
Decompose MCP batch query execution
Widthdom Aug 12, 2026
a567646
Decompose SQLite function registration
Widthdom Aug 12, 2026
faca723
Decompose core reference extraction orchestration
Widthdom Aug 12, 2026
15c9d2c
Extract MCP index discovery planning
Widthdom Aug 12, 2026
123d4fc
Extract MCP FTS preflight planning
Widthdom Aug 12, 2026
3782044
Unify C# using catalog loading
Widthdom Aug 12, 2026
98bc56b
Decompose TypeScript augmentation rebuild
Widthdom Aug 12, 2026
a2b3992
Unify hotspot candidate query planning
Widthdom Aug 12, 2026
0f12a59
Unify unused symbol candidate queries
Widthdom Aug 12, 2026
06b082c
Decompose plain search execution
Widthdom Aug 12, 2026
77b1248
Consolidate unused symbol surface classification
Widthdom Aug 12, 2026
04b36da
Decompose search validation and routing
Widthdom Aug 12, 2026
766b426
Decompose MCP C# indexing preflight
Widthdom Aug 12, 2026
caab9c4
Decompose CLI batch execution
Widthdom Aug 12, 2026
c8bd97e
Preserve undispatched parallel batch input
Widthdom Aug 12, 2026
1be759f
Consolidate search recipe query execution
Widthdom Aug 12, 2026
352bfe4
Consolidate update file-loop session ownership
Widthdom Aug 12, 2026
59c8825
Extract serial update target disposition
Widthdom Aug 13, 2026
688a9df
Consolidate full-scan pre-write preparation
Widthdom Aug 13, 2026
efe1a01
Unify C# partial-family unused filtering
Widthdom Aug 13, 2026
b4e4fbc
Consolidate full-scan extraction session ownership
Widthdom Aug 13, 2026
b7d559b
Inline pattern extraction scan state
Widthdom Aug 13, 2026
068d1fb
Keep JVM triple-string scanning stack-local
Widthdom Aug 13, 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
54 changes: 40 additions & 14 deletions TESTING_GUIDE.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions changelog.d/unreleased/+batch-output-limit-replay.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
category: fixed
affected:
- src/CodeIndex/Cli/QueryCommandRunner.Batch.cs
- src/CodeIndex/Cli/QueryCommandRunner.BatchParallelExecution.cs
---

## English

- **Parallel batch output limits no longer discard accepted, undispatched input records** — when `batch --parallel` reaches `--max-output-chars`, accepted nonblank input records that were not dispatched are returned to the shared bounded input pump in source order. The next batch invocation reparses those records with fresh line numbers and counters, ahead of input the pump already buffered, while commands that started remain owned by the first invocation.

## 日本語

- **parallel batch の出力上限で、受理済みかつ未 dispatch の input record が失われなくなりました** — `batch --parallel` が `--max-output-chars` に達した場合、受理済みでも未 dispatch の nonblank input record を source 順のまま共有の bounded input pump に戻します。次の batch invocation は、すでに pump が buffer した入力より先にそれらの record を再 parse し、新しい line number と counter を割り当てます。開始済みの command は最初の invocation の所有のままです。
16 changes: 16 additions & 0 deletions changelog.d/unreleased/+csharp-base-list-parser.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
affected:
- src/CodeIndex/Database/CSharpBaseListParser.cs
- src/CodeIndex/Database/DbContext.ConnectionFunctions.cs
- src/CodeIndex/Database/DbReader.CSharpResolution.cs
- src/CodeIndex/Database/DbWriter.CSharpMetadataTargets.cs
---

## English

- **C# inheritance resolution now shares one grammar-aware base-list parser** — exact caller and metadata-target resolution no longer confuse generic `where` constraints with base types, and nested generics, tuples, arrays, alias qualifiers, and primary/base-constructor syntax are split consistently.

## 日本語

- **C# 継承解決が grammar-aware な base-list parser を共有するようになりました** — exact caller と metadata-target の解決で generic `where` constraint を基底型と誤認せず、nested generic、tuple、array、alias qualifier、primary / base constructor 構文を一貫して分割します。
15 changes: 15 additions & 0 deletions changelog.d/unreleased/+full-scan-extraction-state.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
category: fixed
affected:
- src/CodeIndex/Cli/IndexCommandRunner.FullScan.ExtractionPipeline.cs
- src/CodeIndex/Cli/IndexCommandRunner.FullScan.ResultConsumer.cs
- tests/CodeIndex.Tests/IndexCommandRunnerFullScanTests.cs
---

## English

- **Full-scan extraction now preserves shared state and worker-resource ownership** — a later C# workspace drift no longer drops text-index mutations already committed for earlier files, and a fatal parallel worker result defers shared queue, cache, hook, and cancellation cleanup until every peer worker has stopped.

## 日本語

- **full-scan extraction が共有 state と worker resource の ownership を保持するようになりました** — 後段の C# workspace drift が先行 file で commit 済みの text-index mutation を失わず、parallel worker の fatal result では全 peer worker の停止まで共有 queue、cache、hook、cancellation の cleanup を延期します。
15 changes: 15 additions & 0 deletions changelog.d/unreleased/+unused-legacy-schema.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
category: fixed
affected:
- src/CodeIndex/Database/DbReader.cs
- src/CodeIndex/Database/DbSymbolReader.UnusedSymbols.Candidates.cs
- src/CodeIndex/Database/DbSymbolReader.UnusedSymbols.cs
---

## English

- **C# unused-symbol queries now remain safe on read-only legacy databases** — partial-type use filtering is applied before paging without issuing per-candidate database queries, while databases whose legacy chunk or symbol tables lack the required columns retain the existing degraded fallback instead of failing during SQL preparation.

## 日本語

- **C# の unused-symbol query が read-only legacy database でも安全に動作するようになりました** — partial type の使用判定を candidate ごとの database query なしで paging 前に適用し、必要な column が legacy chunk / symbol table にない database では SQL prepare で失敗せず、従来の degraded fallback を維持します。
165 changes: 92 additions & 73 deletions src/CodeIndex/Cli/IndexCommandRunner.FileByteTracking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,94 +93,113 @@ or NotSupportedException
}
}

private static bool ShouldUseFullScanFtsBulkLoad(
bool rebuild,
bool startedWithNoIndexedFiles,
int extractionWorkItemCount,
FilePurgePlan staleFilePurgePlan,
bool scanHadErrors,
ReadableFileByteTracker readableFileBytes,
ReusableIndexedFileStatsSnapshot reusableIndexedFileStats,
IReadOnlyList<FullScanFileTarget> fileTargets,
IReadOnlyList<int>? extractionFileIndexes,
Action throwIfCancelled)
private sealed partial class FullScanPreWriteSession
{
if (rebuild || startedWithNoIndexedFiles)
return true;
if (extractionWorkItemCount == 0 && staleFilePurgePlan.Count == 0)
return false;

var dirtyBytes = staleFilePurgePlan.DeletedBytes;
var persistedSizeExcessBytes = 0L;
var byteEstimateComplete = !scanHadErrors
&& staleFilePurgePlan.ByteEstimateComplete
&& readableFileBytes.EstimateComplete;

void AddDirtyFileBytes(int fileIndex)
internal void DecideFtsBulkLoad()
{
throwIfCancelled();
try
var request = Request;
var options = request.Core.Options;
var baseline = request.Baseline;
var runtime = request.Runtime;
var scan = State.Scan;
var csharp = State.CSharp;
var selection = State.Selection;
if (options.Rebuild || baseline.StartedWithNoIndexedFiles)
{
var target = fileTargets[fileIndex];
var info = new FileInfo(target.FilePath);
if (!info.Exists || info.Length < 0)
selection.UseFtsBulkLoad = true;
return;
}

if (selection.ExtractionWorkItemCount == 0
&& scan.StaleFilePurgePlan.Count == 0)
{
selection.UseFtsBulkLoad = false;
return;
}

var dirtyBytes = scan.StaleFilePurgePlan.DeletedBytes;
var persistedSizeExcessBytes = 0L;
var byteEstimateComplete = !baseline.ScanHadErrors
&& scan.StaleFilePurgePlan.ByteEstimateComplete
&& selection.ReadableFileBytes.EstimateComplete;

void AddDirtyFileBytes(int fileIndex)
{
ThrowIfFullScanCancelled();
try
{
var target = runtime.FileTargets[fileIndex];
var info = new FileInfo(target.FilePath);
if (!info.Exists || info.Length < 0)
{
byteEstimateComplete = false;
return;
}

selection.ReadableFileBytes.Remember(
fileIndex,
info.Length);
var persistedSize = csharp.ReusableIndexedFileStats!
.GetPersistedSize(target.IndexPath);
if (!FtsBulkLoadTriggerGuard.TryAccumulateDirtyFileBytes(
dirtyBytes,
persistedSizeExcessBytes,
info.Length,
persistedSize,
out dirtyBytes,
out persistedSizeExcessBytes))
{
byteEstimateComplete = false;
}
}
catch (Exception ex) when (
ex is IOException
or UnauthorizedAccessException
or NotSupportedException
or ArgumentException)
{
byteEstimateComplete = false;
return;
}
}

readableFileBytes.Remember(fileIndex, info.Length);
var persistedSize = reusableIndexedFileStats.GetPersistedSize(target.IndexPath);
if (!FtsBulkLoadTriggerGuard.TryAccumulateDirtyFileBytes(
dirtyBytes,
persistedSizeExcessBytes,
info.Length,
persistedSize,
out dirtyBytes,
out persistedSizeExcessBytes))
if (selection.ExtractionFileIndexes != null)
{
foreach (var fileIndex in selection.ExtractionFileIndexes)
AddDirtyFileBytes(fileIndex);
}
else
{
for (var fileIndex = 0;
fileIndex < runtime.FileTargets.Length;
fileIndex++)
{
byteEstimateComplete = false;
AddDirtyFileBytes(fileIndex);
}
}
catch (Exception ex) when (
ex is IOException
or UnauthorizedAccessException
or NotSupportedException
or ArgumentException)

byteEstimateComplete &=
selection.ReadableFileBytes.EstimateComplete;
var totalBytes = selection.ReadableFileBytes.KnownBytes;
if (!selection.ReadableFileBytes.EstimateComplete
|| totalBytes
> long.MaxValue - scan.StaleFilePurgePlan.DeletedBytes)
{
byteEstimateComplete = false;
}
}
else
{
totalBytes += scan.StaleFilePurgePlan.DeletedBytes;
}

if (extractionFileIndexes != null)
{
foreach (var fileIndex in extractionFileIndexes)
AddDirtyFileBytes(fileIndex);
}
else
{
for (var fileIndex = 0; fileIndex < fileTargets.Count; fileIndex++)
AddDirtyFileBytes(fileIndex);
}
if (totalBytes > long.MaxValue - persistedSizeExcessBytes)
byteEstimateComplete = false;
else
totalBytes += persistedSizeExcessBytes;

byteEstimateComplete &= readableFileBytes.EstimateComplete;
var totalBytes = readableFileBytes.KnownBytes;
if (!readableFileBytes.EstimateComplete
|| totalBytes > long.MaxValue - staleFilePurgePlan.DeletedBytes)
{
byteEstimateComplete = false;
}
else
{
totalBytes += staleFilePurgePlan.DeletedBytes;
selection.UseFtsBulkLoad = byteEstimateComplete
&& FtsBulkLoadTriggerGuard.ShouldUseForDirtyBytes(
dirtyBytes,
totalBytes);
}

if (totalBytes > long.MaxValue - persistedSizeExcessBytes)
byteEstimateComplete = false;
else
totalBytes += persistedSizeExcessBytes;

return byteEstimateComplete
&& FtsBulkLoadTriggerGuard.ShouldUseForDirtyBytes(dirtyBytes, totalBytes);
}
}
Loading
Loading