docs: fix score-dimension docstrings, CLI/collection naming drift, remove unmounted-backtest claim #86
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gertjan/bodega!86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "docs/fix-drift"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Docs/comments-only drift cleanup — no functional changes. All items verified against current source before editing.
Stale composite-score dimension counts/weights (the code moved from 5/6 dimensions to the current 8-dimension scheme in
src/analytics/scoring.py: momentum 25%, technical 15%, trend 15%, fundamental 12%, analyst 12%, sentiment 8%, stability 8%, volume 5%, with regime-shifted presets). Fixed everywhere the stale numbers were still quoted:src/api/routes/analytics.py— module docstring (top of file) and the/analytics/scoresendpoint docstring.src/cli/client.py—analytics scorescommand docstring, and the hardcoded weight labels in_print_score_detail.README.md— the "Composite asset scoring" feature bullet and thescores_snapshotrow in the MongoDB collections table.docs/schema.md— thescores_snapshotfield table (was missingfundamental_score/analyst_score/sentiment_scoreentirely and had the old weights on the rest).DimensionWeights/WEIGHT_PRESETSinsrc/analytics/scoring.pyas the source of truth, so this shouldn't re-drift silently again.README.md CLI drift:
ops check-timeseries→analytics check-timeseries(the command is registered underanalytics_app, seesrc/cli/commands.py:1092).REFERENCE.md fictional CLI recipe: removed
bodega backtest run AAPL,MSFT --strategy sma-cross --fast 10 --slow 30— greppedsrc/cli/commands.pyandsrc/cli/client.py; there is nobacktestCLI command anywhere. Backtesting is API-only viaPOST /analytics/backtest, which REFERENCE.md already documents correctly elsewhere. Replaced the line with a one-line pointer instead of a fake recipe.Correlation/regime collection-naming drift (checked, no change needed): grepped README.md, REFERENCE.md, DEVELOPMENT.md, CLAUDE.md, AGENTS.md, docs/*.md, TASK_HEALTH_MONITORING.md for
correlation_peers/correlation_clusters/correlation_leadlagor aregimecollection. Found no such references — current docs either don't mention these collections at all or correctly describe the singlecorrelation_snapshot(doc_type discriminator: peers/cluster/lead_lag, persrc/database/repositories/correlation.py) andregime_snapshot(persrc/database/repositories/regime.py). No edit made for this item since no drift exists.Investigation:
src/api/routes/backtest.py(not mounted) — report only, no code changePer the task, I did not mount the router and did not delete the file. History:
src/api/routes/backtest.pywas created in commit581cd9d("feat(backtest): add vectorised backtesting engine with SMA/RSI strategies (F4)", 2026-03-13). That same commit also added a fullPOST /analytics/backtestendpoint directly inline insrc/api/routes/analytics.py(103 lines).git log --followonbacktest.pyshows only 3 touching commits total (creation, a docs-pass commit5754a6e, and a lint-fix commitf5b16b0) — it was never functionally changed after creation.git log -p -- src/api/main.pyacross all of history has zero occurrences ofbacktestin any diff hunk (the one incidental match is an unrelated comment about "simulation/backtesting system"). Sobacktest.py'sAPIRouter(prefix="/analytics", its ownPOST /backtest) was never mounted, at any point — it wasn't unmounted later; it simply was dead code from the moment it was created.analytics.py's inline version (the live one, sinceanalytics.routeris included inmain.py) is the more mature implementation — properparse_date()validation, structuredBacktestResponsemodel, consistent error handling.backtest.py's standalone version is a more primitive first draft (rawdatetime.fromisoformat, untypeddict[str, Any]return, no date validation).routes/backtest.pyfile, then decided partway through the same commit to inline it intoanalytics.pyinstead (likely to reuseanalytics.py's existing dependencies/helpers), and simply forgot to delete the now-orphaned draft file. It's safe to delete — the owner should decide whether to do that or keep it as reference/for a future split.Verification
Run against the rebased branch tip:
ruff check src/— all checks passedmypy src/— no issues found in 207 source filespytest -m "not integration"— 1067 passed, 27 deselectedTest plan
ruff check src/mypy src/pytest -m "not integration"src/analytics/scoring.py,src/cli/commands.py,src/api/main.py,src/database/repositories/correlation.py,src/database/repositories/regime.py) before editing🤖 Generated with Claude Code
c5ad0bf3c0e48301974f