Summary
QueryFindCountJsonResult exposes both files and file_count fields that carry the same value. This is internal schema noise that other count-shaped results in the same file (QueryCountFilesJsonResult) avoid.
Evidence
src/CodeIndex/Cli/JsonOutputContracts.cs:35-38:
internal sealed record QueryFindCountJsonResult(
[property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("files")] int Files,
[property: JsonPropertyName("file_count")] int FileCount);
vs. QueryCountFilesJsonResult (line 30) which uses only files. Both ultimately came from the same total-files count in the underlying query.
Impact
- Clients consuming both
count-style commands must handle the inconsistent name.
- New JSON consumers may pick the "wrong" field and silently break later if one is removed.
Proposed direction
- Decide on
file_count (more explicit) or files (shorter, consistent with QueryCountFilesJsonResult).
- Deprecate the other field in
JSON_OUTPUT.md (or wherever the schema is documented) with a removal-version note.
- Add a CHANGELOG fragment for the deprecation.
Repro env
- Branch:
main @ 2ee912d (release v1.21.0)
Summary
QueryFindCountJsonResultexposes bothfilesandfile_countfields that carry the same value. This is internal schema noise that other count-shaped results in the same file (QueryCountFilesJsonResult) avoid.Evidence
src/CodeIndex/Cli/JsonOutputContracts.cs:35-38:vs.
QueryCountFilesJsonResult(line 30) which uses onlyfiles. Both ultimately came from the same total-files count in the underlying query.Impact
count-style commands must handle the inconsistent name.Proposed direction
file_count(more explicit) orfiles(shorter, consistent withQueryCountFilesJsonResult).JSON_OUTPUT.md(or wherever the schema is documented) with a removal-version note.Repro env
main@ 2ee912d (release v1.21.0)