Build with Jev / Lesson 10 of 24

Compose independent judgments in code

Combine several typed answers with deterministic facts, weights, and safe routing rules.

After this moduleYou can design fan-out evaluation without treating question order as a reasoning chain.

Share state while keeping questions independent

Once you can ask one typed question, the next step is composing several answers. One request can carry shared state and several named questions. independent evaluation: each question judges the supplied state without consuming another question's answer means question order is not a program. If routing depends on refund intent, application code must express that dependency after both answers return.

Trace this example from input to result
01

Customer choice

A customer reports an outage and also asks about a credit.

02

Request or event

The application sends shared ticket and account state with Choice, Noul, and Score questions.

03

Backend behavior

Jev evaluates each question independently; code combines answers with entitlement and incident records.

04

Customer sees

The customer gets the case routed to an appropriate specialist or person.

05

Diagnostic reasoning

Inspect state and each answer first, then inspect the code-owned combination rule and final queue mapping.

Customer seesApplication doesJev returns
One ticket reaches one queueCombines independent judgments and trusted factsNamed typed answers over shared state
const answers = result.answers;
const route = !account.isAuthenticated
  ? "identity-review"
  : answers.serviceImpact.noul >= 0.8
    ? "incident"
    : answers.refundIntent.noul >= 0.85 && account.refundEligible
      ? "billing-review"
      : answers.queue.choice;

The example keeps the dependency visible: trusted account state takes precedence, while Jev supplies bounded semantic signals. Its thresholds are synthetic. If a decisive fact never entered state, the problem is state construction, not composition; preserve state and retrieval versions so the two boundaries remain distinguishable.

Combine evidence in application code

composite score: an application-calculated value that combines several measurements under explicit weights can prioritize work, but weights must live in versioned code. A team might compute 0.6 * impact + 0.4 * frustration; Jev should not perform hidden arithmetic inside a long question. The code can be unit tested and replayed without another inference call.

Keep raw answers next to the derived value. If a priority is disputed, engineers need the source distributions, model and question versions, weights, and threshold. A composite can conceal one weak input, so set invariants such as "never lower priority for a confirmed active outage" before weighted policy runs.

Ask independent questions that are likely to be useful against the same state in one request. This avoids repeated state tokens and round trips, though extra questions still consume tokens.

Use a second request when the first answer determines which evidence or answer options exist, as in hierarchical classification or staged retrieval.

Use the answer for direction and confidence/probability for policy. High-certainty, low-risk cases may be automated; uncertain cases may ask for clarification, broaden to a coarser label, invoke a stronger model, or enter human review. Boundaries depend on error costs, not on a universal 0.5, 0.8, or 0.9.

Ask separate Score questions for independent dimensions, normalize scales, and combine them with visible code-owned weights. Reweighting does not require new inference while evidence and question meanings remain unchanged.

Speculative fan-out starts independent work before the final route is known. It reduces latency when retrieval and evaluation can overlap, but it spends capacity on results the policy may not use. Cancel unused work where possible and measure the waste. Never retry to make two judgments agree.

Route to the right kind of worker

Route work by capability: Jev handles constrained semantic judgment; code handles exact dates, counts, authorization, balances, and invariants; a generative model drafts language; specialist models handle other modalities; people handle high-risk or exceptional cases.

Use returned uncertainty to choose among those workers. A complete Choice can select a support domain, several Nouls can test independent conditions, and a Score can order one quality. One Choice answers relative selection among listed labels; separate Nouls answer whether each condition independently applies. They are not interchangeable.

Consider a message that reports an outage and asks for a credit. A single Choice among incident, billing, and other must select one relative winner, even though two concerns are present. Separate serviceImpact and refundIntent Nouls can both be high. Code can then give the active outage precedence for routing while preserving the billing signal for a follow-up task. The answer-space design determines what composition is possible.

Generated language belongs after the route, in a separate step with its own review rules. Keeping the calls separate shows whether a bad outcome came from judgment, routing, or generation.

Applied diagnosis

A correct label reaches the wrong team

Jev choice=billing · application route=technical

Replay the response and inspect the label-to-queue map. Because the returned Choice is correct but the visible route differs, the smallest supported boundary is downstream policy or configuration. Correct the mapping, replay affected records, and avoid changing the question to repair application code.

Keep authorization and side effects deterministic

Probabilistic evidence may trigger a review, never bypass authorization. For a refund, code verifies identity, charge existence, refundable state, amount limits, duplication, and idempotency. deterministic invariant: a rule that must hold exactly before an action is allowed remains true even if the model reports 1.0.

Design side effects as separate commands after policy selection. Use idempotency keys, audit records, and least privilege. Passing a ticket through Jev does not grant the model authority to email, refund, suspend, or disclose data.

For example, billing-review may create a work item containing the ticket ID and model evidence. A later refund command loads the charge from the payments system, checks that the authenticated account owns it, verifies that no refund already exists, enforces the amount limit, and records an idempotency key. None of those facts should be accepted from the customer's message. If any check fails, the command stops even when refund intent is 1.0.

Log the composition as a small decision record: safe state hash, question and model versions, raw answers and distributions, policy version, deterministic facts used, selected route, and side-effect command ID. That record separates a retrieval omission from a model error, a threshold problem, a queue-map defect, and an action failure. It also allows policy replay without paying for another model call when the original evidence and answers remain valid.

Saved locally

Compose a safe route

Your answers stay in this browser. Write enough that another engineer could continue the investigation.

Dig deeperSeparate answer confidence from workflow confidence

Workflow confidence includes retrieval completeness, state freshness, question quality, model behavior, policy validity, and downstream correctness. A concentrated answer distribution covers only one part. Track each boundary separately so a strong model answer cannot mask missing account data or a broken queue map.

Knowledge check

Check your understanding

Describe how independent judgments become one safe application decision without turning question order into a dependency chain.
Module quiz

0/4 answered

01What does asking several questions in one Jev request mean?
02Where should composite weights live?
03Which task must remain deterministic?
04What is speculative fan-out?
Sources and verification notes 4
Composition patternspublic-contract

Fan-out, confidence-gated routing, composite scoring and intent routing.

Building with System Onepublic-contract

State, independent judgments and code-owned composition, thresholds and actions.

Primitives overviewpublic-contract

Independent named questions and typed answers. Its approximate 32k wording differs from the model page's more specific 64k aggregate and 32k longest-question limits.

HTTP APIpublic-contract

POST /v1/systemone and authenticated GET /v1/models, request/response fields and errors. Prose and schema differ on omitted instructions, null state and one-level Score; course uses conservative valid requests.

Further learning

Optional references

These resources provide public documentation and examples for readers who want them.

TypeSafe docsPatternsTypeSafe docsHow to build with System One