mixle.experimental.typed_runtime.context_runtime moduleΒΆ

Closed-loop effective-context construction from actions through bounded materialization.

class EffectiveContextRun(decisions, action_receipts, stopping_reason, final_graph_version)[source]

Bases: object

Every scheduler decision and actual action receipt through stopping.

Parameters:
  • decisions (tuple[ContextScheduleDecision, ...])

  • action_receipts (tuple[ContextActionReceipt, ...])

  • stopping_reason (str)

  • final_graph_version (int)

property completed_actions: tuple[ContextActionReceipt, ...]

Receipts excluding the zero-cost STOP marker.

as_dict()[source]

Return a JSON-compatible closed-loop receipt.

Return type:

dict[str, Any]

class EffectiveContextRuntime(graph, scheduler, executor, action_provider)[source]

Bases: object

Run value-of-information context actions until an explicit stopping rule.

Parameters:
  • graph (ContextGraph)

  • scheduler (ValueOfInformationScheduler)

  • executor (ContextActionExecutor)

  • action_provider (ContextActionProvider)

run(*, maximum_iterations=100)[source]

Construct/revisit context until VOI stops or the hard loop guard fires.

Parameters:

maximum_iterations (int)

Return type:

EffectiveContextRun

materialize(relevance, policy, tokenizer, *, source_horizon_tokens=None, required_node_ids=())[source]

Materialize the last run with its measured action costs.

Parameters:
  • relevance (dict[str, float])

  • policy (MaterializationPolicy)

  • tokenizer (ContextTokenizer)

  • source_horizon_tokens (int | None)

  • required_node_ids (tuple[str, ...])

Return type:

MaterializedContext