s1_ruby
Ruby library that makes System One measurement and probability 'collapse' native primitives, with a TypeSafe Jev provider.
Overview
s1-ruby treats a System One judgment as a Ruby primitive. An S1 model answers a typed question about data with a calibrated probability; it does not generate and does not decide, and code decides by collapsing the distribution at a threshold. Wrapping data with ψ makes it a state questions can be asked about, and there are verbs for noul (judge), choice (choose, with ranked results) and score, plus a lens (given/against) to judge relative to a rubric. A companion s1-rails exists, and a THEORY.md defines the terms.
It pushes the idea into Ruby idioms: an optional core extension lets strings answer nouls, pattern matching and === work on judgments, distributions combine with &, | and ~ before collapsing late, and collections can use judgments as predicates in select, group_by, sort_by and sum, where a sum of nouls is an expected count. The default provider is TypeSafe (jev-latest) with a 0.5 default threshold and configurable retries, and a spec suite backs the provider. Ruby 3.2 or newer is required.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Who is the most skilled individual? | — |
| Score | How skilled is this person? | novice · competent · expert · exceptional |
| Yes / no | Is this a man's name? | — |
How it works
- Wrap data as a state with ψ
- Ask noul, choice or score questions, optionally with a lens
- Combine distributions before collapsing
- Collapse at a threshold or use judgments in collection methods
Strengths
- Keeps probabilities until code needs a boolean
- Judgments compose with Ruby collections and pattern matching
Caveats
- Unconventional API and terminology
- Per-item calls in collection methods can add up
Getting started
Add the gem, set TYPESAFE_API_KEY, and configure c.provider = :typesafe; see the README's install section.At a glance
- Type
- Library
- Status
- prototype
- Language
- Ruby
- Runtime
- Ruby gem (3.2+)
- Has code
- yes
- Has tests
- yes
Use cases and integrations
How curated lists describe it
Ruby ecosystem: makes System One measurement, and the collapse that follows it, a Ruby primitive, with a TypeSafe provider behind its own spec suite.
yibie/awesome-jev
Frequently asked questions
What does 'collapse' mean here?
Turning a probability distribution into a definite value at a threshold, done by code rather than the model.
Which model answers?
TypeSafe's Jev by default.
Is there a Rails version?
Yes, s1-rails.
Related projects
Hack Club's lightweight LLM proxy, listed for adding a Jev forwarding endpoint behind its auth, limits and usage logging.
MCP serverproductionTypeScriptAx, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.
PluginproductionTypeScriptEffect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.
ProjectproductionTypeScriptPHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.
ProjectproductionPHPGo MCP server giving any client typed Jev decisions via OpenRouter or TypeSafe, with validated answers and no paid retries.
MCP serverproductionGoSimon Willison's LLM plugin that adds Jev as a model for yes/no, choice and score questions from the command line.
PluginproductionPython