01 / ARCHITECTURE

Separate generation, judgment, and execution

General-purpose models excel at planning, explanation, generation, and multi-step reasoning. An Agent also contains narrower questions: which tool to call, whether a search result matters, how severe a risk is, or whether a person should intervene. Their shared property is not simplicity; it is that the output space can be defined in advance.

Jev's engineering value is not merely returning JSON. Structured output can do that too. Jev constrains the task itself to Choice, Score, or Noul, so the application receives a probabilistic decision rather than prose that needs another parsing step.

01DELIBERATIONPlan, explain, generateGPT · Claude · Gemini
02FAST DECISIONSRoute, filter, score, gateJev · Jev-like
03DETERMINISTICPermissions, effects, rollbackApplication code
04FALLBACKHigh risk and uncertaintyHuman · stronger model
02 / TASK FIT

Which tasks belong in a fast decision layer

A task fits Jev when its options can be enumerated, calls are frequent, mistakes are recoverable, and semantic understanding is needed without a long explanation. The more conditions it satisfies, the stronger the case for separating it from generation.

GOOD FIT
  • Tool routing and action selection
  • Relevance, quality, and risk scoring
  • Retention, permission, and review gates
KEEP IN GENERATION
  • Writing, explanation, open creation
  • Cross-file, multi-step planning
  • Exploration with unknown outputs
Jev belongs less in the Agent’s brain than in its reflexes.
03 / CASE STUDY

Case study: context compaction without summaries

Coding Agent context is often dominated not by user messages but by file contents, search results, command logs, and directory trees. Summaries save tokens, but may rewrite paths, error codes, stack locations, and command arguments into approximate prose.

fast-jev-compaction takes another route: preserve user and assistant text verbatim, and make retention decisions only for paired tool calls and results. Important evidence remains intact, secondary results are truncated, and irrelevant calls are removed.

fast-jev-compaction architecture from trigger and state construction through Jev decisions and safe fallback
Architecture: do not generate a summary; decide whether tool history should remain. Open the full-size image for detail.
04 / PIPELINE

From message history to three actions

  1. 01
    collectToolCalls

    Pair calls with results by tool_use_id; pin the first and recent messages.

  2. 02
    fitState

    Build only the state needed for judgment instead of resending every result.

  3. 03
    batchCalls

    Split questions into batches and query Jev concurrently.

  4. 04
    decideCall

    Combine two probabilities into keep, drop_result, or drop_call.

Split one compound question into two Noul judgments

questions = {
  call_t3: {
    type: 'noul',
    instructions: 'Is knowing this tool call still useful?'
  },
  result_t3: {
    type: 'noul',
    instructions: 'Must the full result remain available?'
  }
}
keepResult ≥ thresholdKEEP

Keep call and result verbatim.

keepCall ≥ thresholdDROP RESULT

Keep the call, replace the result.

both belowDROP CALL

Remove the pair together.

05 / STATE BUDGET

State budgets and progressive degradation

When state exceeds its budget, do not delete messages arbitrarily. Shorten inputs first, then collapse old text, and only then omit old messages or merge old calls. Every degradation stage should be observable.

01full

Tool inputs up to 1,000 characters

02inputs ≤ 200 / 60

Progressively shorten tool arguments

03texts abridged

Keep the head and tail of long text

04old messages collapsed

Collapse old messages into omission markers

05old calls merged

Merge consecutive old calls only as a last resort

06 / OPERATIONS

Thresholds, fallbacks, and rollout

Thresholds such as 0.5 or 0.8 illustrate control flow; they are not production defaults. Confidence is not a safety proof. Calibrate thresholds against your labeled data, error costs, and action reversibility.

L1READ ONLY

Search, classify, rerank; automate after validation.

L2REVERSIBLE

Truncate context or create temporary records; retain conservatively.

L3IRREVERSIBLE

Deletion, charges, access removal; never delegate to Jev alone.

  • Start in shadow mode without changing real behavior.
  • Measure observed accuracy by probability band.
  • Fall back on request failure, malformed output, or insufficient savings.
  • Log model version, question version, threshold, action, and overrides.
07 / TRADE-OFFS

Jev vs structured output vs classifiers

LLM + JSON Schema

Best for infrequent complex judgments that require explanations; pays the full generation cost.

Tool calling

Fits main-loop actions, while selection still depends on generation.

Traditional classifier

Fits stable labels and abundant training data; cheap and local.

Jev

Fits frequent, closed, semantically rich, and recoverable local decisions.

Type safety means the model stays inside the agreed output shape; it does not mean the selected answer is always correct.

08 / TAKEAWAY

A reusable Agent engineering pattern

fast-jev-compaction matters beyond compaction. It demonstrates a stable decision protocol: structure objects first, split judgments into atomic questions, combine probabilities in code, keep side effects under deterministic policy, and preserve a complete fallback.

GENERATION EXPRESSESJUDGMENT ROUTESCODE EXECUTES

The same pattern applies to tool routing, moderation, search reranking, permission requests, and quality gates. The reusable asset is not an example threshold; it is the boundary where models remain replaceable and the decision protocol stays stable.