Skip to content

Core audit fixes F1-F6#71

Merged
Codex-Crusader merged 6 commits into
mainfrom
fix/core-audit-fixes-v2
Jun 16, 2026
Merged

Core audit fixes F1-F6#71
Codex-Crusader merged 6 commits into
mainfrom
fix/core-audit-fixes-v2

Conversation

@Codex-Crusader

Copy link
Copy Markdown
Member

Surgical fixes F1-F6 from the core audit; one fix per commit. Full suite 55 passed.

Codex-Crusader and others added 6 commits June 16, 2026 14:44
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>
@Codex-Crusader

Copy link
Copy Markdown
Member Author

using AI to remove dead code. and fixe some bugs

@Codex-Crusader Codex-Crusader merged commit ebefb5b into main Jun 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant