Sort the findings tables newest disclosure first - #6
Merged
Conversation
Both tables rendered in load_findings' key order, which reads as arbitrary: CVE ids sort lexically, so CVE-2026-27959 sat below four CVE-2025 records despite being disclosed two months later. Adds records.published_newest_first, which filters to published and sorts by disclosed descending, and routes both renderers through it. That also removes the duplicated status filter each renderer carried. The sort is stable, so same-day disclosures keep key order instead of shuffling between runs and churning the README diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The published findings tables rendered in
load_findings' key order, which reads as arbitrary. CVE ids sort lexically, soCVE-2026-27959sat at the bottom of the table despite being disclosed two months after every other record — an identifier assigned early can outrank one disclosed much later.Change
Adds
records.published_newest_first(findings): filters tostatus: publishedand sorts bydiscloseddescending. Both renderers now route through it, which also removes the duplicated status filter each was carrying inline.The sort is stable, so same-day disclosures keep the key order they arrived in. Without that, the three findings sharing 2025-12-22 could shuffle between runs and churn the README diff.
load_findingsstill returns key order — that remains the canonical order for detail pages and duplicate detection. Only the tables re-sort.Result
Identical ordering in the HTML table.
Verification
pytest -q— 150 passed (145 before, 5 new)generate --today 2026-08-14— exit 0;generate --check— exit 0generateproduces a byte-identical READMETests added
test_published_newest_first_orders_by_disclosure_datetest_published_newest_first_breaks_ties_on_keytest_published_newest_first_drops_unpublished_recordstest_published_table_lists_newest_disclosure_firsttest_index_published_table_lists_newest_disclosure_firstNot changed
sort.jsis untouched — this is the server-rendered default order. Clicking a column header still re-sorts client-side as before, and no header starts with anaria-sortindicator.🤖 Generated with Claude Code