ruby_llm-contract 0.2.2 → 0.2.3
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 +9 -0
- data/Gemfile.lock +2 -2
- data/lib/ruby_llm/contract/eval/case_result.rb +1 -0
- data/lib/ruby_llm/contract/eval/evaluator/json_includes.rb +2 -0
- data/lib/ruby_llm/contract/prompt/renderer.rb +2 -0
- data/lib/ruby_llm/contract/step/base.rb +0 -3
- data/lib/ruby_llm/contract/version.rb +1 -1
- 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: '080fd81afd87ad234cf66f7577080a4ac55a59f890e0c8c479479fccec57ad32'
|
|
4
|
+
data.tar.gz: cdabbac3ea1d81e1abd3cb850e927f410d98282bd23111be79463804ea4d84b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 294b36f7264a2ba8b04334f3fd1c6b4433466a04c6be4aaccf23a92df3c7e92d04061ace018aa5243e28a9ef4fe64abc7f6de5ec11143c32bf5466bf591b9130
|
|
7
|
+
data.tar.gz: d7447319e3389264571209bc84d7dc84a441ffb76d1f64506d9cac2dc1953d26ba8cf3e1eb4169adf64576f1be7ae182bdf0c6e8e6b876220b102cea1e653fa6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.3 (2026-03-23)
|
|
4
|
+
|
|
5
|
+
Production hardening from senior Rails review panel.
|
|
6
|
+
|
|
7
|
+
- **`around_call` propagates exceptions** — no longer silently swallows DB errors, timeouts, etc. User who wants swallowing can rescue in their block.
|
|
8
|
+
- **Nil section content skipped** — `section "X", nil` no longer renders `"null"` to the LLM. Section is omitted entirely.
|
|
9
|
+
- **Range support in `expected:`** — `expected: { score: 1..5 }` works in `add_case`. Previously only Regexp was supported.
|
|
10
|
+
- **`Trace#dig`** — `trace.dig(:usage, :input_tokens)` works on both Step and Pipeline traces.
|
|
11
|
+
|
|
3
12
|
## 0.2.2 (2026-03-23)
|
|
4
13
|
|
|
5
14
|
Fixes from first real-world integration (persona_tool).
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ruby_llm-contract (0.2.
|
|
4
|
+
ruby_llm-contract (0.2.3)
|
|
5
5
|
dry-types (~> 1.7)
|
|
6
6
|
ruby_llm (~> 1.0)
|
|
7
7
|
ruby_llm-schema (~> 0.3)
|
|
@@ -165,7 +165,7 @@ CHECKSUMS
|
|
|
165
165
|
rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
|
|
166
166
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
167
167
|
ruby_llm (1.14.0) sha256=57c6f7034fc4a44504ea137d70f853b07824f1c1cdbe774ab3ab3522e7098deb
|
|
168
|
-
ruby_llm-contract (0.2.
|
|
168
|
+
ruby_llm-contract (0.2.3)
|
|
169
169
|
ruby_llm-schema (0.3.0) sha256=a591edc5ca1b7f0304f0e2261de61ba4b3bea17be09f5cf7558153adfda3dec6
|
|
170
170
|
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
|
|
171
171
|
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
|
|
@@ -27,6 +27,8 @@ module RubyLLM
|
|
|
27
27
|
"missing key: #{key}"
|
|
28
28
|
elsif expected_value.is_a?(::Regexp)
|
|
29
29
|
mismatch_message(key, expected_value, actual) unless actual.to_s.match?(expected_value)
|
|
30
|
+
elsif expected_value.is_a?(::Range)
|
|
31
|
+
mismatch_message(key, expected_value, actual) unless expected_value.include?(actual)
|
|
30
32
|
elsif actual != expected_value
|
|
31
33
|
mismatch_message(key, expected_value, actual)
|
|
32
34
|
end
|
|
@@ -38,6 +38,8 @@ module RubyLLM
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def render_section_node(node, variables, messages)
|
|
41
|
+
return if node.content.nil?
|
|
42
|
+
|
|
41
43
|
section_content = node.content.is_a?(Hash) || node.content.is_a?(Array) ? node.content.to_json : node.content
|
|
42
44
|
return unless content_present?(section_content)
|
|
43
45
|
|