Jev function side effects

Review a function for mutation and I/O

Supply the function and dependency contracts. Compare changes to caller or external state with local work, keeping a helper's unknown behavior visible.

Inspect what the supplied function can change.Live API
Try an example

Original synthetic input. Edit the task or evidence to make a new API request.

Source: Workflow inspiration on X

Source and example scope

The inputs, rubric and preview are original. This window demonstrates the stated decision only; it does not reproduce the source application or its measurements.

Inspect functionText and supplied dependencyNotes.

Decision rules and labels
Outside effectLocal-onlyNeed dependency
A real response from the Jev API

Edit any input to explore a different decision. No request is sent until you run it.

Your next decision

Not run yet

Choose an example or write your own input, then run it to see the ranked choices.

Results are not stored by this site. Your submitted text is processed by the API provider.

The decision

How does the Jev function side effects demo inspect code?

The Jev function side effects demo inspects a small supplied function for mutation or I/O outside its local computation. Changing a caller-owned array and sorting a newly created array are different behaviors, even when the returned values look similar.

The API-collected source connects Jev-assisted automation with state management and encapsulation. This independent JavaScript example makes one part of that concern visible. It does not review the source author's implementation, execute code or establish a general proof of function purity.

The provided snippets keep the distinction small enough to inspect: arithmetic, in-place sorting, copying before sorting, an enclosing counter, a network call and an undefined helper. Hidden code remains unknown rather than being inferred from a friendly function name.

Original Jev function side effects workflow diagram showing supplied evidence, a typed decision and the local preview.
Original workflow illustration. The output is a local preview, not an executed action or source screenshot.
How it works

Try the example in four steps

Use the sample to understand the rule, then test your own input for function side effects.

  1. Illustration of adding the text or evidence for a decision

    Add the information to check

    Supply the function and dependency contracts.

  2. Illustration of defining a question and its allowed choices

    Confirm the question and labels

    Open the decision rules and keep the intended distinction between Outside effect, Local-only, Need dependency. Edit the choices only when testing your own rule.

  3. Illustration of sending one input and comparing the returned choices

    Run the decision

    Use a sample first, then try your own input. Compare the selected label with the other returned probabilities.

  4. Illustration of reviewing a result and an uncertain item before using it

    Review the next step

    Review Need dependency before using a result. The label is a decision about the supplied information, not an executed action.

Our API test

What the six original inputs returned.

What the six original inputs returned.
Original test inputFixture expectationObserved labelLeading probability
Arithmetic using local valuesLocal-onlyLocal-only100%
Sorting the caller arrayOutside effectOutside effect100%
Sorting a new local arrayLocal-onlyLocal-only100%
Changing enclosing stateOutside effectOutside effect97%
Sending an HTTP requestOutside effectOutside effect100%
Helper implementation missingNeed dependencyNeed dependency100%
  • 6 of 6 original fixture expectations matched. Contrary outputs are preserved in the table and downloads; these checks are not held-out accuracy or production suitability.
  • Measured adapter round trips: 477-1246 ms. Estimated input cost: $0.00002302-$0.00002402 per request. These observations are not a latency guarantee or invoice.

6 actual Jev API calls on October 2, 2026. Original synthetic inputs check this rubric and handoff; they do not establish held-out accuracy. Probabilities are model outputs.Verified

Understand the results

Arithmetic without external state changes

The arithmetic function returns a sum of two supplied primitive values without modifying external state.

Read the example notes

Local-only describes the visible snippet under the declared environment. It does not establish behavior for every JavaScript coercion or a modified runtime. These samples use ordinary numeric inputs and standard built-ins. In a production review, attach the relevant types and dependencies or use static analysis and tests rather than treating a short semantic judgment as a formal guarantee.

The in-place sort operates on the items array supplied by the caller

The in-place sort operates on the items array supplied by the caller.

Read the example notes

Outside effect records that mutation even though the function also returns the sorted array. Returning a value does not make a function local-only. The example does not call the function or inspect a real repository. Its fixed packet preserves the observation so a developer can decide what additional tests or implementation change are appropriate.

Sorting a new local array

The copy-sort function first creates a new array and then sorts that local array.

Read the example notes

