Skip to content

Continuous enhancement: risk-adjusted Quant Lab momentum - #4

Open
ryun6249 wants to merge 1 commit into
automation/continuous-enhancement-20260519-1203from
automation/continuous-enhancement-20260519-1305
Open

Continuous enhancement: risk-adjusted Quant Lab momentum#4
ryun6249 wants to merge 1 commit into
automation/continuous-enhancement-20260519-1203from
automation/continuous-enhancement-20260519-1305

Conversation

@ryun6249

Copy link
Copy Markdown
Owner

Continuous Enhancement Report

1. Current Status

  • Project purpose: FastAPI-served local financial research workstation for market, macro, Quant Lab, Quantamental, ML Forecast, AI Portfolio, and grounded AI workflows.
  • Existing structure preserved: yes; changes stay inside existing Quant Lab factor/signal/backtest/strategy/UI/test boundaries.
  • Main issues found: Quant Lab had momentum and volatility factors, but no first-class risk-adjusted momentum algorithm/template. Full pytest remains blocked by the existing clean-branch missing pipelines.quantamental.service import.

2. Changes Made

Compatibility

  • Added a new Quant Lab template without changing existing templates, API shape, strategy execution assumptions, secrets, or trading/order code.

Data Consistency

  • Added deterministic risk_adjusted_momentum_63_21 factor data to the factor catalog and default Quant Lab feature set.
  • Added risk_adjusted_momentum_v1 to default Strategy Governance data.

UI/UX

  • Added 위험조정 모멘텀 to the Quant Lab strategy selector and strategy-control mapping.
  • Bumped static UI bundle version to avoid stale browser assets.

Visualization

  • No chart math changed; Quant Lab labels and score mode now surface the new algorithm in existing report paths.

AI Briefing

  • No LLM call path changed. The new quant score is calculated in code, not generated by AI.

Translation

  • Added a concise Korean UI label without altering ticker/date/number/unit handling.

Performance

  • Reuses existing in-memory price arrays and backtest pipeline. No polling, provider fetch, or background LLM work added.

Tests / Validation

  • Added factor, signal, backtest, Quant Lab API/pipeline, strategy registry, UI contract, and static contract coverage.

3. Changed Files

File Change Reason
pipelines/factors/core.py Added risk-adjusted momentum math Deterministic quant factor calculation
pipelines/factors/catalog.py Registered risk_adjusted_momentum_63_21 Expose factor through existing catalog/API
pipelines/signals/rule_based.py Added risk_adjusted_momentum signal template scoring Generate signals from code-computed factor data
pipelines/backtest/engine.py Added risk-adjusted ranking score mode Backtest the new algorithm with no-lookahead policy
pipelines/orchestration/quant_lab_pipeline.py Wired template/config/default features Integrate factor/signal/backtest data flow
config/quant_strategies/defaults.yaml Added default strategy data Make strategy available to users
pipelines/strategies/registry.py Added fallback strategy data Preserve behavior if config file is missing
app/web/index.html, app/web/app.js Added strategy option and label mapping UI access to the new strategy
scripts/check_ui_contract.py, scripts/ai_portfolio_ui_smoke.py Updated contract markers/bundle version Keep UI validation aligned
tests/* Added regression coverage Verify factor, signals, backtest, API, UI contracts
docs/CONTINUOUS_ENHANCEMENT_LOG.md Documented analysis, changes, validation, blocker Automation audit trail

4. Validation Results

Check Command / Tool Result Notes
Lint git diff --check Passed Only Windows CRLF conversion warnings
Build Not run Excluded No repo-level package.json/pnpm-lock.yaml
Python syntax python -m py_compile ... Passed New backend/scripts compile
JS syntax node --check app/web/app.js Passed Static controller parses
UI contract python scripts/check_ui_contract.py --output reports/ui_contract_continuous_20260519_1305_pretest.json Passed New option/label markers included
Unit/contract tests python -m pytest tests/test_factor_catalog.py tests/test_signal_generation.py tests/test_backtest_engine.py tests/test_strategy_registry.py -q Passed 18 passed
Quant/API/UI tests python -m pytest tests/test_quant_lab_pipeline.py tests/test_quant_lab_api.py tests/test_ui_routing_contract.py tests/test_api_routing_contract.py -q Passed 81 passed, 4 subtests passed
Focused rerun python -m pytest tests/test_backtest_engine.py tests/test_quant_lab_pipeline.py tests/test_quant_lab_api.py -q Passed 33 passed
Full pytest python -m pytest -q Blocked Existing clean-branch pipelines.quantamental.service missing import
UI validation Browser MCP + npx playwright screenshot Passed with known unrelated console error Quant tab All view, option visible/selectable, no desktop overflow; mobile screenshot captured
Data validation Live /api/v1/quant/config and /api/v1/quant/strategy/list Passed New template and default strategy returned
AI briefing validation Code inspection/test scope Passed unchanged No new AI route or prompt behavior added

5. Remaining Risks

  • Full pytest is still blocked before execution by the existing clean-branch Quantamental import issue: pipelines/quantamental/service.py is absent in this stacked worktree.
  • Browser console still records the known missing Quantamental watchlist route in this clean branch; it is unrelated to this Quant Lab change.

6. Next Enhancement Suggestions

  1. Bring the tracked Quantamental router/service implementation into the stacked branch so full pytest and Quantamental browser smoke can run again.
  2. Add a UI result annotation explaining risk-adjusted momentum as return per realized volatility in the Quant Lab report summary.
  3. Add benchmark-relative risk-adjusted momentum as a separate factor after the current absolute version is reviewed.

7. Safety Notes

  • main/master was not modified directly.
  • Auto-merge was not enabled.
  • Secrets were not touched.
  • Trading/order execution logic was not modified.
  • Unsupported facts were not presented as verified.

@ryun6249 ryun6249 added the enhancement New feature or request label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant