Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions changelog.d/unreleased/3656.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
category: internal
issues:
- 3656
affected:
- src/CodeIndex/Cli/IndexCommandRunner.cs
---

## English

- **Removed the stale dry-run probe helper (#3656)** — deleted the unused old probe helper while leaving the active full-scan checkpoint constants wired to the current implementation.

## 日本語

- **古い dry-run probe helper を削除しました (#3656)** — 未使用の旧 probe helper を削除し、現行実装で使われている full-scan checkpoint 定数は維持しました。
19 changes: 19 additions & 0 deletions changelog.d/unreleased/3669.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
category: fixed
issues:
- 3669
affected:
- src/CodeIndex/Cli/ConsoleUi.cs
- src/CodeIndex/Cli/CliFlagSchema.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- tests/CodeIndex.Tests/ConsoleUiTests.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSymbolTests.cs
---

## English

- **Improved unused audit scoping (#3669)** — `cdidx unused --audit-scope source` now focuses cleanup output on private/internal source candidates while excluding documentation-shaped paths; `--audit-scope all` keeps the caller's explicit filters.

## 日本語

- **unused の audit scope を改善しました (#3669)** — `cdidx unused --audit-scope source` は documentation 形状の path を除外しつつ private/internal の source cleanup 候補に絞るようになりました。`--audit-scope all` は呼び出し側の明示 filter のみを使います。
19 changes: 19 additions & 0 deletions changelog.d/unreleased/3671.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
category: internal
issues:
- 3671
affected:
- src/CodeIndex/Cli/IndexLock.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Database/DbReader.CSharpResolution.cs
- src/CodeIndex/Database/DbReader.References.cs
- src/CodeIndex/Database/DbSymbolReader.cs
---

## English

- **Removed stale private CLI/database helpers (#3671)** — deleted unused helper methods after confirming they were not called by current CLI or reader paths.

## 日本語

- **CLI / database の古い private helper を削除しました (#3671)** — 現行 CLI / reader 経路から呼ばれていないことを確認した未使用 helper を削除しました。
18 changes: 18 additions & 0 deletions changelog.d/unreleased/3672.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
category: internal
issues:
- 3672
affected:
- src/CodeIndex/Indexer/References/Languages/CSharpReferenceExtractor.Support.cs
- src/CodeIndex/Indexer/References/Languages/LuaReferenceExtractor.cs
- src/CodeIndex/Indexer/References/Languages/XamlReferenceExtractor.cs
- src/CodeIndex/Indexer/References/ReferenceExtractor.TypeReferences.cs
---

## English

- **Removed stale reference extractor helpers (#3672)** — deleted unreferenced helper methods and fields after confirming they are not called by current extraction paths.

## 日本語

- **古い reference extractor helper を削除しました (#3672)** — 現行の抽出経路から呼ばれていない未使用 helper method と field を削除しました。
16 changes: 16 additions & 0 deletions changelog.d/unreleased/3679.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
issues:
- 3679
affected:
- src/CodeIndex/Cli/QueryCommandRunner.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSymbolTests.cs
---

## English

- **Improved compact unused output (#3679)** — compact unused JSON now includes representative symbol samples by bucket while continuing to omit the full `symbols` section.

## 日本語

- **compact unused 出力を改善しました (#3679)** — full `symbols` セクションは省略したまま、bucket ごとの代表 symbol サンプルを compact unused JSON に含めるようにしました。
21 changes: 21 additions & 0 deletions changelog.d/unreleased/3691.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
category: fixed
issues:
- 3691
affected:
- src/CodeIndex/Cli/ConsoleUi.cs
- src/CodeIndex/Cli/CliFlagSchema.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Database/DbSymbolReader.cs
- src/CodeIndex/Models/QueryResults.cs
- tests/CodeIndex.Tests/ConsoleUiTests.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSymbolTests.cs
---

## English

- **Added unused result tags and pagination (#3691)** — unused JSON results now include reason tags, and `cdidx unused` can page result sets with `next_cursor` / `--cursor unused:<offset>`.

## 日本語

- **unused 結果に tag と pagination を追加しました (#3691)** — unused JSON 結果に reason tag を含め、`next_cursor` / `--cursor unused:<offset>` で `cdidx unused` の結果をページングできるようにしました。
5 changes: 3 additions & 2 deletions src/CodeIndex/Cli/CliFlagSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ internal static class CliFlagSchema
private static readonly string[] SymbolSortCommands = ["symbols"];
private static readonly string[] ByBucketCommands = ["unused"];
private static readonly string[] UnusedFilterCommands = ["unused"];
private static readonly string[] CursorCommands = ["search", "unused"];
private static readonly string[] AllResultCommands = ["goto", "find"];

private static readonly string[] SinceCommands = ["search", "definition", "symbols", "files", "suggestions"];
Expand Down Expand Up @@ -285,7 +286,7 @@ private static IReadOnlyList<CliFlag> BuildAll()
new() { Name = "--include-query", ValuePlaceholder = "<name>", Description = "Search recipe: include one child query; repeat or comma-separate values", Commands = Set("search") },
new() { Name = "--exclude-query", ValuePlaceholder = "<name>", Description = "Search recipe: exclude one child query; repeat or comma-separate values", Commands = Set("search") },
new() { Name = "--list-recipes", Description = "Search: list built-in audit recipes", Commands = Set("search") },
new() { Name = "--audit-scope", ValuePlaceholder = "<source|all>", Description = "Search recipes: use production source defaults or include all indexed paths", Commands = Set("search") },
new() { Name = "--audit-scope", ValuePlaceholder = "<source|all>", Description = "Search recipes/Unused: use production source defaults or include all indexed paths", Commands = Set("search", "unused") },
new() { Name = "--show-excluded", Description = "Search recipes: include effective scope and exclusion diagnostics in recipe output", Commands = Set("search") },
new() { Name = "--named-query", ValuePlaceholder = "<name>=<query>", Description = "Search: add one named ad hoc batch query", Commands = Set("search") },
new() { Name = "--open-issues", ValuePlaceholder = "<path|github|github:owner/name>", Description = "Preflight issue drafts against open issue JSON or GitHub open issues", Commands = Set("search", "suggestions") },
Expand All @@ -294,7 +295,7 @@ private static IReadOnlyList<CliFlag> BuildAll()
new() { Name = "--duplicate-threshold", ValuePlaceholder = "<score>", Description = "Issue-drafts: explicit duplicate-preflight minimum score from 0 to 1", Commands = Set("search", "suggestions") },
new() { Name = "--issue-title", ValuePlaceholder = "<title>", Description = "Search issue-drafts: override the title for an ad hoc search draft", Commands = Set("search") },
new() { Name = "--issue-label", ValuePlaceholder = "<label>", Description = "Search issue-drafts: add a label hint; repeat or comma-separate values", Commands = Set("search") },
new() { Name = "--cursor", ValuePlaceholder = "<cursor>", Description = "Search recipe: pagination cursor returned as next_cursor", Commands = Set("search") },
new() { Name = "--cursor", ValuePlaceholder = "<cursor>", Description = "Search recipe or unused pagination cursor returned as next_cursor", Commands = Set(CursorCommands) },
new() { Name = "--status", ValuePlaceholder = "<status>", Description = "Suggestions: filter by suggestion status", Commands = Set("suggestions") },
new() { Name = "--category", ValuePlaceholder = "<category>", Description = "Suggestions: filter by category", Commands = Set("suggestions") },
new() { Name = "--agent", ValuePlaceholder = "<agent>", Description = "Suggestions: filter by agent", Commands = Set("suggestions") },
Expand Down
4 changes: 2 additions & 2 deletions src/CodeIndex/Cli/ConsoleUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private static readonly (string Command, string Usage)[] CommandUsageLines =
("validate", "cdidx validate [--db <path>] [--json[=array]] [--format <text|json|count|compact|csv|tsv|lsp|qf|sarif>] [--verbose] [--limit <n>|--top <n>] [--kind <kind>] [--severity <info|warning|error>] [--path <glob>]"),
("impact", "cdidx impact <query>|--query <query>|-- <query> [--db <path>] [--json] [--verbose] [--limit <n>|--top <n>] [--lang <lang>] [--path <glob>] [--exclude-path <glob>] [--exclude-tests] [--body] [--snippet-lines <n>] [--max-line-width <n>] [--max-hops <n>] [--count] [--with-paths]"),
("deps", "cdidx deps [--db <path>] [--json] [--format <dot|graphml|json-graph|edgelist>] [--verbose] [--limit <n>|--top <n>] [--lang <lang>] [--path <glob>] [--exclude-path <glob>] [--exclude-tests] [--reverse] [--cycles]"),
("unused", "cdidx unused [--db <path>] [--json] [--compact] [--verbose] [--limit <n>|--top <n>] [--kind <kind>] [--bucket <bucket>] [--min-confidence <medium|low>] [--visibility <v[,v]>] [--exclude-visibility <v[,v]>] [--lang <lang>] [--path <glob>] [--exclude-path <glob>] [--exclude-tests] [--count] [--by-bucket]"),
("unused", "cdidx unused [--db <path>] [--json] [--compact] [--verbose] [--limit <n>|--top <n>] [--cursor <unused:offset>] [--audit-scope <source|all>] [--kind <kind>] [--bucket <bucket>] [--min-confidence <medium|low>] [--visibility <v[,v]>] [--exclude-visibility <v[,v]>] [--lang <lang>] [--path <glob>] [--exclude-path <glob>] [--exclude-tests] [--count] [--by-bucket]"),
("hotspots", "cdidx hotspots [--db <path>] [--json] [--verbose] [--limit <n>|--top <n>] [--kind <kind>] [--visibility <v[,v]>] [--exclude-visibility <v[,v]>] [--lang <lang>] [--path <glob>] [--exclude-path <glob>] [--exclude-tests] [--count] [--group-by <symbol|file|statement>] [--group-by-name]"),
("suggestions", "cdidx suggestions <list|show|export> [id] [--db <path>] [--json] [--status <all|submitted|unsubmitted>] [--language <lang>] [--category <category>] [--since <datetime>] [--agent <name>] [--limit <n>] [--offset <n>] [--format <json|markdown|issue-drafts>] [--open-issues <path|github|github:owner/name>] [--repo <owner/name>] [--duplicate-confidence <low|medium|high>|--duplicate-threshold <score>]"),
("export", "cdidx export <archive> [--db <path>] [--json]"),
Expand Down Expand Up @@ -1018,7 +1018,7 @@ private static void PrintFlagReference(Action<string> WriteHelpLine)
WriteHelpLine(" --named-query <name>=<query> search only: add a named ad hoc batch query; repeat to run related searches with grouped compact results");
Console.WriteLine(" --exclude-path <glob> Exclude glob-style path patterns (* and ?) (repeatable)");
Console.WriteLine(" --exclude-tests Exclude likely test files");
WriteHelpLine(" --audit-scope <source|all> search recipes only: source uses recipe default production-code paths/excludes; all searches docs, tests, changelog, and recipe definitions unless other filters exclude them");
WriteHelpLine(" --audit-scope <source|all> search recipes/unused: source uses production-code cleanup defaults; all disables source-scope defaults");
Console.WriteLine(" --exclude-comments search only: suppress comment-only matches");
Console.WriteLine(" --exclude-strings search only: suppress string, regex, and help-text matches");
Console.WriteLine(" --exclude-fixtures search only: suppress fixture-only matches in tests");
Expand Down
39 changes: 0 additions & 39 deletions src/CodeIndex/Cli/IndexCommandRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -874,45 +874,6 @@ private static bool IsPathEqualOrParent(string candidateParent, string candidate
return PathCasing.IsPathEqualOrParent(normalizedParent, normalizedChild);
}

private static bool TryProbeDryRunFile(FileIndexer indexer, string absolutePath, out string lang, out string? error)
{
lang = string.Empty;
error = null;

var indexability = indexer.GetFileIndexabilityForIndexing(absolutePath);
if (indexability == FileIndexer.FileProbeStatus.ProbeFailed)
{
error = "Could not probe file for indexability/language.";
return false;
}

if (indexability != FileIndexer.FileProbeStatus.Supported)
return false;

var detection = indexer.TryDetectLanguageForIndexing(absolutePath);
if (detection.Status == FileIndexer.FileProbeStatus.ProbeFailed)
{
error = "Could not probe file for indexability/language.";
return false;
}

if (detection.Status != FileIndexer.FileProbeStatus.Supported)
return false;

try
{
var (record, _, _, warning) = indexer.BuildRecordWithRawBytes(absolutePath);
lang = record.Lang ?? "unknown";
error = warning;
return true;
}
catch (Exception ex)
{
error = ex.Message;
return false;
}
}

// Issue #1509: stamp the Git HEAD commit, branch, and UTC timestamp into
// codeindex_meta so cross-session staleness ("the DB was indexed at commit X but
// you're now at Y, N commits ahead") is detectable by `status` / consumers. Only
Expand Down
7 changes: 0 additions & 7 deletions src/CodeIndex/Cli/IndexLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,6 @@ private static string SerializeInfo(IndexLockInfo info)
return new IndexLockInfo(pid.Value, started.Value);
}

private static string EscapeValue(string? value)
{
if (string.IsNullOrEmpty(value))
return string.Empty;
return value.Replace("\\", "\\\\").Replace("\n", "\\n").Replace("\r", "\\r");
}

private static string UnescapeValue(string value)
{
if (string.IsNullOrEmpty(value))
Expand Down
Loading
Loading