Its elements are ordinary numbers, and the supplied comparator performs subtraction only. Local-only concerns these declared conditions. A shallow copy containing objects would still share those objects with the caller, and a comparator with hidden side effects would change the task. Both would require a materially different request rather than reusing this fixture's saved result.

Using the result in your application

The counter fixture declares the enclosing variable alongside the function.

Read the example notes

Calling the function would increment that variable, so Outside effect follows from visible evidence. The variable being near the function does not make it local to each call. No actual counter is changed by this page. Jev reads the snippet as text; the downloadable output remains a pending review packet with no execution authority.

The network fixture invokes fetch with an HTTP endpoint and a serialized payload

The network fixture invokes fetch with an HTTP endpoint and a serialized payload.

Read the example notes

Outside effect identifies the explicit I/O operation. It does not determine whether the endpoint is permitted, reachable or safe, nor whether a server would accept the request. The snippet is fictional and is never executed by this example. A real integration still needs URL controls, authentication and tests owned by the application.

The delegated helper's behavior remains unknown

The last snippet delegates to normalizeRecord without providing that helper's implementation or behavioral contract.

Read the example notes

Need dependency preserves the missing information. A name such as normalize is not proof that the helper avoids mutation, logging or network activity. Attach the helper body or a trusted contract before making another judgment. The model cannot discover hidden code through this window, and an unchanged rerun would not fill the evidence gap.

Source and example scope

Fixture expectations are authored before the calls. Any contrary model choice remains visible beside its expectation and complete distribution; no repeated judgment is used to obtain a preferred label.

Using the result in your application

Download the exact sample requests and saved observations below.

Read the example notes

Expected labels are original fixture checks and stay outside the request sent to Jev. The observation file preserves the complete probabilities and the hash of each exact request. Editing a task, rubric or candidate requires a fresh response; a matching sample name does not make an older answer current.

Using the result in your application

The JavaScript runner makes one independent SDK request for a chosen sample ID.

Read the example notes

It reads TYPESAFE_API_KEY privately from the environment and has no automatic retry. The Python consumer operates offline: it checks the rubric, labels, unique sample identities, request hashes and valid probability distributions before selecting a fixed local preview. A tied leading result remains pending for review.

Source and example scope

The page reports measured adapter round trips and estimated input cost for the recorded calls.

Read the example notes

Those values describe these requests, not a provider latency guarantee or a billing statement. Six deliberately authored fixtures can check the stated behavior, but they do not establish accuracy on an unseen dataset. Keep disagreements and missing-input examples when testing an integration.

Runnable offline example

Replay one request and inspect the saved preview.

View the code example
Replay commands
npm install @typesafe-ai/sdk@0.6.0
# Set TYPESAFE_API_KEY privately in your shell.
node run-choice-sample.mjs samples.json arithmetic
python preview_choice_workflow_v2.py samples.json saved-api-results.json
Scope of this demo

Where does this decision fit?

Useful with explicit supplied evidence

  • Inspect supplied small JavaScript function text and explicit dependency behavior for input/external-state mutation or I/O, local-only computation, or an unknown helper. This is a bounded semantic review of visible text; no code runs and it is not a proof of purity, security or repository correctness.
  • Inspecting the original task and a fixed output before integrating external tools.
  • Comparing an explicit expected label with the complete recorded distribution.

Needs separate implementation or evidence

  • Inferring facts absent from the supplied input.
  • Treating a semantic selection as authorization to act.
  • Executing an external action or generalizing six fixtures into an accuracy claim.
Example FAQ

Questions about this original decision workflow.

Keep relevance, compliance and execution separate.

Is Local-only a proof that a function is pure?

No. It is a judgment about the supplied text, dependencies and stated conditions. Use static analysis, tests and trusted types for stronger guarantees.

Why does sorting an input count as outside work?

The caller owns that array. An in-place sort changes shared input state even when the function returns the same array.

Does copying an array remove every side effect?

No. The sample uses numbers and a local-only comparator. Shared object elements or an effectful comparator need a different review.

Will the example run my code?

No. It sends the code as text for a typed judgment and produces a fixed local observation. No submitted snippet executes.

What should I do with an unknown helper?

Supply its actual behavior or keep the review pending. A descriptive helper name cannot establish its side-effect boundary.

Try a task from your own workflow

Change the supplied task or evidence here, then inspect the live response. Playground supports another explicit decision.