Conversation
The builders were inconsistent about the same job. choice and score
checked the type and size of their criteria; noul took whatever it was
given and shipped it. `Questions.noul("Urgent?", criteria: ["yes", "no"])`
built happily and came back a 422, and so did a criteria hash keyed
"yes"/"no" instead of true/false. noul criteria now have to be a Hash
keyed by true and false -- the booleans read best at a call site, and are
stringified for the wire, which is what JSON would have done anyway.
None of the three looked at descriptions. A score level or an option
rubric could be an Integer and go over the wire as one. They are an
EntryType now: text, a Hash, an Array, or nil for undescribed.
Choice labels had a quieter problem. They are stringified to become JSON
keys, so `{ billing: "...", "billing" => "..." }` collapsed into one
option carrying whichever description came last. The question that
reached the model was not the question that was written, and nothing said
so. Now it raises.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The builders were inconsistent about the same job.
choiceandscorechecked the type and size of their criteria;noultook whatever it was given and shipped it.None of the three looked at descriptions, so a score level or an option rubric could be an
Integerand go over the wire as one.Choice labels had a quieter problem. They're stringified to become JSON keys, so
{ billing: "...", "billing" => "..." }collapsed into one option carrying whichever description came last. The question that reached the model was not the question that was written, and nothing said so.The fix
criteriamust be a Hash keyed bytrue/false(the booleans read best at a call site and are stringified for the wire, which is what JSON would have done anyway). One-sided criteria are fine.EntryType: String, Hash, Array, ornilfor undescribed.The 255-option and 2..10-level caps already matched the docs and are unchanged.
Tests
14 new cases in
test/questions_test.rb.Draft: part of a security and API-coverage audit, opened for reference rather than as a request for immediate review. Independent of the other branches, each off
main. Suite green on Ruby 3.2.11, 3.3.8 and 3.4.8.🤖 Generated with Claude Code