# Regimen library

The public library lives at `/regimens`, with the current plan at `/regimens/consistency`. The download at `/regimens.json` contains the catalog, application rules, and all fourteen days for each home/gym and beginner/intermediate combination.

## Source and adaptation

The user supplied `Optimal_Ant_14_Day_Consistency_Challenge.pdf` in October 2026. Its five pages are preserved without editing at `public/plans/optimal-ant-14-day-consistency.pdf`. The in-app plan adapts its Strength A, Strength B, and Strength C sessions. The original PDF has its original branding and describes alternative streak policies; neither is silently rewritten in the source document.

The implementation is a deterministic template in `lib/regimens.ts`, not a generated coaching conversation. It uses the member's equipment, experience level, round day, and scheduled-session ordinal. There is one supported regimen identifier, `consistency`. Unknown identifiers are rejected by creator settings; rendering defaults to this regimen for legacy records.

Home versions use bodyweight options and optional resistance bands/dumbbells. An unloaded prone W raise is provided as a light back movement when a row is unavailable; it is explicitly not represented as equivalent to a loaded row. A march can replace the optional movement finisher, not the loaded-carry stimulus. No doorway rows or improvised suspended equipment are prescribed. Gym templates use dumbbells and an exercise bench.

Beginner variants use two sets and easier pushing/core options. Intermediate variants use three sets. Week two offers an optional small progression only when the first week felt comfortable; the software does not automatically raise loads, reps, or volume. The supplied guide's nutrition formulas, claims of scientific validation, and broad health claims are not reproduced as personalized recommendations.

## Session sequence

The base guide uses Strength A/B/C on round days 1/3/5 and 8/10/12. All other days show recovery and movement guidance; day 14 adds an optional reflection prompt. The public calendar previews that base schedule.

A member chooses their own training weekdays. The backend supplies a zero-based `training.sessionIndex`, the count of scheduled training dates earlier in the current round. The planner selects A/B/C using this ordinal modulo three. A missed scheduled session does not silently rewrite the calendar. The round day controls week-two guidance; the streak does not choose the workout. On a member's recovery day, the planner returns no planned strength session even if that round day is a strength day in the original base calendar.

## Application rules

The user approved the supplied guide's flexible model. The application implements these explicit rules:

- Protein reaches the member's chosen target.
- Movement is at least 8,000 steps **or** 30 minutes of moderate cardio each day.
- Sleep is at least seven hours, self-reported.
- Strength follows chosen training weekdays as a weekly goal. It never blocks a daily check-in.
- Planned recovery days count when the other three actions are complete.
- The daily boundary is midnight America/New_York. The first two missed past days per 14-day round are protected by grace. Today never consumes grace before midnight.
- A completed check-in reaching seven consistency days earns one free next round; reaching fourteen earns Locked. Protected days bridge the count. Trailing grace preserves the last earned card but cannot advance it or award a reward alone.
- A third missed day resets the streak. Used grace is not replenished after a reset; the next round has its own two-day allowance.
- Existing rounds receive grace only from October 12, 2026 onward. Older completions and already-earned rewards remain unchanged.

The public plan explains this difference next to the challenge rules. Reading the plan is never a prerequisite to saving a check-in. Neither the source PDF nor a template can override server-side completion rules.

## Public specification

Regenerate `public/regimens.json` after changing the template. Its schema version is `1`; `generatedBy` identifies the deterministic source file. It contains public workout content only, with no member data or private context. The check-in and card can include the session label. Private reflection text is not part of this specification, a public card, or checkout.

Tests in `tests/regimens.test.mjs` cover the fourteen-day sequence, custom schedules, all four template variations, optional progression, recovery behavior, and safe fallbacks.
