Session 54: Progression #229

Closed
opened 2026-11-08 18:22:41 +00:00 by chris-kreidl · 0 comments
chris-kreidl commented 2026-11-08 18:22:41 +00:00 (Migrated from github.com)

54 · Progression, and unplanned rides as bonus

Phase: Adaptive coaching 5/5 (owner request 2026-11-08) · Branch: session/54-progression · Depends on: 53

The owner's 12-week plan had one VO2max session, a build block 91% easy with hard minutes shrinking each week, and weekly loads that didn't progress. Re-plans also stripped planned tempo and sweet spot after polo, group rides and a long lunch ride. Nothing in the rules checks progression, and the re-plan treats a logged ride's numbers as the whole story. This session adds progression rules on planned load, a floor on hard minutes, and makes unplanned riding a bonus: it counts for fitness and fatigue but never moves the prescription by itself, and whether it replaces a planned quality session is the ride chat's call.

Read first

  • docs/requirements.md → "Coaching dialogue and adaptability" (FR-23) and the foundations table
  • docs/decisions.md: the 2026-11-08 adaptive coaching entry (the owner's 200/350/500/150 example; no fixed block-to-block margin)
  • src/domain/rules/ (periodisation.ts, intensity-distribution.ts, key-workout-protection.ts for hardZone/hardMinSec, shared.ts, config.ts, clamp.ts, index.ts), src/domain/plan/workout.ts (workoutTimeInZones), src/domain/plan/plan.ts (datedWeeks)
  • src/ai/prompts/generate.ts, src/ai/prompts/replan.ts, session 50's ride-chat and End chat inputs
  • evals/ (the "unplanned long ride" re-plan scenario)

Goal

  1. Within a block (progression, new rule). For each non-taper mesocycle, over planned ride TSS (the sessions as the plan prescribes them, never ridden): each loading week (all but the recovery week) carries at least the week before's load, so the last loading week is the block's peak. A week a clamp trimmed, the athlete edited or that is past doesn't break it (the same treatment as session 53's recovery floor; reuse it). Error, with no mechanical fix (the coach repairs).
  2. Block to block. Each mesocycle's peak week is above the previous mesocycle's peak, until the taper. No fixed margin: the generate prompt says how to size it (plan length, goal, current CTL, recent history) and that the ramp caps it.
  3. Hard minutes. A week's hard minutes are planned ride time at zone 4 and above by step target (keyWorkout.hardZone). Each build or specialty block's mean weekly hard minutes over loading weeks is at least the preceding base block's. Each build or specialty loading week has at least minQualityRides 2 rides with at least keyWorkout.hardMinSec in zone 4+, when the week has at least minDays 4 training days and minHours 4 (config; resolved per week from session 52). Errors, repaired by the coach.
  4. Unplanned rides are bonus. No rule judges a logged ride hard. The re-plan prompt: a ride beyond the plan feeds fitness and fatigue, and form and ramp may cut what follows; it never raises next week's prescription and never by itself removes planned quality. Whether an unplanned ride counts as a quality session is decided in its chat: when the athlete says it was hard, the End chat re-plan may drop at most that week's next quality session; when they say it was easy, or there was no chat, planned sessions stay unless a limit trips. The ride-chat prompt (session 50) asks how hard an unplanned ride felt when the data can't tell.
  5. Prompts. Generate: when hours are capped, progression comes from intensity (more quality time in build, threshold and VO2max as the block calls for); recovery weeks keep a short touch (session 53). Bump prompt versions and re-record fixtures.

Rules

  • src/domain/ stays pure; every bound in RULES_CONFIG with tests at, under and over it, and overridable per user (validator and settings).
  • Re-plans use newViolations, so an active plan that already breaks progression isn't rejected for it; the next generate fixes it.
  • Plans stay append-only.

Tests

  • Within block: 200/350/500/150 passes; 200/350/300/150 fails; a trimmed week 3 passes; the owner's ridden week 3 (559 against about 150 planned) changes nothing, since ridden load isn't measured.
  • Block to block: a build peak at or under the base peak fails; above passes; a taper is unchecked.
  • Hard minutes: a build with fewer weekly hard minutes than its base fails; a build week with one quality ride at 5 h and 4 days fails, at 3 days passes.
  • Re-plan eval: the unplanned long ride scenario keeps the week's planned quality session; add a polo scenario (an unplanned 90 min ride with estimated TSS 110, no chat) that keeps planned quality, and one where the ride chat says it was hard, which may drop one.
  • bun run eval and bun run eval:replan stay 100% compliant; compare hard minutes per block before and after with evals/show-plan.ts for the owner's control athlete and record it in docs/history.md.

Out of scope

Taper load rules (the open follow-up), heart-rate or RPE hardness for logged rides. Note anything else under Follow-ups.

Done when

The new rules pass their tests, both evals stay 100% compliant, and the owner's control plan shows rising weekly load within blocks, a build peak above the base peak and more build hard minutes than base; unit, typecheck, lint, format, audit and e2e pass. Add an owner check under Follow-ups → Now: generate a new plan and read weeks 5–12 against the 2026-11-08 complaints. Update FR-23's "not yet built" and the foundations table (periodisation, intensity distribution). Finish with the end-of-session ritual in CLAUDE.md.

Moved from prompts/54-progression.md on 2026-11-08.

