Skip to content

Expose completion metadata in ad-hoc SARIF - #4945

Merged
Widthdom merged 5 commits into
mainfrom
fix-issue4844
Jul 28, 2026
Merged

Expose completion metadata in ad-hoc SARIF#4945
Widthdom merged 5 commits into
mainfrom
fix-issue4844

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • expose source, returned, omitted, truncation, limit, cursor-availability, and replay metadata on ad-hoc search SARIF runs
  • count the final SARIF result/location unit, including exact-substring occurrence expansion
  • keep guarded recounts bounded and label their observed source counts non-authoritative
  • preserve raw FTS, option-like queries, filters, guards, and normalized search controls in replay commands
  • add complete, limited (1 of 126), empty, occurrence-expanded, guarded, and merged-run regression coverage
  • document the contract in both English and Japanese and add a changelog fragment

Root cause

The ad-hoc search path called the shared SARIF writer without run properties and applied result limits after occurrence expansion without exposing completion accounting. As a result, consumers could not distinguish complete, empty, and truncated SARIF runs or safely reproduce the query.

Validation

  • dotnet restore CodeIndex.sln --locked-mode
  • dotnet build CodeIndex.sln -c Release --no-restore — 0 warnings, 0 errors
  • focused search/SARIF/selector tests — net8.0: 11 passed; net9.0: 11 passed
  • full Release suite — net8.0: 10,608 passed, 7 skipped, 0 failed; net9.0: 10,135 passed, 419 skipped, 0 failed
  • dotnet format CodeIndex.sln --verify-no-changes --no-restore
  • changelog validation — 22 fragments validated
  • final workspace index check — 1,232/1,232 files matched, index_matches_workspace=true
  • Codex adversarial review round 1: 3 findings fixed (occurrence counts, raw-FTS replay flag, option-like query replay)
  • Codex adversarial review round 2: 2 findings fixed (bounded guarded recounts, exhaustive facet-filtered exact counts)

A parallel full-suite run during development exposed an unrelated 5-second Unicode worker timeout; the isolated rerun and the final full suite passed. Related: #4937

Documentation and changelog

  • updated DEVELOPER_GUIDE.md and TESTING_GUIDE.md in both English and Japanese
  • added changelog.d/unreleased/4844.fixed.md
  • did not modify CHANGELOG.md, AGENTS.md, CLAUDE.md, or AGENT_GUIDE.md

Follow-up candidates

Fixes #4844

@Widthdom
Widthdom marked this pull request as ready for review July 28, 2026 01:35
@Widthdom
Widthdom merged commit cfd7c77 into main Jul 28, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4844 branch July 28, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose truncation metadata in ad-hoc SARIF

1 participant