Core audit fixes F1-F6#71
Merged
Merged
Conversation
Reuse the existing _kw_re() helper so event keywords match whole tokens instead of substrings. Prevents false positives like "sec" in "sector" (regulation) and "war" in "software" (geopolitical). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Scores with |score| < SIGNAL_THRESHOLDS["slightly_bullish"] (1.0) carry no directional claim but were graded as "down" predictions, polluting the hit rate. Skip them so num_evaluated only counts directional signals. Threshold imported from config rather than hardcoded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fetch_news_articles now computes sentiment and events_detected once per article after deduplication. correlate_news reads these precomputed fields and only recomputes them as a lazy fallback for articles that lack them (e.g. handmade dicts in tests), so the per-asset N-times recompute is gone while the returned article dict shape stays identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Read at most 5MB+1 from each feed and skip the feed if it exceeds the cap, so one oversized/malformed feed cannot exhaust memory. Also deduplicate the combined article list before applying the NEWS_MAX_ARTICLES slice so near-duplicates no longer consume slots that unique articles could fill. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Single-row price data made change_30d compute (latest-latest)/latest = 0.0, reporting a false 0% change instead of "no data". safe_pct now returns None for n < 1, matching how change_1d/change_7d already signal missing history. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The per-asset errors accumulated during run_full_scan were built but never returned. Expose them under a reserved, underscore-prefixed "_errors" key so the list sits beside the category buckets without being mistaken for one (mirrors the existing _scan_summary sibling convention). To keep this forward-compatible, category consumers now skip any key starting with "_", so this and future metadata keys can never be iterated as a category. Updated the two run_full_scan test consumers accordingly and documented the return contract in the docstring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
using AI to remove dead code. and fixe some bugs |
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.
Surgical fixes F1-F6 from the core audit; one fix per commit. Full suite 55 passed.