[rig-sampler] feat(validation): improve missing-field error descriptions for constrained string schemas#198
Merged
pelikhan merged 1 commit intoJul 26, 2026
Conversation
…ained string schemas describeSchemaType now returns human-readable hints for s.nonEmptyString, s.url, s.date, and s.path when used as required object fields. Previously all string variants reported 'expected string'; now they report 'non-empty string', 'URL string', 'date string (YYYY-MM-DD)', or 'path string' so repair prompts give the model clearer guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pelikhan
approved these changes
Jul 26, 2026
pelikhan
marked this pull request as ready for review
July 26, 2026 20:52
Contributor
Author
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
Contributor
Author
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /grill-with-docs — approving. The change is focused, well-motivated, and fully covered by tests.
📋 Key Themes & Highlights
Positive Highlights
- ✅ Four unit tests — one per constrained type — match the four new code branches exactly
- ✅
formatchecks take precedence overminLength, matching the specificity hierarchy of the schema helpers - ✅ Non-breaking:
describeSchemaTypeis private;ValidationResultpublic surface unchanged - ✅ PR body includes a clear before/after table grounded in real sampler runs
Minor Observations
- The
minLength > 0guard is redundant given thats.nonEmptyStringalways setsminLength: 1, but it makes the intent explicit and causes no harm. - No existing test covers a schema with both
formatandminLengthset simultaneously (not a real helper today). Low risk given the private scope.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 27.4 AIC · ⌖ 5.98 AIC · ⊞ 6.3K
Comment /matt to run again
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.
Samples run
Five consecutive samples were run through the stub Copilot SDK runner (
npm run sample):57-complex-integration-sonnet.tss.enum("low","medium","high")forriskLevel,s.optional(s.string)for audience, multi-agent delegation, and tools. All fields conformed on first turn.58-async-tool-node-builtins.tss.stringforpidands.enum("running","idle","unknown")for status. Exposed thats.stringin missing-field errors gives no hint about expected format.59-bash-each.tss.urlin the input arrayendpoints; a missingurlfield would only report "expected string" — unhelpful when the model should know it needs a URI.01-single-agent-haiku.ts02-review-git-diff.tss.optional(s.number)for line; plain strings elsewhere.What the runs revealed
s.url,s.nonEmptyString,s.path,s.date)."missing required field (expected string)"— the same message fors.string,s.nonEmptyString,s.url,s.path, ands.date.The improvement
describeSchemaType(used only in missing-field error messages) now returns a specific label for constrained string schemas:s.nonEmptyString"string""non-empty string"s.url"string""URL string"s.date"string""date string (YYYY-MM-DD)"s.path"string""path string"s.string"string""string"(unchanged)This is a non-breaking, internal-only change:
describeSchemaTypeis a private helper, and the publicValidationResulttype is unchanged. Four new unit tests cover the new messages.