AI Decision Models: Structured Probability Gates for Automated Checks

AI Decision Models: Structured Probability Gates for Automated Checks

Most checks in a software project belong in deterministic code: syntax validation, schema checks, clean working-tree assertions, or hard performance budgets. A smaller class of checks cannot be written as plain conditionals—judging whether a changelog matches a diff, ranking visual QA descriptions, or scoring whether a draft blog post reads like generic LLM filler. For those cases, we tested Jev (Jev 1.13 Free and Jev 1.14), Gemini Decision 1, and GPT-6 Luna Decision across 32 logged pre-deploy runs, a visual QA comparison experiment, and live evaluations of our own blog posts and hero images.

Note: Jev (TypeSafe AI), Gemini Decision 1 (Google, announcement), and GPT-6 Luna Decision (OpenAI) are structured decision models rather than chat LLMs. We call all three through the same OpenCode inference gateway (opencode.ai/inference/systemone/v1/systemone) billed from our OpenCode Console credit balance. Instead of generating prose, they take a state payload and a JSON map of typed questions and return calibrated probabilities in a single fast pass (~0.4–1.8 s).


1. How Decision Models Work (and Our CLI Wrapper)

Decision models are not chat assistants or code generators. Each request sends two fields:

  1. State: a plain-text summary (or multimodal payload) of the facts, diff, report, or document to evaluate.
  2. Questions: a JSON map of typed questions evaluated in parallel against that state.

The API supports three question types:

TypeOutputTypical use
noulProbability P(yes) in [0, 1]Binary gate (release readiness, claims backed by data, needs real-phone test)
choiceWinning option, per-option probabilities, and confidenceTriage (missing checklist item, change risk category, weakest section)
scoreWeighted score on an ordered numeric rubric with level probabilitiesTrend tracking (issue severity, visual quality, AI slop level)

We wrap the endpoint in a 292-line standard-library Python script (jev.py) with six flags (--state, --questions, --model, --min-confidence, --json, --timeout). The --min-confidence flag turns any binary noul probability into a shell exit code:

  • 0.80 and above: pass (exit 0)
  • 0.50 to 0.79: human review (exit 2 when --min-confidence 0.8 is set)
  • Below 0.50: fail / escalate (exit 2)
python3 jev.py \
  --model jev-1.14 \
  --state @article.md \
  --questions @questions.json \
  --min-confidence 0.8 \
  --json

Two practical rules proved important in daily use:

  • Run new gates log-only first (about 5 runs) to see where probabilities actually land before letting exit 2 block a workflow.
  • Include baselines in the state payload: raw metrics without context (for example, frame times without explaining headless rendering caps) produce noisy scores.

2. How We Used It First: Pre-Deploy Gate for a 3D WebGL Game

