mixle.experimental.typed_runtime.context_scheduler moduleΒΆ
Budgeted value-of-information scheduling for context construction.
- class ContextBudget(latency_seconds=inf, materialized_tokens=9223372036854775807, monetary_cost=inf, tool_calls=2147483647, maximum_actions=2147483647)[source]
Bases:
objectHard cumulative context-construction resource limits.
- class ContextScheduleDecision(selected, ranked_action_ids, lower_confidence_gains, expected_costs, net_values, inadmissible, stopping_reason)[source]
Bases:
objectOne selected action or explicit stopping action with ranked evidence.
- Parameters:
- property stopped: bool
Whether the scheduler selected its explicit STOP action.
- class ContextSchedulerConfig(confidence_z=1.645, latency_cost=1.0, token_cost=1e-05, monetary_cost=1.0, tool_call_cost=0.01, minimum_net_value=0.0)[source]
Bases:
objectConfidence and resource exchange rates for value-of-information.
- class ValueOfInformationScheduler(budget=None, config=None)[source]
Bases:
objectStateful context-action scheduler debited by actual execution receipts.
- Parameters:
budget (ContextBudget | None)
config (ContextSchedulerConfig | None)
- stop_decision(graph, reason)[source]
Create an explicit zero-work scheduling decision for termination.
- Parameters:
graph (ContextGraph)
reason (str)
- Return type:
ContextScheduleDecision
- choose(actions, graph)[source]
Choose the highest positive net VOI action or stop explicitly.
- Parameters:
actions (tuple[ContextAction, ...])
graph (ContextGraph)
- Return type:
ContextScheduleDecision
- record(receipt)[source]
Debit actual work once; rejected/rolled-back work still costs resources.
- Parameters:
receipt (ContextActionReceipt)
- Return type:
None