feat(wellness): training-readiness signal tool (target 0.3.0) #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
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
Add a
get_training_readinessMCP tool that synthesizes an athlete's recentwellness signals into a single readiness read, deferred from the 0.2.0
nutrition/wellness work.
Scope
soreness/fatigue/stress) via the existing
/athlete/{id}/wellnesspath.(e.g. 7-day lnRMSSD mean +/- smallest worthwhile change), not fixed thresholds.
Grounding (document formulas in docstrings)
Notes
update_wellnesswrite tool and thecomputed Form (TSB) already surfaced in wellness output.
the data-plane write tool + formatting fixes.
Target release: 0.3.0
Implementation plan (0.3.0) — intended delivery model: Claude Opus 4.8
Branch:
feat/coaching-context; one conventionalfeat:commit; lands LAST (after #2, whose sport-settings context enriches the output).Design: computation separated from I/O
utils/readiness.py— pure functions, stdlibstatisticsonly, no HTTP. Fully unit-testable on fixtures.get_training_readiness(days: int = 45)intools/wellness.py— fetchesGET /athlete/{id}/wellnessfor the window via the existing path, hands the records to the compute layer, renders.Computation (formulas cited in docstrings — no invented thresholds)
hrvfield); 7-day rolling mean vs the preceding ~30-day baseline mean; normal band = baseline +/- SWC where SWC = 0.5 x SD of baseline lnRMSSD. Below band -> stress flag; above-with-rising-RHR noted as possible parasympathetic saturation (flag, don't diagnose).Honesty constraints (project convention)
Tests (
tests/test_readiness.py)make_intervals_requestpatched.Estimate
~400 LOC incl. tests. Closes the loop with #2 (zones/thresholds context) and 0.2.0's
update_wellness(the data this reads).