How dannote/jev works
Jev is an OTP client for TypeSafe and compatible decision models. Its main workflow accepts questions and state through a Jev.Server callback, dispatches each request asynchronously to a backend, converts the model response into a typed reply map, and routes that reply (or an error) to the user’s handle_answer callback. It also supports direct HTTP calls, custom backends, and request telemetry. The graph follows documented and sampled wiring; unsampled optional backends are shown only as an extension point.
Main entry points: http.ex HTTP Backend · server.ex Jev Server · jev.ex Question Normalizer · backend.ex Backend Contract
Components 16
Question API
- Question Normalizer
lib/jev.ex - Yes/No Question
lib/jev/noul.ex - Choice Question
lib/jev/choice.ex - Score Question
lib/jev/score.ex - Reply Builder
lib/jev.ex
OTP Workflow
- Jev Server
lib/jev/server.ex
Backend Transport
- Backend Contract
lib/jev/backend.ex - HTTP Backend
lib/jev/http.ex - Wire Codecs
lib/jev/wire.ex - HTTP Error
lib/jev/error.ex
Runtime Services
- Task Supervisor
lib/jev/application.ex - Request Telemetry
lib/jev/telemetry.ex - OTP Application
lib/jev/application.ex
Other components
- OTP Caller
- Decision Model
- Direct API User
Connections 18
- OTP Caller → Jev Server: calls
- Jev Server → Question Normalizer: normalizes
- Question Normalizer → Yes/No Question: builds
- Question Normalizer → Choice Question: builds
- Question Normalizer → Score Question: builds
- Jev Server → Task Supervisor: starts task
- Jev Server → Backend Contract: dispatches
- HTTP Backend → Backend Contract: implements
- HTTP Backend → Request Telemetry: spans request
- HTTP Backend → Decision Model: posts request
- Decision Model → HTTP Backend: returns JSON
- HTTP Backend → Wire Codecs: decodes
- HTTP Backend → Reply Builder: builds reply
- Reply Builder → Jev Server: returns result
- HTTP Backend → HTTP Error: returns failures
- Jev Server → OTP Caller: delivers answer
- OTP Application → Task Supervisor: supervises
- Direct API User → HTTP Backend: posts directly