[rig-sampler] docs(s.unknown): add @example and fix header comment for description-form usage#29
Merged
Conversation
…form usage s.unknown was the only s.* helper missing an @example block in its JSDoc. All other helpers (s.array, s.object, s.record, s.enum, s.optional) already show examples. The header comment also described it as s.unknown() implying it must always be called, which differed from the "call as value or fn(desc)" pattern documented for the primitive helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pelikhan
marked this pull request as ready for review
July 23, 2026 10:38
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 /grill-with-docs — approving; changes are consistent with the project's existing vocabulary and documentation patterns.
📋 Key Themes & Highlights
Key Themes
- Vocabulary consistency: The fix aligns
s.unknownwith the "call as value or fn(desc)" pattern already documented for all other primitive helpers (s.string,s.number, etc.) - Documentation completeness:
s.unknownwas the onlys.*helper missing an@example— this closes that gap
Positive Highlights
- ✅
@exampleblock matches the style of every others.*helper - ✅ Header comment correction is precise and uses the domain's own wording
- ✅ No logic changes; all 128 tests pass unchanged
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 20 AIC · ⌖ 4.85 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.
Sample run:
src/samples/09-classify-issue.tsThis sample defines an
agentwith twos.enumoutput fields (labelandconfidence). It ran cleanly with 0 repair turns — the schema serialized correctly and the stub returned a conforming response on the first attempt.What the run revealed
While analyzing the
sexport against the run output,s.unknownstood out as the onlys.*helper without an@examplein its JSDoc block:@example?s.arrays.objects.records.enums.optionals.unknownThe header comment at the top of
rig.tsalso describeds.unknown()with parentheses, implying it must always be called as a function — inconsistent with the"call as value or fn(desc)"pattern documented for the primitive helpers (s.string,s.number, etc.).Change
@exampletos.unknownshowing both bare (s.unknown) and description-form (s.unknown("raw API payload")) usage, matching the documentation style of every others.*helper.s.unknown() unconstrained JSON→s.unknown unconstrained JSON; call as value or s.unknown("description").Verification
All 128 existing unit tests pass unchanged. No behavior is modified — this is a pure documentation improvement.