* feat(detector): persist all risk assessments to risk_assessments table
* docs+test: add CHANGELOG and persistence regression tests
Documents the persist-all-assessments feature shipped in 8a0e8c9 and adds two regression tests covering: (1) sub-threshold assessments still hit the DB, and (2) DB write failures do not block alert dispatch.
* fix: add detector mock to pipeline test fixture
The persist_assessments feature accesses settings.detector which the
existing mock_settings fixture didn't include.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: ruff lint and format fixes for persist assessment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: jp-vps-deploy <vps-deploy@schrodinger01>
Co-authored-by: schrodinger01 <schrodinger01@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Changelog
All notable changes to this project are documented in this file. The format is loosely based on Keep a Changelog.
[Unreleased]
Added
- Risk-assessment persistence: every signal-bearing trade now writes a row
to the new
risk_assessmentstable, regardless of whether the assessment meets the alert threshold. This is the ground-truth log future backtests will read instead of greppingalerts.log/journalctl.- Pipeline:
Pipeline._score_and_alertcallsPipeline._persist_assessmentfor every assessment; failures are caught and never block alert dispatch. - Storage: new
RiskAssessmentModel,RiskAssessmentDTO, andRiskAssessmentRepository(alembic migration shipped previously). - Config:
DETECTOR_PERSIST_ASSESSMENTSenv var (defaulttrue) controls the write path so it can be disabled without code changes. - Tests:
tests/test_persist_assessment.pycovers (a) sub-threshold rows are persisted withshould_alert=Falseand dispatch is skipped, and (b) DB failures during persistence do not block dispatching.
- Pipeline:
Changed
- Alert threshold (
DETECTOR_ALERT_THRESHOLD) is now fully env-driven; the legacy hard-coded0.6default has been raised to0.80for production.
Notes
- Backtest scripts can now source data from
risk_assessmentsdirectly. Thealerts.logparsing path remains for one release as a fallback.