Quaedra Research

Verdict

A programming language where decisions are the branches. Declare a decision, match on its answers, and the checker makes sure every answer and “not sure” is handled before anything runs.

v0.1.0First release, MIT
3Decision types, the same as Jet's
4Tiers in an escalation chain

How it works

You write ordinary logic: functions, loops, lists and strings. Wherever the program needs judgment, you declare a decision with its question and labeled answers, then match on it. Every match needs an arm for each label and an uncertain arm, so a model that isn't sure takes a path you wrote rather than a guess.

decision moderate: choice "Is this comment ok to publish?" {
  ok: "harmless comment"
  spam: "ads, links, scams"
  toxic: "insults, harassment"
  examples from "comments.csv"
  tiers builtin -> jet
  threshold 0.85
}

fn action(comment: text) -> text {
  match moderate(comment) {
    ok => "publish"
    spam => "quarantine"
    toxic @ 0.9 => "hide"       // only when p(toxic) ≥ 0.9
    uncertain => "review"       // required: leaving it out is a compile error
  }
}

At runtime each decision climbs its chain of tiers until one is confident. The first is a small model trained from the decision's own examples; above it sit Nodd and Jet. Several decisions on the same input go to Jet in one request, so it reads the input once.

TierRunsWhat it is
builtinAnywhere, no dependencies, under 1 msHashed n-gram logistic regression with temperature calibration, trained from the decision's examples
noddNode or the browserA Nodd classifier exported for the decision, with its calibrated threshold
jetHTTP /v1/decideJet, a typed decision model: choices, scores and yes/no probabilities
fnAnywhereAny function: rules, an LLM call or a human queue

A tier that fails, like Jet being down, is recorded and skipped. If every tier is unsure, the answer goes to the uncertain arm. Design

What the checker catches

MistakeResult
No uncertain armCompile error
A label without an armCompile error
An arm for a label that doesn't existCompile error
An example labeled with a label that doesn't existCompile error
Arms returning different typesCompile error

The same checks hold in TypeScript. The runtime is also a library, and its match type rejects the same mistakes at compile time.

import { at, choice, decide, jet, match } from "@quaedra/verdict";
import { builtinFromDisk } from "@quaedra/verdict/node";

const o = await decide(Moderate, comment);
match(o, {
  ok: () => publish(),
  spam: () => quarantine(),
  toxic: at(0.9, () => hide()),
  uncertain: () => review(),   // required: forgetting it won't compile
});

Run it

Needs Node 22 or later. Programs that use Jet read its address from JET_URL.

npm install @quaedra/verdict

npx verdict check program.vd    # every error, with line, column and a caret
npx verdict run program.vd      # check, then run
npx verdict build program.vd    # train the builtin tier → .verdict/

Read the docs for decision types, tiers and the CLI, or the language reference.