Skip to content

fix: Remove dead Flask-era code, fix lint errors, add docs/assets fal… - #4

Merged
Samarthuday merged 1 commit into
mainfrom
fix/final-integration-validation
Aug 28, 2026
Merged

fix: Remove dead Flask-era code, fix lint errors, add docs/assets fal…#4
Samarthuday merged 1 commit into
mainfrom
fix/final-integration-validation

Conversation

@Samarthuday

Copy link
Copy Markdown
Owner

…lback

An external review of main flagged several potential integration issues. Verified against the actual codebase: temporal_split, fit_model(config=...), exact top-K alert ranking, currency-aware behavioral windows, and the FastAPI/model feature schema were already consistent (test_leakage.py already covers top-K-on-ties and currency-aware windows). The following were real issues and are fixed here:

Dead code removal:

  • Deleted src/api/app.py (orphaned Flask app, unreachable, not imported anywhere), src/api/schemas.py (Marshmallow, Flask-only), src/api/openapi.yaml (hand-written spec superseded by FastAPI's auto-generated schema), src/api/templates/ (Flask Jinja template superseded by public/index.html), and src/models/inference.py (duplicate of src/api/inference.py, only consumer was the deleted app.py)
  • Removed dead threshold_for_alert_rate() from metrics.py (quantile-based, unused everywhere -- top_k_alert_mask is the only path actually used)

Lint (ruff check was failing with 23 errors -- CI would have failed):

  • Fixed import ordering and removed unused imports across affected files
  • Removed f-strings without placeholders in train_model.py

Dashboard resilience:

  • results_loader.py now falls back to the committed docs/assets/ snapshot when reports/.csv or reports/figures/.png don't exist locally, so a fresh clone shows real published results without retraining first (verified by simulating a clean clone with no local reports/ output)

Docs:

  • Fixed stale "Flask" mention in the tech-stack line (README already documented FastAPI correctly everywhere else, and already embedded all 6 result charts)

All 60 tests pass, ruff check is clean.

…lback

An external review of main flagged several potential integration issues.
Verified against the actual codebase: temporal_split, fit_model(config=...),
exact top-K alert ranking, currency-aware behavioral windows, and the
FastAPI/model feature schema were already consistent (test_leakage.py
already covers top-K-on-ties and currency-aware windows). The following
were real issues and are fixed here:

**Dead code removal:**
- Deleted src/api/app.py (orphaned Flask app, unreachable, not imported
  anywhere), src/api/schemas.py (Marshmallow, Flask-only), src/api/openapi.yaml
  (hand-written spec superseded by FastAPI's auto-generated schema),
  src/api/templates/ (Flask Jinja template superseded by public/index.html),
  and src/models/inference.py (duplicate of src/api/inference.py, only
  consumer was the deleted app.py)
- Removed dead threshold_for_alert_rate() from metrics.py (quantile-based,
  unused everywhere -- top_k_alert_mask is the only path actually used)

**Lint (ruff check was failing with 23 errors -- CI would have failed):**
- Fixed import ordering and removed unused imports across affected files
- Removed f-strings without placeholders in train_model.py

**Dashboard resilience:**
- results_loader.py now falls back to the committed docs/assets/ snapshot
  when reports/*.csv or reports/figures/*.png don't exist locally, so a
  fresh clone shows real published results without retraining first
  (verified by simulating a clean clone with no local reports/ output)

**Docs:**
- Fixed stale "Flask" mention in the tech-stack line (README already
  documented FastAPI correctly everywhere else, and already embedded all
  6 result charts)

All 60 tests pass, ruff check is clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 28, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Samarthuday
Samarthuday merged commit 2f6f3ae into main Aug 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants