Skip to content

Fix query freshness accounting for zero matches - #5020

Merged
Widthdom merged 9 commits into
mainfrom
fix-issue4907
Aug 1, 2026
Merged

Fix query freshness accounting for zero matches#5020
Widthdom merged 9 commits into
mainfrom
fix-issue4907

Conversation

@Widthdom

@Widthdom Widthdom commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Separate query result cardinality from freshness so clean zero-match named and recipe queries are not reported as stale.
  • Derive freshness from workspace/index state, recipe/query definition versions, and child execution validity.
  • Keep structured freshness aligned across aggregate/compact/count JSON, text, SARIF, and issue-draft output, including classified child failures.
  • Verify Git and non-Git workspaces while avoiding workspace scans for text-only named counts.

Root cause

zero_result_query_count was also used to populate stale_query_names, so a valid zero-result execution was treated as freshness invalidation. The previous execution path also lacked persistent definition identities and structured failed-child observations.

Validation

Documentation and changelog

  • Updated the English and Japanese query-freshness sections in USER_GUIDE.md and TESTING_GUIDE.md.
  • Added changelog.d/unreleased/4907.fixed.md.

Follow-ups

None.

Fixes #4907

@Widthdom
Widthdom marked this pull request as ready for review August 1, 2026 07:33
@Widthdom
Widthdom merged commit cdc9d75 into main Aug 1, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4907 branch August 1, 2026 07:33
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.

Represent clean named queries separately from stale queries

1 participant