Daily Audit 2026-04-24: Fix CatBoost optimizer bug, print() violation, hardcoded capital - #205
Draft
ch55secake with Copilot wants to merge 3 commits into
Draft
Daily Audit 2026-04-24: Fix CatBoost optimizer bug, print() violation, hardcoded capital#205ch55secake with Copilot wants to merge 3 commits into
ch55secake with Copilot wants to merge 3 commits into
Conversation
…on, hardcoded capital Agent-Logs-Url: https://github.com/ch55secake/hyperion/sessions/7d1f2f6b-77fa-4c72-80e7-e4bf44ca5fc1 Co-authored-by: ch55secake <87881861+ch55secake@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ch55secake/hyperion/sessions/7d1f2f6b-77fa-4c72-80e7-e4bf44ca5fc1 Co-authored-by: ch55secake <87881861+ch55secake@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Audit Hyperion codebase and report new findings
Daily Audit 2026-04-24: Fix CatBoost optimizer bug, print() violation, hardcoded capital
Apr 24, 2026
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.
Description
Three new bugs identified during the 2026-04-24 codebase audit: a logic error that feeds LightGBM hyperparameters into CatBoost, a
print()call violating the Logger singleton convention, and a hardcoded initial capital value that diverges from the actual simulation config.Changes in this pull request
src/pipeline/single_pipeline.py— CatBoost gets wrong hyperparameters when optimisation is enabledThe original
elsebranch ran LightGBM Optuna optimisation for any non-XGBoost model type, passing LightGBM params (num_leaves,bagging_fraction, …) intoCatBoostStockPredictorwhich expectsdepth/iterations/l2_leaf_reg. Now uses explicitelif "lightgbm"branch;"catboost"(and any future type) logs a warning and falls back to model defaults.optimizer.save_results()deduplicated to one call.src/ranking/ranker.py—print()instead oflogger.warning()print("⚠️ No stocks meet the confidence threshold…")replaced withlogger.warning(…); added missingfrom src.util import loggerimport.src/writer/result_writer.py— hardcoded$10,000.00ignores actual simulation capitalpersist_resultsnow acceptsinitial_capital: float = 10_000.0(default preserves backward compatibility) and writesf" Initial Capital: ${initial_capital:,.2f}\n\n".