Our first integration was scripts/jev_done_gate.py (455 lines) in a browser-based 3D WebGL endless-runner game. It splits verification into two layers:

  1. Deterministic fact collector: runs git status, git log, and git diff, checks JS syntax with node --check across src/*.js, verifies cache-busting version strings, runs validate_chunks.mjs, inspects .qa-output/ report ages and results, checks rsync -an deploy drift, verifies progres.md and tech.md updates, and prunes .qa-output/ files older than 7 days.
  2. Probabilistic verdict (jev.py): formats those collected facts plus a 7-item release checklist into a plain-text state summary and asks three questions in one call: whether the build is ready to deploy (noul), which checklist item is missing (choice), and overall issue severity (score on a 0–3 scale).

The gate passes only when readiness probability reaches at least 0.80 and the missing item is none (exit 0 for pass, exit 2 for review or fail, exit 3 for API or configuration error).

Results Across 32 Logged Runs (2026-11-14 to 2026-11-20)

All 32 runs completed end-to-end on Jev 1.13 Free across five days (.qa-output/jev-gate-log.jsonl):

Outcome / flagged categoryCountNotes
Total runs32All completed via Jev 1.13 Free
Pass7e.g., readiness 0.87, missing item: none, severity 0.54
Needs review / fail25Readiness below 0.80 or a specific missing item flagged
Flagged: performance16Mostly headless SwiftShader vsync and frame-pacing jitter
Flagged: none97 passes plus 2 borderline fails (0.57 and 0.69 readiness despite no missing item)
Flagged: visual QA3Missing or stale visual inspection evidence
Flagged: commit2Uncommitted working tree before deploy (readiness 0.06, severity 2.59)
Flagged: motion QA1Stale or missing motion report
Flagged: progress log1Missing changelog update in progres.md

Four patterns stood out in the logs:

  • Real catch (uncommitted code): readiness 0.06, missing item commit, severity 2.59 — caught uncommitted changes right before deploy.
  • Clean pass: readiness 0.87, missing item none, severity 0.54 — recorded after fixing tree flickering and re-running visual QA.
  • Borderline “none” verdict: two runs returned no specific missing item yet scored 0.57 (severity 1.46) and 0.69 (severity 1.21) on readiness—holding back from the 0.80 threshold when multiple minor signals looked weak.
  • Headless rendering noise: 16 of 32 runs flagged performance under headless SwiftShader. We had to add an explicit baseline note to the state generator explaining that a 32.7–33.9 ms median frame time is a headless vsync cap rather than engine load.

Why We Did Not Port the Same Gate to Our Next WebGL Project

On our next 3D WebGL project (a multi-level downhill game), deterministic scripts already covered almost every item in that checklist: scripts/validate_levels.mjs (494 lines), qa/visual_qa.py (452 lines, enforcing at most 60 draw calls and 80,000 triangles), and qa/motion_qa.py (779 lines). Wrapping hard numeric checks in a probabilistic API call added network latency and an external dependency without adding signal.

CheckBetter toolWhy
JS syntax (node --check), version-string sync, clean git statusDeterministic codeExact binary truth; zero ambiguity, zero network dependency
Visual shot count, ≤ 60 draw calls, zero 404 or console errorsDeterministic codeHard numeric budgets should not depend on a probability threshold
Pruning .qa-output/ older than 7 days and rsync -an driftDeterministic codeDeterministic housekeeping
Scoring vision descriptions, diff risk, or prose qualityDecision modelNo static rule or regex can weigh nuance, intent, or trade-offs
Two-layer verification architecture comparing local deterministic checks against OpenCode decision models returning calibrated probability bands
Two-layer verification split: deterministic checks stay local (0 ms, hard exit codes), while unstructured state goes to decision models for calibrated probability bands.

3. Where Decision Models Fit: Three Practical Use Cases

Use Case A: Separating “Eyes” from “Judge” in Visual QA

Asking a vision model to inspect a screenshot and emit a binary pass/fail verdict often produces oscillation: either it nitpicks cosmetic details or waves through regressions, and a binary verdict gives no numeric trend across iterations.

A two-stage Eyes → Judge pipeline separates perception from scoring:

  1. Eyes (vision model): inspects the screenshots and outputs a strictly factual, neutral text description (under 450 words, no verdict, no winner).
  2. Judge (decision model): scores that plain-text description against structured choice, score, and binary questions in a single call.

We tested this on the downhill game’s level-select menu by comparing desktop and mobile Playwright screenshots of the current build against two AI design mockups (a map mockup and a portrait menu card). One five-question call (1,640 input tokens, 208 output tokens, ~1 s) ran on both Jev 1.13 Free and Jev 1.14:

Question (type)Jev 1.13 FreeJev 1.14What it captured
Best overall menu (choice)Map mockup 0.54, current build 0.40, menu card 0.06Map mockup 0.52, current build 0.44, menu card 0.04Flagged a genuine close call between the reference mockup and live build
Best visual atmosphere (choice)Map mockup 0.75, menu card 0.25, current build 0.00Map mockup 0.87, menu card 0.13, current build 0.00Separated visual polish from functional completeness
Current build quality (score 0–3)0.98 (usable with visible flaws)0.96 (usable with visible flaws)Tight consistency (0.98 vs. 0.96) suitable for iteration tracking
Current build beats mockups (yes/no)0.430.54Borderline ~0.50 result lands cleanly in the human-review band
Top gap in current build (choice)Mobile map readability 0.75, lock-state consistency 0.24Mobile map readability 0.81, lock-state consistency 0.18Prioritized unreadable mobile labels over background atmosphere

This same pattern fits an iterative coder loop (scripts/glm_iterate.py): pass the previous and current vision descriptions to the decision model to score visual quality (0–3), whether the build improved over the previous iteration (yes/no), and the dominant remaining defect (choice) to steer the next fix.

Note: One schema gotcha we hit during this experiment:

ProblemCauseFix
HTTP 422: Upstream request failed (Endpoint is unavailable)Question JSON used question instead of instructions, or legend instead of criteriaMatch the exact System One schema (instructions + criteria: array for score, object for noul and choice)

Use Case B: Semantic Release Risk Before Deploy

Deterministic checks confirm syntax and desktop Playwright passes, but cannot judge the semantic risk of a code diff. A three-line change in a WebGL scene file might be a harmless sky-color tweak—or it might enable shadow mapping or a CSS backdrop filter and tank mobile GPU frame rates while desktop Chromium still passes. Similarly, git status only checks whether progres.md was modified, not whether the entry matches the code diff.

Feeding git diff, the latest progres.md entry, and the current performance baseline into a decision model lets a single call evaluate three release gates:

  • Change risk category (choice): cosmetic, level tuning, gameplay logic, mobile WebGL risk, or deploy configuration.
  • Needs real-phone test (yes/no): whether desktop headless Chromium is insufficient and a physical device check is warranted before push.
  • Changelog matches diff (yes/no): whether the release note accurately describes the actual code changes.

Use Case C: Blog Post Quality and “AI Slop” Gate

For this blog, we wanted a fast sanity check on whether a draft reads like generic AI filler or concrete engineering notes, and whether claims are backed by measurements. We defined a three-question rubric:

  • AI slop level (score 0–3): 0 for authentic first-person engineering notes with specific measurements and honest limits; 3 for generic LLM filler with no original data.
  • Claims backed by data (yes/no): whether the post’s technical claims are supported by concrete numbers, logs, or code.
  • Weakest aspect (choice): hook, concrete evidence, structure, conclusion, or none.

We ran Jev 1.14 (--min-confidence 0.8) on our previous post (2026-11-16 bird-watch build), and then ran all three decision models—Jev 1.14, Gemini Decision 1, and GPT-6 Luna Decision—on this post itself:

Post evaluatedModelInput tokensLatencyAI slop level (0–3)Claims backed by dataWeakest aspectGate (≥ 0.80)
Bird-watch post (2026-11-16)Jev 1.145,8660.43 s0.09 (P(0) = 0.92)0.76None (0.67; next: conclusion 0.13)Review
This post (2026-11-24)Jev 1.145,0520.50 s0.13 (P(0) = 0.89)0.79Conclusion (0.52; next: evidence 0.29)Review
This post (2026-11-24)Gemini Decision 15,3300.55 s0.26 (P(0) = 0.78)0.90Conclusion (0.81; next: evidence 0.12)Pass
This post (2026-11-24)GPT-6 Luna Decision5,9080.44 s0.02 (P(0) = 0.98)0.79Conclusion (0.98; next: structure 0.01)Review

On the bird-watch post, Jev 1.14 cleared the slop check easily (0.09 out of 3, with 0.92 probability of level 0), placed data backing at 0.76 (just below the 0.80 auto-pass bar), and picked “none” (0.67) as the weakest aspect with “conclusion” (0.13) as runner-up. On Jev 1.13 Free, that same post scored 0.09–0.10 on slop and 0.80–0.83 on data backing, showing that Jev 1.14 is slightly stricter on evidence thresholds.

On this post itself, all three models agreed that the draft is not AI slop (0.02 to 0.26 out of 3) and independently flagged the conclusion as the weakest section (0.52 on Jev 1.14, 0.81 on Gemini Decision 1, and 0.98 on GPT-6 Luna Decision).


4. Comparing the Three Decision Models

Because OpenCode exposes all three models behind the same System One endpoint and credit balance, switching between them is a single --model flag:

PropertyJev 1.14Gemini Decision 1GPT-6 Luna Decision
DeveloperTypeSafe AIGoogleOpenAI
API model IDjev-1.14 (also jev-1.13-free)gemini-decision-1gpt-6-luna-decision
Initial releaseSeptember 15, 2026November 11, 2026Available on OpenCode gateway
Model typeSystem One decision model; no text generationDecision model; no text generation, calibrated probabilitiesDecision model; no text generation, calibrated probabilities
Question typesBinary (noul), multi-option (choice, up to 255 options), rubric (score)Binary (noul), multi-option (choice), rubric (score)Binary (noul), multi-option (choice), rubric (score)
Input modalitiesText, imagesText, images, audio, video, PDFText, images (PNG, JPEG, WebP, GIF)
Published latency70–500 ms end-to-end150–250 ms end-to-endMeasured 0.44 s (text) / 1.71 s (image)
Context window64,000 tokens262,144 tokens1,050,000 tokens (922,000 input)
Questions per callMultiple questions in parallel over one stateUp to 1,000 questions in a single requestMultiple questions in parallel over one state
Billing modelInput tokens only (output free)Input tokens only (output not billed)Input tokens only + prompt caching

5. Direct Image Checks and Pipeline Cost in Our Setup

All 32 pre-deploy runs on our first WebGL game ran at zero cost on Jev 1.13 Free. Our subsequent evaluations—the 5-question visual QA comparison (1,640 input tokens, ~1.0 s), full-post editorial reviews (5,052–5,908 input tokens, 0.43–0.55 s), and direct hero-image checks—all ran against a single OpenCode balance. Because all three models bill input tokens only (with zero output-token charge), each check costs a fraction of a cent (for example, $0.000069 for the 5-question visual QA call on Jev 1.14), making structured gates cheap enough to run on every commit, draft, or generated image without budgeting individual calls.

Direct Image Verification on This Post’s Hero Thumbnail

Our jev.py CLI wrapper sends state as plain text, which is why our game visual QA used the two-stage Eyes → Judge pipeline. Passing a JPEG directly as a multimodal image_url payload in the state array works across all three models. Here is how they scored this post’s 1376×768 hero thumbnail (thumbnail.jpg) across three questions:

ModelImage tokensLatencyAI slop level (0–3)Looks like AI slop (yes/no)Usable as hero (yes/no)
Jev 1.143,3680.75 s2.140.810.35
Gemini Decision 11,5171.82 s1.430.300.82
GPT-6 Luna Decision1,6471.71 s1.680.380.78

Gemini Decision 1 and GPT-6 Luna Decision tokenized the image in less than half as many tokens as Jev 1.14 and closely agreed on the verdict (flagging low AI-slop probability at 0.30 and 0.38, and passing hero usability at 0.82 and 0.78). Jev 1.14 ran fastest at 0.75 s but was noticeably stricter on synthetic product renders (0.81 slop probability, 0.35 usability).


6. Practical Rule of Thumb

After 32 deploy-gate runs and side-by-side tests across our game repos and this blog, our selection rule is straightforward:

  • Use deterministic code whenever the answer is exact: syntax checks, schemas, file presence, exit codes, or hard numeric budgets (draw-call limits, triangle caps, zero 404s).
  • Use Jev 1.14 (or Jev 1.13 Free) for fast text gates—code diffs, changelog checks, prose rubrics, and Eyes → Judge visual descriptions.
  • Use Gemini Decision 1 when you need direct multimodal inputs (such as hero-image QA with compact image tokenization) or up to 1,000 parallel questions in a single request.
  • Use GPT-6 Luna Decision when you need a very large context window (up to 1M tokens) or prompt caching across repeated checks on the same document or codebase prefix.
  • Keep new gates advisory first: run log-only for the first ~5 runs to calibrate the 0.80 and 0.50 thresholds against your own judgment, and never let an external scoring API hard-block a local build when the network is unavailable.