Error during parsing
Summary
Functions
Emitted when a WEEK N: block contains content that is not a valid
DAY block (e.g. the LLM wrote Monday: walk/run as an inline summary
instead of DAY Monday training 45m "..."). Without this error the
parser silently discarded the malformed week body, the compiler
produced a week with empty days, and only the downstream
:phase_duration_mismatch validator caught the gap.
Types
@type error_type() ::
:unexpected_token
| :unexpected_eof
| :missing_required
| :invalid_value
| :invalid_keyword
| :duplicate_section
| :invalid_structure
| :unknown_exercise_ref
| :week_has_no_valid_days
@type repair_hint() :: %{ optional(:action) => atom(), optional(:target_path) => String.t(), optional(:parent_name) => String.t() | nil, optional(:missing) => [String.t() | non_neg_integer()] | nil, optional(:expected_count) => non_neg_integer() | nil, optional(:actual_count) => non_neg_integer() | nil, optional(:allowed_values) => [String.t()] | nil, optional(:expected_shape) => String.t() | nil, optional(:context_dsl_example) => String.t() | nil }
@type t() :: %WplAi.Errors.ParseError{ expected: [String.t()] | nil, got: String.t() | nil, location: WplAi.Errors.Location.t() | nil, message: String.t(), repair_hint: repair_hint() | nil, suggestions: [String.t()] | nil, type: error_type() }
Functions
Emitted when a WEEK N: block contains content that is not a valid
DAY block (e.g. the LLM wrote Monday: walk/run as an inline summary
instead of DAY Monday training 45m "..."). Without this error the
parser silently discarded the malformed week body, the compiler
produced a week with empty days, and only the downstream
:phase_duration_mismatch validator caught the gap.
Mirrors the TypeScript factory weekHasNoValidDays in
@gymbile/wpl-ai 1.11.0.