tauopt.engine.policy.base#

Policy protocol: experiment shape -> optimizer config (the routing mechanism).

route is called PER ask, so mid-experiment strategy switching is native – a policy is just a pure function of the current state. The open default policy ships here; the service may run a cleverer closed router, but hosted users can always pin explicit configs (the public config stratum).

Module Contents#

Classes#

Policy

Structural interface for routers: name and version identify the policy (see :func:policy_id); route picks each ask’s config.

Functions#

policy_id

name@version identity string, recorded in provenance as policy.

API#

class tauopt.engine.policy.base.Policy#

Bases: typing.Protocol

Structural interface for routers: name and version identify the policy (see :func:policy_id); route picks each ask’s config.

name: str#

None

version: str#

None

route(state: tauopt.engine.state.ExperimentState) → tauopt.engine.config.OptimizerConfig#

Map the current experiment state to this ask’s optimizer config.

Called once per ask, so mid-experiment strategy switching is native; implementations must be pure functions of state so routed asks stay deterministic (P4).

tauopt.engine.policy.base.policy_id(policy: tauopt.engine.policy.base.Policy) → str#

name@version identity string, recorded in provenance as policy.