fix(deps): allow json 3 - #123
Merged
Merged
Conversation
The explicit json dependency added in simplepractice#115 was meant as a CVE floor, but ~> 2.19 also caps consumers below 3.0. The SDK only uses JSON.generate and JSON.parse, which are unchanged in json 3. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4 tasks
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.
TL;DRAllow consumers to use JSON 3 while preserving the JSON security minimum. Require Faraday 2.14.4 or newer so API response parsing works with JSON 3.
Why#115 declared
jsonexplicitly to set a floor that excludes CVE-2026-54696. The pessimistic~> 2.19operator also caps it below 3.0. Apps already on json 3 get downgraded to 2.x when they upgrade to langfuse-rb 0.12.x.Faraday 2.14.3 passes parser options as a positional hash, which JSON 3 rejects. Faraday 2.14.4 fixes that call. The SDK also uses
to_json; JSON 3 retains its stricter duplicate-key and parsing behavior.CI now runs the full suite with JSON 3 on Ruby 3.2, 3.3, and 3.4. Shared test dependencies let those jobs resolve independently of RuboCop's JSON 2 constraint.
TestingThe full suite passed locally on Ruby 3.2 with JSON 2.21.2 and JSON 3.0.2: 1,663 examples, zero failures, and 97.01% line coverage for each. RuboCop passed for all 112 files.
A live JSON 3 check fetched a prompt through the SDK and matched it against the Langfuse CLI. A synthetic trace and score were written successfully and independently verified through the CLI.
The regression was reproduced before the fix: JSON 3.0.2 with Faraday 2.14.3 failed 209 examples. Hosted checks must pass on the updated head before merging.
Checklist🤖 Generated with Claude Code
Note
Low Risk
Dependency constraint and CI-only changes; SDK JSON usage is limited to
JSON.parse/JSON.generate, with explicit json 3 test coverage added.Overview
Relaxes runtime dependency constraints so apps on
json3.x are no longer forced back to 2.x when depending onlangfuse-rb. The gemspec changesjsonfrom~> 2.19to>= 2.19.9, < 4(CVE floor kept) and bumps the minimum Faraday to>= 2.14.4for JSON 3–compatible response parsing.CI and dev setup add a dedicated
gemfiles/test.gemfile(optionalJSON_VERSIONpin) and atest-json3matrix job that runs the full RSpec suite withjson ~> 3.0on Ruby 3.2–3.4;ci-successnow gates on that job. The rootGemfiledelegates test deps viaeval_gemfile, andgemfiles/*.lockis gitignored.Reviewed by Cursor Bugbot for commit b1fc306. Bugbot is set up for automated code reviews on this repo. Configure here.