Skip to content

Orphaned risk_engine.py appears unused in production and duplicates active risk logic #5

Description

@Manvikamboz

Potential orphaned risk engine implementation

While reviewing the risk-analysis code paths, I noticed that backend/risk_engine.py appears to be disconnected from the current production implementation.

Findings

1. No production references

I searched the repository for references to risk_engine and found only a single import in:

  • backend/tests/test_risk_engine.py

I found no references in:

  • backend/app.py
  • backend/conjunction_service.py
  • backend/analytics_service.py
  • backend/tle_parser.py
  • GitHub Actions workflows
  • Docker / Render deployment configuration
  • README or CHANGELOG documentation

2. Duplicated helper implementations

Several utility functions appear to duplicate implementations already present in backend/app.py, including:

  • safe_float
  • get_first

This means similar logic currently exists in multiple locations.

3. Separate production risk pipelines

The logic in risk_engine.py appears independent from the active production paths:

  • Individual object risk scoring is performed through calculate_risk_score(...) in app.py.
  • Conjunction screening is performed through conjunction_service.py.

As a result, modifying risk_engine.py does not appear to affect production behavior.

Potential Impact

The presence of a standalone risk engine that is only referenced by tests may create confusion for future contributors, who may reasonably expect changes to this module to affect live risk calculations.

Question

Is risk_engine.py intentionally retained for future work, or has it become orphaned after the risk and conjunction logic was migrated elsewhere?

If it is no longer part of the active architecture, it may be worth consolidating or removing to reduce maintenance overhead and contributor confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions