Skip to content

Rolling Out a Decision Model: Shadow Mode, Canary, and Rollback

Replacing a rule with a model in one step is how thresholds get tuned on the wrong data. The three stages, what each one learns, and the one-flag rollback that makes a canary safe.

Published
Category
Jev Practices & Patterns
Resources cited
5
Reading time
3 min
Tags#evaluation#rollout#confidence#shadow-mode

A decision model in a live system is usually a replacement for something: a rule, a heuristic, a smaller model. Replacing it in one step is how you discover that your thresholds were tuned on the wrong data. The safer path has three stages — shadow, canary, and rollback — and each one has a specific thing it is trying to learn.

Shadow mode: run it beside the incumbent, act on neither extra

In shadow mode, every request that reaches the incumbent also reaches Jev, and Jev's answer is logged but never acted on. The point is to collect real distributions — how confident Jev is on your traffic, where it disagrees with the incumbent — without any user-visible risk. The confidence docs frame this as the way to choose a threshold from data rather than guesswork.

The subtlety: because output is free and the state is already assembled, shadowing is cheap. You are paying only input tokens for the second opinion, which makes a long shadow period affordable where it would not be for a generative model.

Pick the threshold from the disagreement, not the accuracy

The interesting number in shadow mode is not "how often Jev is right" — you often do not have labels — but the shape of the disagreement. Where the incumbent says yes and Jev says no with high confidence, you have a case to inspect. The confidence-gates article walks the threshold-setting process; the reliability question is whether Jev's confident answers are the ones you would have endorsed.

A decision model is well suited to this because it returns a probability, so you can bucket the shadow log by confidence and see the policy at every candidate threshold before you pick one.

Canary: act on a slice, watch the metric

Once you trust the threshold, act on a fraction of traffic — one percent, one queue, one region — and watch the outcome metric that motivated the change. This is where an ordinary A/B framework works, with one twist: version-pin the model. The jaggedness notes are explicit that jev-latest moves under you, so a canary and its control must be pinned to a version, or the comparison drifts mid-test.

The Katalon testing guide makes the same recommendation for QA: pin the model version for regression tests, because an alias update can change results with no code change on your side.

Rollback has to be one flag

A canary you cannot reverse quickly is not a canary. The decision call should sit behind a single switch that reverts to the incumbent instantly, and the switch should be the same one shadow mode used. If reverting means a deploy, you will hesitate at the exact moment you should not.

The workflow evals entry is the companion: you cannot roll back what you cannot measure, so the metric that decides rollback has to exist before the canary starts.

What to log for all three stages

  • The full state hash, so a case can be replayed.
  • The questions, so a disagreement can be traced to a question.
  • The raw probabilities and the threshold applied.
  • The model version, pinned.
  • Which stage produced the decision — shadow, canary, or live.

The independent evaluations and the measuring Jev article agree on the core finding: question design dominates, so the shadow and canary logs are really a record of how well your questions were written, and reading them is how you improve the questions before you widen the rollout.

Shadow to learn the distribution, canary to learn the outcome, pin the version, and keep rollback to one flag. The three stages exist to make each irreversible step small.

From the Jev directory

The resources behind this article.

How TypeSafe reports certainty, how it differs from probability, and how to use it architecturally to gate and route decisions.
Jev Practices & PatternsDocs#official#confidence#routing
Official
A maintained list of jev-1.13's known failure modes, literal reading, unreliable counting, dates as text, indirection, context rot, and contradictory criteria, each with a guardrail.
Jev Practices & PatternsDocs#official#docs#evaluation
Official
Published evaluations of four automation workflows, security incidents, agent trace observability, invoice processing, and customer service, comparing Jev and frontier LLMs as structured workflows versus single prompts.
Jev Practices & PatternsDocs#official#benchmarks#evaluation
Official
Katalon's guide to Jev in software testing: where bounded judgments help QA, why deterministic assertions stay first, the documented weak spots that hit test checks, and the caveat that a constrained answer can still be wrong.
Jev Guides & ArticlesArticle#community#testing#qa
Community
An independent benchmark of hosted Jev against six LLMs on PubMedQA, Banking77, and HelpSteer2, scoring decisions against human labels and reporting per-board results for each model.
Jev Practices & PatternsArticle#community#benchmarks#evaluation
Community
Back to all articles

More Jev articles

Most Jev accuracy problems are state problems. What belongs in a state, what is a pre-made judgment to leave out, and why naming the slice you ask about matters more than the wording.
Jev Practices & Patterns#state#design#primitives
Read article
A Noul returns one number and no separate confidence. How to read the value, pin its boundary with criteria, split compound questions, and set a per-action threshold that matches the cost of being wrong.
Jev Practices & Patterns#noul#primitives#confidence
Read article

From the Jev community

Posts from builders shipping with Jev right now.

Follow @typesafeai