# 54 · Progression, and unplanned rides as bonus **Phase:** Adaptive coaching 5/5 (owner request 2026-11-08) · **Branch:** `session/54-progression` · **Depends on:** 53 The owner's 12-week plan had one VO2max session, a build block 91% easy with hard minutes shrinking each week, and weekly loads that didn't progress. Re-plans also stripped planned tempo and sweet spot after polo, group rides and a long lunch ride. Nothing in the rules checks progression, and the re-plan treats a logged ride's numbers as the whole story. This session adds progression rules on planned load, a floor on hard minutes, and makes unplanned riding a bonus: it counts for fitness and fatigue but never moves the prescription by itself, and whether it replaces a planned quality session is the ride chat's call. ## Read first - `docs/requirements.md` → "Coaching dialogue and adaptability" (FR-23) and the foundations table - `docs/decisions.md`: the 2026-11-08 adaptive coaching entry (the owner's 200/350/500/150 example; no fixed block-to-block margin) - `src/domain/rules/` (`periodisation.ts`, `intensity-distribution.ts`, `key-workout-protection.ts` for `hardZone`/`hardMinSec`, `shared.ts`, `config.ts`, `clamp.ts`, `index.ts`), `src/domain/plan/workout.ts` (`workoutTimeInZones`), `src/domain/plan/plan.ts` (`datedWeeks`) - `src/ai/prompts/generate.ts`, `src/ai/prompts/replan.ts`, session 50's ride-chat and End chat inputs - `evals/` (the "unplanned long ride" re-plan scenario) ## Goal 1. **Within a block (`progression`, new rule).** For each non-taper mesocycle, over **planned** ride TSS (the sessions as the plan prescribes them, never ridden): each loading week (all but the recovery week) carries at least the week before's load, so the last loading week is the block's peak. A week a clamp trimmed, the athlete edited or that is past doesn't break it (the same treatment as session 53's recovery floor; reuse it). Error, with no mechanical fix (the coach repairs). 2. **Block to block.** Each mesocycle's peak week is above the previous mesocycle's peak, until the taper. No fixed margin: the generate prompt says how to size it (plan length, goal, current CTL, recent history) and that the ramp caps it. 3. **Hard minutes.** A week's hard minutes are planned ride time at zone 4 and above by step target (`keyWorkout.hardZone`). Each build or specialty block's mean weekly hard minutes over loading weeks is at least the preceding base block's. Each build or specialty loading week has at least `minQualityRides` 2 rides with at least `keyWorkout.hardMinSec` in zone 4+, when the week has at least `minDays` 4 training days and `minHours` 4 (config; resolved per week from session 52). Errors, repaired by the coach. 4. **Unplanned rides are bonus.** No rule judges a logged ride hard. The re-plan prompt: a ride beyond the plan feeds fitness and fatigue, and form and ramp may cut what follows; it never raises next week's prescription and never by itself removes planned quality. Whether an unplanned ride counts as a quality session is decided in its chat: when the athlete says it was hard, the End chat re-plan may drop at most that week's next quality session; when they say it was easy, or there was no chat, planned sessions stay unless a limit trips. The ride-chat prompt (session 50) asks how hard an unplanned ride felt when the data can't tell. 5. **Prompts.** Generate: when hours are capped, progression comes from intensity (more quality time in build, threshold and VO2max as the block calls for); recovery weeks keep a short touch (session 53). Bump prompt versions and re-record fixtures. ## Rules - `src/domain/` stays pure; every bound in `RULES_CONFIG` with tests at, under and over it, and overridable per user (validator and settings). - Re-plans use `newViolations`, so an active plan that already breaks progression isn't rejected for it; the next generate fixes it. - Plans stay append-only. ## Tests - Within block: 200/350/500/150 passes; 200/350/300/150 fails; a trimmed week 3 passes; the owner's ridden week 3 (559 against about 150 planned) changes nothing, since ridden load isn't measured. - Block to block: a build peak at or under the base peak fails; above passes; a taper is unchecked. - Hard minutes: a build with fewer weekly hard minutes than its base fails; a build week with one quality ride at 5 h and 4 days fails, at 3 days passes. - Re-plan eval: the unplanned long ride scenario keeps the week's planned quality session; add a polo scenario (an unplanned 90 min ride with estimated TSS 110, no chat) that keeps planned quality, and one where the ride chat says it was hard, which may drop one. - `bun run eval` and `bun run eval:replan` stay 100% compliant; compare hard minutes per block before and after with `evals/show-plan.ts` for the owner's control athlete and record it in `docs/history.md`. ## Out of scope Taper load rules (the open follow-up), heart-rate or RPE hardness for logged rides. Note anything else under Follow-ups. ## Done when The new rules pass their tests, both evals stay 100% compliant, and the owner's control plan shows rising weekly load within blocks, a build peak above the base peak and more build hard minutes than base; unit, typecheck, lint, format, audit and e2e pass. Add an owner check under Follow-ups → Now: generate a new plan and read weeks 5–12 against the 2026-11-08 complaints. Update FR-23's "not yet built" and the foundations table (periodisation, intensity distribution). Finish with the end-of-session ritual in `CLAUDE.md`. _Moved from `prompts/54-progression.md` on 2026-11-08._
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/trainer#229
No description provided.