ov.operate#
The operate layer – deterministic, LLM-free tool primitives (the “hands”).
This is the package-owned tool plane from §2.3. It composes as
journal(progress(act(observe()))) and contains no model and no policy: it
perceives affordances, executes actions, records the journey, and reports
loop/no-progress facts. The decision of what to do next and when to stop
belongs to the policy plane – the host (Claude Code) via the ov-operate
skill, or, later, an in-package agent.
Primitives (each is individually callable and testable):
observe()–observe(page, strategy) -> Observationact()–act(page, action) -> ActionResult(returns a fresh Observation)journal()– append a structured per-step recordprogress()– loop/no-progress facts (never decides to stop)perception strategies –
PERCEPTION_REGISTRY
Functions
|
Perceive the current page state with |
|
Execute |
|
Append |
|
Build a |
|
Compute loop/no-progress facts from the journey |
|
Dispatch to the named perception strategy (defaults to |
- ov.operate.act(page, action, *, perception='ax_snapshot', polite_rate_s=0.0)[source]#
Execute
actionagainstpageand return the result + a fresh Observation.On failure,
ok=Falseanderrorcarries the message; a fresh Observation is still attached so the host can recover (re-observe, scroll, disambiguate).- Return type:
- ov.operate.make_step(*, intent, action=None, pre_observation=None, result=None, artifact_ids=None, network_delta=0, console_delta=0, note=None)[source]#
Build a
JourneyStepfrom an action’s before/after observations.outcomeis derived:erroron a failed action,noopwhen the post-observation hash equals the pre-observation hash (nothing changed), elseok.- Return type:
- ov.operate.observe(page, strategy='ax_snapshot')[source]#
Perceive the current page state with
strategyand return an Observation.>>> from ov.operate.perception import PERCEPTION_REGISTRY >>> "ax_snapshot" in PERCEPTION_REGISTRY True
- Return type:
- ov.operate.perceive(page, strategy='ax_snapshot')[source]#
Dispatch to the named perception strategy (defaults to
ax_snapshot).Raises
KeyErrorwith the known strategies whenstrategyis unknown – an informative error per the project’s principles.- Return type:
- ov.operate.progress(history, *, no_progress_steps=3)[source]#
Compute loop/no-progress facts from the journey
historyso far.>>> from ov.base import JourneyStep, Action >>> s = JourneyStep(action=Action(type='click', ref='e1'), post_obs_hash='h') >>> sig = progress([s, s.model_copy(), s.model_copy()], no_progress_steps=3) >>> sig.no_new_signal_steps >= 3 and sig.loop_suspected True
- Return type:
Modules
The scripted/guided driver -- model-free journey execution (Phase 1). |
|
Perception strategies -- pluggable ways to turn a page into an |
|
Journey-strategy helpers -- intent shaping for the three strategies (§2.3). |