harbor run -t openthoughts/tasktrove-exp-rpt-stack-pytest-large-stack-pytest-4173harbor download openthoughts/tasktrove-exp-rpt-stack-pytest-large-stack-pytest-4173Task: Implement the backlight metrics module and wire it into a small package under /app/backlight.
Goal Create a Python package at /app/backlight (as a proper package, not a single file) that provides a module for position-based metrics used by the tests. Specifically implement the following module and functions with exact signatures, behaviors, and return shapes described below so that the tests in the prompt can import and use them successfully.
What to build
A Python package directory:
The tests will import and use the following function(s) from backlight.metrics.position_metrics:
Functional requirements, exact signatures and expected behaviors
Assumptions about input:
Return value:
Example mapping (conceptual; exact values depend on the test data):
Purpose: compute the Sharpe ratio for the period’s P/L using the per-period P/L series produced by calc_pl.
Approach (as a design, to be deterministic with the test data):
Notes:
Purpose: compute the drawdown series from the P/L over time.
Approach:
Alignment with tests:
Implementation details and integration
Acceptance criteria
Notes
Reminder