Skip to content

Continuous enhancement: market-relative quantamental resilience - #10

Draft
ryun6249 wants to merge 1 commit into
automation/continuous-enhancement-20260519-1703from
automation/continuous-enhancement-20260519-1802
Draft

Continuous enhancement: market-relative quantamental resilience#10
ryun6249 wants to merge 1 commit into
automation/continuous-enhancement-20260519-1703from
automation/continuous-enhancement-20260519-1802

Conversation

@ryun6249

Copy link
Copy Markdown
Owner

Continuous Enhancement Report

1. Current Status

  • Project purpose: Local FastAPI financial research workstation with market, macro, Quant Lab, Quantamental, ML Forecast, AI Portfolio, and grounded AI briefing surfaces.
  • Existing structure preserved: Yes. Static UI, FastAPI routers, Quantamental services, deterministic AI guardrails, All-default dashboard behavior, and top-right quality summary are preserved.
  • Main issues found: Quantamental score-screen keys were accumulating with duplicated label/row-field mapping, and users lacked a benchmark-aware diagnostic for screening market-relative resilience.

2. Changes Made

Compatibility

  • Added market_resilience as an additive Quantamental score key only.
  • Did not change composite score weights, strategy entry/exit, order/trading code, provider selection, API defaults, secrets, or env files.

Data Consistency

  • Added market_relative_resilience_v1 using existing aligned asset/benchmark returns, beta/correlation, volatility, drawdown, and liquidity vectors.
  • Emits required/available observations, 63-day asset/benchmark/active return, downside capture, active positive-share, component scores, input provenance, warnings, and used_in_composite_score=false.
  • Added SCORE_SCREEN_REGISTRY for centralized score-screen label/row/algorithm metadata.

UI/UX

  • Added compact MRR score/class rows to the Quantamental overview and algorithm summary.
  • Added Market Resilience / ?? ??? to the Score Threshold Screener while preserving existing options.

Visualization

  • Kept the existing compact Quantamental overview pattern; no new crowded chart was added.
  • MRR appears alongside QAM/VAB/DRS/LPS/TES in the same score/class hierarchy.

AI Briefing

  • Added MRR to quant_snapshot and deterministic fallback key_changes.market_resilience_algorithm.
  • AI remains interpretation-only and cannot override deterministic scores/signals.

Translation

  • Added Korean/English labels and smoke coverage for the new score-screen option.

Performance

  • Reused already-loaded vectors; no new provider call, cache path, polling loop, or LLM call was added.

Tests / Validation

  • Updated engine/API/UI/module/contract tests and local smoke scripts for MRR and v17/v7 cache-busted assets.

3. Changed Files

File Change Reason
pipelines/quantamental/quant_engine.py Added market_relative_resilience_v1 algorithm and component score Add benchmark-aware quant diagnostic
pipelines/quantamental/service.py Added score-screen registry, MRR health metadata, MRR row mapping Reduce score-key drift and expose new screen key
pipelines/quantamental/ai_service.py Added MRR to AI context/fallback key changes Keep AI briefing grounded in deterministic data
core/schemas/quantamental.py Added market_resilience score key Preserve typed API contract
app/web/index.html Added Market Resilience option and bumped bundle versions Expose user-facing screening path
app/web/app.js Added score-key labels and allowlist Keep selector behavior stable
app/web/modules/quantamental-ui.js Added MRR labels, overview metrics, and summary row Show diagnostic without a new panel
scripts/check_ui_contract.py Added v17/MRR contract markers Static contract validation
scripts/quantamental_ui_smoke.py Smoke Market Resilience score screen Browser flow coverage
scripts/ai_portfolio_ui_smoke.py Updated bundle version expectations Cross-dashboard smoke alignment
tests/test_quantamental_api.py Added API/score-screen/health assertions Contract coverage
tests/test_quantamental_engines.py Added engine/AI-context assertions Deterministic algorithm coverage
tests/test_ui_modules.py Added module render assertions UI rendering coverage
tests/test_ui_routing_contract.py Updated bundle/MRR markers Static routing contract coverage
docs/CONTINUOUS_ENHANCEMENT_LOG.md Added run analysis, plan, changes, validation Automation traceability

4. Validation Results

Check Command / Tool Result Notes
Lint python -m ruff check ...changed Python/test surfaces... Passed No ruff issues
Build node --check app/web/modules/quantamental-ui.js; node --check app/web/app.js Passed Static JS syntax; no npm build manifest exists
Test python -m pytest tests/test_quantamental_engines.py tests/test_quantamental_api.py tests/test_ui_modules.py tests/test_ui_routing_contract.py -q Passed 84 passed, 4 subtests passed
Test python -m pytest -q Passed 696 passed, 9 subtests passed
UI validation Browser at http://127.0.0.1:8414/ui/?range=1Y#quantamental Passed Desktop and 390px mobile: All view, quality badge, MRR visible, no horizontal overflow
Data validation Live API smoke on port 8414 Passed Health lists MRR; AAPL MRR 69.54; Market Resilience screen returned rows
AI briefing validation Live deterministic AI report Passed key_changes includes market_relative_resilience_v1; no LLM-only claims
Smoke python scripts/quantamental_ui_smoke.py --base-url http://127.0.0.1:8414 --output reports/quantamental_ui_smoke_continuous_20260519_1802.json Passed Market Resilience score screen and Quantamental flows passed
Smoke python scripts/ai_portfolio_ui_smoke.py --base-url http://127.0.0.1:8414 --timeout-s 240 --output reports/ai_portfolio_ui_smoke_continuous_20260519_1802.json Passed Cross-dashboard actions passed; console errors empty

5. Remaining Risks

  • MRR is diagnostic-only and should not be promoted into composite scoring without explicit approval.
  • Score-screen keys are now centralized in service metadata, but frontend labels still live in the static UI copy tables.
  • npm/pnpm commands remain excluded because the repo root has no frontend package manifest.

6. Next Enhancement Suggestions

  1. Consider serving score-screen metadata from /quantamental/health into the UI selector to remove the remaining static label drift.
  2. Add a compact algorithm detail drawer for QAM/VAB/DRS/LPS/TES/MRR inputs without cluttering the normal overview.
  3. Add a targeted AI briefing assertion that all diagnostic algorithms included in quant_snapshot.algorithms are either summarized or explicitly marked unavailable.

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