These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 10/5/2026.

Odds

@korulang/odds@0.0.1

System One judgments as Koru tors — typed questions over a closed answer space, calibrated probabilities as branch payloads, decode policy as a phantom state

odds/index.kz · 16 tors· 1 internal

@koru/odds — System One judgments as Koru tors. · 28 more lines
@koru/odds — System One judgments as Koru tors. A System One model (TypeSafe's Jev is the first) answers typed questions over a CLOSED answer space and returns calibrated probabilities — which is already the shape of a Koru tor: the branch set IS the answer space, the payload IS the winner's probability, `when` clauses ARE confidence gates, and the decode policy IS a phantom state on the judge. THE REFLECTION: a judgment tor's f64-payload branches ARE the question's criteria, enumerated at comptime from @This().Output. The answer space is declared exactly once — in the event signature — and the API question is built by reflecting on it. Pattern-named branches spell "[tag: description]": the tag is the criteria key, the rest the description Jev reads. Non-f64 branches (`exhausted`, `err`) are control flow, never criteria. Backend: OpenRouter's Decisions API (POST https://openrouter.ai/api/alpha/decisions, model `typesafe/jev-1.13-20260917` — pinned, dated: `-latest` floats and a gate must know which judge it is under), reached with std.http — no package dependencies. `gen` is deliberately a DIFFERENT category: System One models cannot generate text, so revision goes to a chat-completions model. The polish loop composes the two categories in one flow. `gen` may migrate to @koru/ai when that package grows an OpenRouter endpoint.

Phantom lifecycles

Derived from the phantom labels in the declarations below — state! issues an obligation the compiler will chase, !state discharges it, a bare state holds it without moving it. Nothing here is hand-drawn.

Judge 2 states greedy!chaotic!

judge

<greedy!> index.kz:306

chaos

<!greedy><chaotic!> index.kz:318

settle

<!chaotic><greedy!> index.kz:324

retire

<!greedy> index.kz:333

feels.map

index.kz:352

feels.pick

<greedy> index.kz:367

feels.draw

<chaotic> index.kz:379

triage.map

index.kz:391

triage.pick

<greedy> index.kz:406

triage.draw

<chaotic> index.kz:419

feels

<greedy> index.kz:433

cfeels

<chaotic> index.kz:449

triage

<greedy> index.kz:469

ctriage

<chaotic> index.kz:489

gen

<greedy> index.kz:509

polish

<greedy> index.kz:556