Repository navigation
Input validation, typed errors, real CSV, stricter CI, license - #16
Merged
Merged
Conversation
Correctness - duplicate pre-trust peers: the last value wins (same as local trust); before, duplicates were normalized separately and then collapsed by to_dense, so pre-trust and the scores could stop summing to 1 - Vector::to_dense adds repeated indices instead of overwriting them - weights must be finite and non-negative; NaN/inf are rejected with the line number instead of spinning forever - negative weights (distrust) are rejected until their effect on the scores is defined; the unused discount step is off the engine path - compute() caps iterations at 10,000 (alpha = 0 on a periodic graph used to loop forever) and guards against non-finite deltas - flat tail check compares only the top num_leaders peers Robustness and cleanup - Error enum with file, line and reason instead of String errors - CSV read with the csv crate: quotes, embedded commas, escaped quotes; line numbers stay correct across blank lines; same speed as before - CLI: usage message, error: ... with exit code 1, no expect/unwrap, CSV-quoted output, quiet on a closed pipe - wasm-bindgen tests for run(); start function renamed from main - removed ConvergenceChecker, duplicate canonicalize, stale wrappers and resolved todos; cargo fmt and clippy clean on native and wasm32 - crossbeam-epoch 0.9.21 (RUSTSEC-2026-0204) - Cargo.toml license field
- CSV tab parses and writes quoted fields the same way as the engine - engine errors (e.g. alpha 0 on a periodic network) are shown under the ranking; before they were overwritten right away
Merged
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.
Addresses the review:
to_denseadds repeated indices. Scores always sum to 1.csvcrate handles quotes, embedded commas and escaped quotes; correct line numbers; same speed.Errorenum instead ofString; the CLI printserror: ...and exits 1, noexpect; output is proper CSV.cargo fmtand clippy clean on native and wasm32.cargo audit(fixed RUSTSEC-2026-0204 in crossbeam-epoch).Results are unchanged on valid input (bit-identical on a 100k-peer benchmark).