fix(stats): skip corrupt decided/*.yaml so vouch stats cannot crash - #673
Merged
plind-junior merged 2 commits intoJul 30, 2026
Merged
Conversation
_list_decided parsed every decided/*.yaml strictly, so one bad file took down vouch stats / kb.stats. Skip unreadable files via _load_or_skip like list_proposals already does. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
|
@kai392 Next time, raise the issue on GH for such kinda valid discoveries. It's worth to be rewarded as a discovery |
plind-junior
enabled auto-merge
July 30, 2026 21:39
plind-junior
disabled auto-merge
July 30, 2026 22:00
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.
Summary
Root cause:
stats._list_decided()— used byreview_summary/collect_stats(vouch stats,kb.stats) — parsed everydecided/*.yamlstrictly. One corrupt or hand-edited decided file raised an unhandled exception and aborted the whole stats surface.Meanwhile
KBStore.list_proposals()already uses_load_or_skip, andlist_pages()gained the same resilience in #360._list_decidedwas the leftover outlier.Fix: Use
_load_or_skipwhen loading decided proposals. One bad file logs a warning and is skipped; valid decisions still count.Impact:
vouch stats/kb.statskeep working when a single decided proposal YAML is unreadable.Reproduction
Risk / tradeoffs
list_proposals). Audit-basedaudit_totalsin the same response are unaffected.Test plan
test_review_summary_skips_corrupt_decided_file(new)tests/test_stats.pypass