Eliminate configuration drift: unify direction/inference defaults to single source of truth#39
Merged
Raynergy-svg merged 4 commits intomainfrom Feb 13, 2026
Merged
Conversation
…onfig - Create src/core/constants.py with DIRECTION_DEFAULTS and INFERENCE_DEFAULTS - Update 4 locations to use DIRECTION_DEFAULTS (training.py, modular_data_loaders.py x2, commands.py) - Fix InferenceConfig.min_tcn_probability from 0.55 to 0.60 (matches YAML config) - Update 2 fallback locations in modular_inference.py to use INFERENCE_DEFAULTS - All defaults now match config/config_improved_H1.yaml authoritative values Co-authored-by: Raynergy-svg <82431565+Raynergy-svg@users.noreply.github.com>
- Test DIRECTION_DEFAULTS and INFERENCE_DEFAULTS are correctly defined - Verify constants match config/config_improved_H1.yaml - Test InferenceConfig uses INFERENCE_DEFAULTS - Test function signatures use DIRECTION_DEFAULTS for default parameters - All tests verify consistency between code and YAML config Co-authored-by: Raynergy-svg <82431565+Raynergy-svg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement direction defaults unification and fix configuration mismatch
Eliminate configuration drift: unify direction/inference defaults to single source of truth
Feb 12, 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.
Configuration drift caused 5 locations to have diverging fallback defaults that didn't match
config/config_improved_H1.yaml. Training used0.005/12, data loaders used0.001/6and0.005/6, backtest used0.0015/24, and InferenceConfig defaulted to0.55instead of0.60.Changes
Created
src/core/constants.py- Single source of truth for defaultsDIRECTION_DEFAULTS:threshold=0.003,lookahead=24INFERENCE_DEFAULTS:min_tcn_probability=0.60, etc.Unified 5 diverging locations to reference shared constants
cli/training.py- Training orchestrationsrc/core/modular_data_loaders.py- Bothload_direction_data()andload_all_modular_data()cli/commands.py- Backtest evaluationsrc/core/modular_inference.py- InferenceConfig + 2 fallback sitesAdded
tests/test_unified_defaults.py- Verifies constants match YAML config and are used correctlyExample
Before:
After:
All fallbacks now match the YAML config authoritative values. Future config changes require updating only
src/core/constants.py.Original prompt
Start implementation
The user has attached the following file paths as relevant context:
- .github/copilot-instructions.md
[Chronological Review: The conversation began with the user requesting to unify direction threshold/lookahead defaults and fix a configuration mismatch in the codebase. The user specified the exact locations in the code where changes were needed, indicating a clear direction for the implementation phase. The conversation then transitioned to the user providing context about the current repository and the active pull request, which is focused on refactoring the repository structure to standard Python conventions.][Intent Mapping: The user explicitly requested to create a single DIRECTION_DEFAULTS constant in a shared location and update five diverging fallback defaults to reference this constant. Additionally, the user requested to fix a mismatch in the InferenceConfig.min_tcn_probability.]
[Technical Inventory: The user is working within a Python repository named "ml_engine," specifically on the branch "copilot/refactor-repo-structure." The user is focused on standardizing configuration defaults and ensuring consistency across the codebase.]
[Code Archaeology: The user identified specific lines in the following files for modification:
[Progress Assessment: The user has outlined specific tasks to be completed but has not yet indicated any completed tasks. The focus is on implementing the requested changes.]
[Context Validation: All necessary context for continuation is captured, including the specific files and lines to modify, as well as the overarching goal of eliminating silent configuration drift.]
[Recent Commands Analysis: The last agent commands involved summarizing the conversation history and capturing the user's requests regarding configuration changes. The tool results included the identification of the user's requests and the context of the repository. The agent was actively working on summarizing the conversation when the token budget was exceeded, which was triggered by the need to encapsulate the user's detailed requests and the repository context.]
1. Conversation Overview: - Primary Objectives: The user requested to "create a single DIRECTION_DEFAULTS constant in a shared location" and "fix InferenceConfig.min_tcn_probability mismatch." - Session Context: The conversation focused on standardizing configuration defaults in the "ml_engine" repository, with specific lines in various files identified for modification. - User Intent Evolution: The user's needs remained consistent, focusing on eliminating configuration drift and ensuring defaults are unified across the codebase.- Technical Foundation:
- Core Technology: Python, used for developing the "ml_engine" repository.
- Framework/Library: Not explicitly mentioned, but the context suggests standard Python conventions are being applied.
- Architectural Pattern: The user is refactoring the repository structure to improve maintainability and consistency.
- Environment Detail: The repository is hosted on GitHub, with an active pull request for refactoring.
- Codebase Status:
- training.py:
- Purpose: Contains training logic and configurations.
- Current State: Lines 820-821 need to be updated to reference the new DIRECTION_DEFAULTS constant.
- modular_data_loaders.py:
- Purpose: Handles data loading for the model.
- Current State: Lines 3666-3670 and 1681-1682 need updates for fallback defaults.
- commands.py:
- Purpose: Contains command definitions and configurations.
- Current State: Line 2702 needs to be updated for fallback defaults.
- modular_inference.py:
- Purpose: Manages inference configurations.
- Current State: Line 420 needs to change the default min_tcn_probability from 0.55 to 0.60.
- Problem Resolution:
- Issues Encountered: Diverging fallback defaults and a mismatch in configuration values.
- Solutions Implemented: Proposed changes to unify defaults and fix the configuration mismatch.
- Debugging Context: No ongoing troubleshooting efforts were mentioned, but the user is focused on implementing the requested changes.
- Lessons Learned: The importance of maintaining consistent configuration defaults to avoid silent drift.
- Progress Tracking:
- Completed Tasks: None reported yet.
- Partially Complete Work: The user has outlined specific changes to be made but has not yet implemented them.
- Validated Outcomes: No features or code have been confirmed working through testing yet.
- Active Work State:
- Current Focus: The user is focused on implementing the changes to unify configuration defaults and fix the mismatch in the InferenceConfig.
- Recent Context: The user provided specific ...
Created from VS Code.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.