Noul, Choice, and Score
questions without depending on a provider-specific SDK.
TypeSafe is the first Decision provider. The bundled typesafe preset uses the
TYPESAFE_API_KEY environment variable and the jev-latest model alias.
Typed structured decisions
The newCognesy\Polyglot\Decision namespace provides:
Decision,DecisionProvider,DecisionRuntime, andPendingDecision- provider-neutral
DecisionRequestandDecisionResponseobjects - typed
Noul,Choice, andScorequestions - typed answers with validated probability distributions
- application-owned Choice option IDs and ordered Score levels
- text, object, or list state through
JsonContent - portable
toArray()andfromArray()payloads
JsonContent::object() and JsonContent::list() preserve structured state when
named fields or list position matter.
Runtime, retries, and observability
Decision follows Polyglot’s established facade, request, pending handle, runtime, driver, and response shape.create() is lazy, and one
PendingDecision memoizes both successful responses and terminal failures.
There is no Decision stream: one execution returns one validated typed result.
Retries are opt-in through DecisionRetryPolicy. The Decision execution session
is the single retry owner, applies bounded backoff and jitter, and honors bounded
Retry-After for retriable provider responses.
The runtime emits execution and attempt lifecycle events and projects them as
sdm.decision and sdm.decision.attempt telemetry spans. Default event and
telemetry payloads omit state, question content, provider bodies, credentials,
and exception messages.
TypeSafe adapter and extension points
The TypeSafe driver translates the stable Decision domain to the System One API and validates that returned IDs, primitive kinds, Choice winners, Score legends, and probability distributions match the original request. Provider failures are normalized into Decision-specific authentication, invalid request, rate-limit, transient, and response exceptions. Custom providers can implementCanProcessDecisionRequest and register through
DecisionDriverRegistry without changing application-facing request or answer
types.
Configuration and documentation
Decision presets live underconfig/sdm. The release also makes bundled
default.yaml discovery consistent for LLM, embeddings, and SDM configuration
in aggregate and standalone Composer installations.
Polyglot documentation now covers question design, typed response handling,
configuration, runtime composition, retries, lifecycle events, telemetry,
errors, testing, and custom drivers. Four executable B06_Decisions examples
demonstrate primitives, dynamic choices, structured state, and explicit runtime
composition.