Skip to content

Deterministic sorting for materialized packages/file-facts and TUI risk rows - #9

Closed
rdzehtsiar wants to merge 1 commit into
masterfrom
codex/linear-mention-rdg-38-review-sorting-zhtbcs
Closed

Deterministic sorting for materialized packages/file-facts and TUI risk rows#9
rdzehtsiar wants to merge 1 commit into
masterfrom
codex/linear-mention-rdg-38-review-sorting-zhtbcs

Conversation

@rdzehtsiar

Copy link
Copy Markdown
Owner

Motivation

  • Ensure exposed lists and TUI rows are stable and deterministic so downstream consumers and tests can rely on ordering.
  • Tie-break risk rows with a stable key when scores are equal to avoid flakiness in UI and reports.

Description

  • Order Go source package query results by relative_path in finalize_source_dependencies to make materialized source_file_packages deterministic.
  • Order file fact materialization results by file_analysis.relative_path in materialize_file_facts so file_facts rows are written in a stable order.
  • Change TUI risk row loading in load_risk_rows to ORDER BY score.score DESC, score.relative_path ASC so rows sort by score (descending) then path (ascending) as required.
  • Add regression tests: materializes_source_packages_and_file_facts_in_relative_path_order (store reducer tests) and loads_risk_rows_by_score_desc_then_path_asc (TUI tests) to cover deterministic ordering and score tie-breaking.

Testing

  • Ran cargo fmt --check and it succeeded.
  • Ran cargo test and all unit tests passed (102 passed + CLI tests).
  • Ran cargo clippy --all-targets --all-features -- -D warnings and it completed without warnings.
  • Ran git diff --check and a search for conflict markers (rg -n '^(<<<<<<<|=======|>>>>>>>)') and found none.

Codex Task

@rdzehtsiar
rdzehtsiar marked this pull request as ready for review June 10, 2026 00:55
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Qodana for Rust

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rdzehtsiar rdzehtsiar closed this Jun 10, 2026
@rdzehtsiar
rdzehtsiar deleted the codex/linear-mention-rdg-38-review-sorting-zhtbcs branch June 10, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants