coach_zed 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/coach_zed/prompt_builder.rb +1 -0
- data/lib/coach_zed/schedule_parser.rb +10 -0
- data/lib/coach_zed/version.rb +1 -1
- data/sig/coach_zed.rbs +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed1678c76dbab07b672635ea8f4f2642bca6ea4c339913a1bb4c26d9d107e352
|
|
4
|
+
data.tar.gz: f7de5dd2c274db6434d3207fc2c8a2623098682839530f908026043a6cab178d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9611d02c22a0334fd49dce684d4545d777798dd6a76de72ff234cda80776b335ca166aacc565105b42b982a48e334ddd490fafc8162310d7c51e24b796c8c650
|
|
7
|
+
data.tar.gz: 807a3a945eeb72ee436093acd22add82ee104472227dd38f353c6f24f2f86015d9d85892a79e16054b0c9c0b72403c26a4a6f6f674eff5784de32a5630f55e9e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [](https://github.com/rossta/coach_zed/compare/v0.5.3...v) (2026-06-17)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* internalize schedule validation contract ([cf2a5c3](https://github.com/rossta/coach_zed/commit/cf2a5c3566873b4d4d8fe47f3826eb5810af5781))
|
|
1
6
|
## [](https://github.com/rossta/coach_zed/compare/v0.5.2...v) (2026-06-17)
|
|
2
7
|
|
|
3
8
|
### Bug Fixes
|
|
@@ -17,6 +17,7 @@ class CoachZed
|
|
|
17
17
|
def build
|
|
18
18
|
<<~PROMPT
|
|
19
19
|
You are a training coach. Build a daily training schedule for the athlete using only the provided catalog.
|
|
20
|
+
CoachZed manages the scheduling contract, so follow the rules below without requiring the end user to restate them.
|
|
20
21
|
|
|
21
22
|
Return strict JSON only. Do not wrap it in markdown fences or commentary.
|
|
22
23
|
Every string value must be valid JSON text on a single line. Do not emit literal newlines, tabs, or other control characters inside string values.
|
|
@@ -9,6 +9,7 @@ class CoachZed
|
|
|
9
9
|
def self.parse(raw_schedule)
|
|
10
10
|
json = extract_json(raw_schedule)
|
|
11
11
|
schedule = JSON.parse(json)
|
|
12
|
+
normalize!(schedule)
|
|
12
13
|
validate!(schedule)
|
|
13
14
|
schedule
|
|
14
15
|
rescue JSON::ParserError => e
|
|
@@ -23,6 +24,15 @@ class CoachZed
|
|
|
23
24
|
fenced ? fenced[1].to_s.strip : text
|
|
24
25
|
end
|
|
25
26
|
|
|
27
|
+
def self.normalize!(schedule)
|
|
28
|
+
return unless schedule.is_a?(Hash)
|
|
29
|
+
|
|
30
|
+
days = schedule["days"]
|
|
31
|
+
return unless days.is_a?(Array) && !days.empty?
|
|
32
|
+
|
|
33
|
+
schedule["program_length_days"] = days.length
|
|
34
|
+
end
|
|
35
|
+
|
|
26
36
|
def self.validate!(schedule)
|
|
27
37
|
raise Error, "schedule must be a JSON object" unless schedule.is_a?(Hash)
|
|
28
38
|
|
data/lib/coach_zed/version.rb
CHANGED
data/sig/coach_zed.rbs
CHANGED
|
@@ -240,6 +240,7 @@ class CoachZed
|
|
|
240
240
|
|
|
241
241
|
def self.parse: (String) -> Hash[String, untyped]
|
|
242
242
|
def self.extract_json: (String raw_schedule) -> String
|
|
243
|
+
def self.normalize!: (Hash[String, untyped] schedule) -> void
|
|
243
244
|
def self.validate!: (Hash[String, untyped] schedule) -> void
|
|
244
245
|
def self.validate_day!: (Hash[String, untyped] day, Integer expected_day_number) -> void
|
|
245
246
|
end
|