Skip to content

[rig-sampler] docs(s.unknown): add @example and fix header comment for description-form usage#29

Merged
pelikhan merged 1 commit into
mainfrom
rig-sampler/09-classify-issue-9c2dbdd1fbcf5396
Jul 23, 2026
Merged

[rig-sampler] docs(s.unknown): add @example and fix header comment for description-form usage#29
pelikhan merged 1 commit into
mainfrom
rig-sampler/09-classify-issue-9c2dbdd1fbcf5396

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Sample run: src/samples/09-classify-issue.ts

This sample defines an agent with two s.enum output fields (label and confidence). 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 s export against the run output, s.unknown stood out as the only s.* helper without an @example in its JSDoc block:

Helper Has @example?
s.array
s.object
s.record
s.enum
s.optional
s.unknown ❌ (before this PR)

The header comment at the top of rig.ts also described s.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

  • Added @example to s.unknown showing both bare (s.unknown) and description-form (s.unknown("raw API payload")) usage, matching the documentation style of every other s.* helper.
  • Fixed the header comment entry from s.unknown() unconstrained JSONs.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.

Generated by Daily Rig Sampler · 61.6 AIC · ⌖ 7.97 AIC · ⊞ 5.2K ·

…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
pelikhan marked this pull request as ready for review July 23, 2026 10:38
@pelikhan
pelikhan merged commit cb5815e into main Jul 23, 2026
1 check passed
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.unknown with the "call as value or fn(desc)" pattern already documented for all other primitive helpers (s.string, s.number, etc.)
  • Documentation completeness: s.unknown was the only s.* helper missing an @example — this closes that gap

Positive Highlights

  • @example block matches the style of every other s.* 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant