Under the hood · 08
Smart suggestions and routines
How Logex picks the next exercise (gaps, projected coverage, familiarity and your usual order) and how it checks, completes and scores a routine: capture, stimulus analysis, gap priority and today's set counts.
Two different questions share the same machinery. In a workout: what should I add next? In the routine editor: is this routine missing anything? Both measure a plan against the fractional sets from Weekly volume (1 for a muscle an exercise trains directly, 0.5 for a synergist, 0 for a stabilizer) and both are built to be explainable: every card says why.
In plain terms. Find the muscles that are under-trained in this session. For each, find the exercise that would improve coverage the most, then prefer the exercises you already know and tend to do at this point in a workout.
Part 1: the next exercise
Step 1: find the gaps
During a workout every muscle you chose is scored by fractional sets so far: under 3 is “none”, 3 to under 6 is “low”, 6 or more is “good” (ADEQUATE_WEIGHTED = 6). Muscles that are none or low are the gaps. Regional gaps come first, then the session’s major muscles, each ordered neediest first (none before low, then fewer sets). Up to 3 suggestion cards are built from a pool of up to 24 gaps.
Step 2: project the benefit
For each catalogue exercise that is not archived, not already in the session, trains at least one tracked muscle (wrist, neck and tibialis work never fills a gap) and is allowed by your equipment (anything you have already logged is always allowed), Logex projects what a typical 3 sets would do to the gap:
stimulusW = 3 × credit for the gap's muscle credit = 1 direct · 0.5 indirect · 0 stabilizer
improvement = coverageScore(after) − coverageScore(before)
coverageScore(w) = 1 − e^(−w ÷ τ) τ = 4 for major muscles, 5 for region rings
Worked example
A major muscle has 2.0 sets (score 0.393). Exercise A trains it directly: 3 × 1 = 3 more sets, to 5.0 (score 0.713), improvement 0.32. Exercise B trains it only as a synergist: 3 × 0.5 = 1.5, to 3.5 (score 0.583), improvement 0.19. A ranks first, and B stays in the pool as a weaker alternative.
Incidental work never qualifies: a stabilizer earns 0, so a fly is never an alternative for a lagging triceps head. On top of that, a candidate must reach at least 30% of the strongest candidate’s stimulus (MIN_RELATIVE_STIMULUS = 0.3).
Step 3: rank by mode
You choose how adventurous suggestions are.
| Mode | What it does |
|---|---|
| Familiar first (default) | Your regulars and favourites, unless a new exercise fills the gap substantially better |
| Balanced discovery | Two familiar choices, then something new |
| My exercises only | Only exercises you have logged or favourited |
In the default mode, familiar candidates whose improvement is within 80% of the best are kept as “competitive” and ordered by your habits. Everything else follows by improvement. Habits are, in order:
- Sequence signals. Logex scans your last 200 workouts and keeps those of the same kind as today (same muscle groups, else the same split name such as push, pull or legs, else the same title). If an exercise followed your previous exercise in at least 2 of them, it is “Your usual next”. If it was done at this position in at least 2, it is “Fits your routine”. Fewer than 2 counts as no signal.
- Personal score
0.5 × (workouts ÷ most-logged candidate's workouts) + 0.5 × (1 if favourite). - Strength: improvement, then the composite score below, then the id for a stable order.
The composite score, used to break ties and shown on cards, is:
raw = 0.36 × direct + 0.21 × coverage + 0.11 × synergy + 0.15 × familiarity
+ 0.09 × order fit + 0.06 × implement variety + warm bonus + 0.12 × dominant-region bonus
score = raw ÷ (1 + 0.4 × exercises already in the session that train this muscle as a primary)
- direct: 1.0 when the exercise trains the muscle directly (
0.25 + 0.75 × 1), and0.08 + 0.2 × (0.5 ÷ 0.55)= 0.26 when it is a synergist. - coverage: how much of the remaining need (up to 6 sets) the exercise would cover, or 0.35 if the gap is already filled.
- synergy: 0.34 for each other open gap the exercise also trains, up to 1.
- familiarity:
min(1, workouts logged ÷ 20). - order fit: 1 for a compound in the first four exercises or an isolation later, otherwise 0.35.
- warm bonus:
0.18 ×the previous exercise’s credit for that muscle (1 direct, 0.5 indirect; stabilizers never warm it), except when it would repeat the same primary muscle.
Suggestion cards are typed (zero coverage, low coverage, accessory opportunity for a region whose parent is trained, implement variety when you have used one implement all session, double-down, and antagonist imbalance when push and pull sets differ by more than 4). Each card carries up to 3 alternatives and the coverage before and after.
Part 2: routines
A routine stores a range per exercise, such as “3 to 4 × 6 to 8”, and Logex reasons about whether the routine does what it claims.
Prescriptions
{ goal, sets: [min, max], reps: [min, max], rpe, source }. Bounds: sets 1 to 8, reps 1 to 30, RPE 5 to 10 in half steps or none. Defaults when nothing is learned:
| Goal | Compound | Isolation |
|---|---|---|
| Strength | 3 to 4 × 4 to 6 | 3 to 4 × 6 to 10 |
| Volume | 3 to 4 × 8 to 12 | 2 to 3 × 10 to 15 |
The routine builder, which also knows the routine’s intent, starts from these instead: strength compound 3 to 5 × 3 to 6, strength isolation 2 to 3 × 8 to 12, hypertrophy compound 3 to 4 × 6 to 10, hypertrophy isolation 3 to 4 × 10 to 15, endurance 2 to 3 × 12 to 20 (compound) or 15 to 25 (isolation).
Learned prescriptions use your newest 8 sessions with work sets: sets are the 25th to 75th percentile of work sets per session and reps are the 20th to 80th percentile of all work-set reps, using nearest rank so every bound is something you actually did. If every session used the same count, the range opens one set above it. A median rep count of 6 or less is a strength goal, otherwise volume. Fewer than 2 sessions uses the default.
Capture: repeat workouts become routines
Looking at the last 12 weeks, similar sessions are clustered. Similarity is the overlap (Jaccard) of the lifts, plus 0.15 for the same non-generic title, plus 0.1 × the overlap of tags. Clusters merge while their average similarity is at least 0.45. A lift is “core” when it appears in more than half the cluster’s sessions. A candidate needs at least 3 supporting sessions and at least 3 core lifts. A candidate is hidden when an existing routine, or a candidate you dismissed, overlaps it at 0.6 or more in both directions.
Lifts are grouped by identity, not just by id: ids with the same normalised name are one lift, so a custom “Bench Press (Barbell)” counts as the same lift as the catalogue’s barbell bench press. Dumbbell bench stays separate.
Is the routine complete?
Each routine has an intent: a goal, a volume level and sessions per week (1, 2 or 3; default hypertrophy, standard, 2 per week). The weekly target per muscle follows the volume level:
| Volume | Weekly target |
|---|---|
| Light | MEV |
| Standard | low edge of the MAV band |
| High | middle of the MAV band |
Muscles with MEV 0 only have their own target at high volume. The weekly target is scaled by your profile’s volume scale, then divided by sessions per week and capped at 10 sets per muscle per session. Chest, for example, is 6, 12 or 16 a week, so a standard push day at 2 sessions needs 6 chest sets. A muscle goal, a focus muscle or a lagging muscle can raise the bar.
The routine’s projected sets per muscle use the middle of each set range (3 to 4 counts 3.5) times the same credit as before (1 direct, 0.5 indirect). Then:
fill = min(1, projected ÷ session target) covered ≥ 0.9 · thin ≥ 0.35 · missing below
priority = 100 × (1 − fill) × weight
weight = 1 tag · 1.75 goal or focus muscle · 1.5 + 0.1 per week lagging beyond two (max 2.0) weakness
A lift goal whose lift trains a muscle in scope but is not in the routine is a fixed-priority 150 gap. A muscle past its session ceiling (MRV ÷ sessions, at most 12) is flagged as too much.
Complete: one pass
“Complete” (and “Build it for me”) reanalyses after every step: swap repeated movements, close gaps highest priority first (add a set to the line that trains the muscle hardest when one set covers it, up to 5 sets, otherwise add the best-ranked exercise), add variety where an area needing 5 or more sets has a single movement, and order the lines (big compounds first, then other compounds, then isolation; goal and weak-point muscles first inside a tier).
Candidates are ranked by hit × (1 + bonus), where hit is the exercise’s credit for the gap muscle (1 direct, 0.5 indirect). Bonuses: +0.3 a new movement pattern for the area, −0.15 the same pattern on other equipment, −0.5 the same movement, +0.3 a compound when the area has none (+0.45 for strength), +0.1 an isolation once the area has its compound, +0.2 fills an empty movement slot, +0.25 per other open gap it trains (up to 2), +0.05 new equipment, up to +0.25 for exercises you have logged, −0.3 a near-duplicate stimulus. Multiplying means a weak hit cannot win on bonuses alone.
Routine quality score
scoreRoutine gives 0 to 100: coverage 45%, variety 20%, goal fit 20%, order 15%, graded Excellent at 90, Strong at 75, Solid at 60 and Needs work at 40. It lists up to three findings, each with its fix.
Today’s sets
planRoutineSession picks each line’s sets inside its range, starting from the lower middle of the range (3 to 4 gives 3). Per muscle, with this week’s logged sets plus today’s at base counts: above MRV removes a set from the lines that train it most until back under; below the weekly minimum adds a set the same way. Only lines that train the muscle directly are nudged. Each line moves at most one set and never outside its range, and a failed weekly read changes nothing.
Example: glutes have 1 set this week against a goal of 8, and the hip thrust at 3 base sets brings the week to 4. It plans 4 sets, shown as “Behind on glutes this week: +1 set”. Quads at 16 against an MRV of 20 would reach 24 after today’s base sets (hack squat and leg press at 4 each), so each drops to 3.
The workout then logs each line with exactly the count the start screen showed, inside its prescribed range, instead of re-planning it. Once a line’s prescribed working sets are logged (warm-ups do not count), it says “All N working sets done” and stops suggesting sets, apart from at most one bonus set when the Live Set Coach still has an open target (see Live Set Coach).
Limits and edge cases
- Everything is an estimate. Muscle roles come from cited studies or stated biomechanics, but three roles are a coarse summary, so treat suggestions as a prompt rather than a prescription.
- New exercises still appear in Familiar first if they fill the gap substantially better, and My exercises only never shows them.
- Equipment filtering hides exercises you cannot do, but anything you have logged stays available.
- Known gap: today’s routine planner can start from the last count you did, but the start screen does not pass that count yet, and it does not credit the week’s later sessions. It is tracked as a follow-up in the app’s docs.