Mutator contract
BaseMutator.mutate(context) is asynchronous and returns MutationResult. The included LLMMutator:
- copies the input
InterpretiveState; - asks the supplied
BaseLLMClientfor a JSON array of extractions; - validates each extraction;
- appends a
ValueConfidencecandidate; and - replaces the field’s latest
Inference.
Projector contracts
BaseProjectorCanonicalState requires project() and can_trigger_action(). Its schema supports resolution strategy, confidence threshold, validation errors, fields requiring confirmation, and triggered-action identifiers.
BaseProjectorUI requires project(), generate_prompt(), and map_field_to_component(). UI model types are data contracts; no renderer is bundled.
Keep orchestration ownership explicit
When composing extensions, decide which layer owns the loop, current state, authentication, billing, persistence, and retries. The baseLangState class stores references but does not silently take ownership of those concerns.