Split strength-then-metcon workouts into separate segments - #1814
Open
Yanchek99 wants to merge 1 commit into
Open
Split strength-then-metcon workouts into separate segments#1814Yanchek99 wants to merge 1 commit into
Yanchek99 wants to merge 1 commit into
Conversation
CF-260422 (workout 405) is a strength piece ("Overhead squat 8-8-8-8
reps") followed by "Then," + a distinct 6-minute AMRAP. The LLM parser
merged both into a single AMRAP segment, sweeping the four 8-rep strength
sets in alongside the metcon movements.
The system prompt only endorsed segment-splitting for explicitly labeled
parts ("Part A/Part B"), so the "Then," strength-to-conditioning boundary
got collapsed. Teach the prompt that a strength/lifting scheme immediately
followed by a distinct conditioning piece is two parts -- one segment each,
each carrying its own scheme -- with the workout score_type following the
scored conditioning piece rather than "weight". Reconcile the existing
lifting-set rule for the multi-part case.
Add a regression test locking the two-segment shape the builder must
produce from the corrected output, and exclude the prose-only prompt
module from Metrics/ModuleLength (its length tracks guidance, not code
complexity), matching the repo's existing length-exclusion pattern.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
🚅 Deployed to the wod-tracker-pr-1814 environment in wod-tracker
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Workout 405 (
CF-260422) was scraped incorrectly — reported by the site owner as "wrong scheme/structure."The real crossfit.com WOD for 2026-04-22 is two parts:
Production collapsed it into a single 6-minute AMRAP named "Overhead squat" containing the four literal 8-rep strength sets plus the 40 OHS + 30 deficit push-ups — the strength work got counted as part of the metcon.
Root cause
Workout structure comes entirely from the LLM's JSON (
config.workout_parser = :llm). The system prompt only endorsed segment-splitting for explicitly labeled parts ("Part A/Part B", "Buy-in"), so theThen,strength→conditioning boundary — a very common CrossFit format — got merged. The one deterministic lifting-set correction only fires when the whole workout isweight-scored, so it didn't catch this either. The data model already supports the correct two-segment shape (e.g. "City 100", "Dallas 5").Change
system_prompt.rb— new rule: a strength/lifting scheme immediately followed by a distinct conditioning piece is two segments (boundary = change of scheme, oftenThen,/blank line), each carrying its ownrounds/time_seconds/interval_scheme; the workoutscore_typefollows the scored conditioning piece, notweight. Plus a reconciling clause on the existing lifting-set rule for the multi-part case.llm_parser_test.rb— regression test locking the two-segment shape the builder must produce from the corrected output..rubocop.yml— excluded the prose-only prompt module fromMetrics/ModuleLength(length tracks extraction guidance, not code complexity), matching the repo's existing length-exclusion pattern.Verification
llm_parser_test— 10 runs, 0 failuresNote: the parser test stubs the LLM (as the whole suite does), so it documents/guards the target shape but can't prove the prompt now elicits the split. That needs a live check:
Once confirmed, re-scrape prod to fix the data:
🤖 Generated with Claude Code