Skip to content

Add weighted readiness scoring engine and team readiness API#11

Draft
Copilot wants to merge 11 commits into
mainfrom
copilot/create-core-scoring-engine
Draft

Add weighted readiness scoring engine and team readiness API#11
Copilot wants to merge 11 commits into
mainfrom
copilot/create-core-scoring-engine

Conversation

Copilot AI commented May 18, 2026

Copy link
Copy Markdown

This PR introduces the core readiness scoring flow requested in the issue: compute athlete readiness from recent audit logs (0–100) and expose team-level readiness as the average of member scores.

  • Core scoring engine

    • Added backend/readiness_engine.py to compute athlete readiness from the latest 3 daily logs.
    • Implemented weighted categories per requirement:
      • Physical (rpe, fatigue) → 40%
      • Mental (stress, sleep) → 40%
      • Logistics + Environment (logistics, environment) → 20%
    • Added team aggregation utilities to average per-athlete readiness into a team score.
  • Team readiness API

    • Added endpoint: GET /api/v1/teams/{team_id}/readiness
    • Endpoint returns:
      • team metadata (team_id, team_name, member_count)
      • readiness_score (team average)
      • per-athlete readiness breakdown
    • Returns 404 when the team is not found.
  • Readiness data source

    • Added backend/data/readiness_audit_logs.json containing team membership and audit logs used by the scoring engine.
  • Focused backend coverage

    • Added backend/tests/test_readiness_engine.py with tests for:
      • latest-3-days selection behavior
      • weighted averaging across varying daily logs
      • team-score aggregation from member scores
# readiness_engine.py
score = (
    (physical * 0.4) +
    (mental * 0.4) +
    (contextual * 0.2)
)

@app.get("/api/v1/teams/{team_id}/readiness")
async def team_readiness(team_id: str):
    readiness = get_team_readiness(team_id)
    if not readiness:
        raise HTTPException(status_code=404, detail=f"Team {team_id} not found")
    return readiness

Copilot AI and others added 10 commits May 18, 2026 18:28
Agent-Logs-Url: https://github.com/Hackaton-NeuroAgents/olympicmind/sessions/85ba7362-6cde-408f-b6d8-2eca09d6ebb5

Co-authored-by: unoursmarin <20300991+unoursmarin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Hackaton-NeuroAgents/olympicmind/sessions/85ba7362-6cde-408f-b6d8-2eca09d6ebb5

Co-authored-by: unoursmarin <20300991+unoursmarin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Hackaton-NeuroAgents/olympicmind/sessions/85ba7362-6cde-408f-b6d8-2eca09d6ebb5

Co-authored-by: unoursmarin <20300991+unoursmarin@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement core scoring engine for Olympic readiness Add weighted readiness scoring engine and team readiness API May 18, 2026
Copilot AI requested a review from unoursmarin May 18, 2026 18:38
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.

Create Core Scoring Engine for Olympic Readiness

2 participants