Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions agents/conductors/hygiene/_hygiene_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
* ``env_knob`` — the script reads an ``os.environ.get("NAME", "<int>")``
sizing knob: a ``set:`` override in the smoke profile can
shrink the run without touching the file;
* ``simulates`` — it calls ``should_simulate`` and spawns the simulator
* ``simulates`` — it calls ``should_simulate`` (or its one-line wrapper
``simulate_if_needed``) and spawns the simulator
when the dataset is absent: with the dataset cache cold
the simulation is paid inside the script's own timing;
* ``jax_jit`` — it JITs (``jax.jit`` / ``ENV: jax``): compile cost, paid
Expand Down Expand Up @@ -230,7 +231,7 @@ def levers_from_text(text: str) -> list[dict]:
for name, default in _ENV_KNOB.findall(text):
out.append({"lever": "env_knob", "detail": f"{name} (default {default})",
"action": f"set {name} lower for smoke via a profile_smoke.yaml `set:` override"})
if "should_simulate(" in text:
if "should_simulate(" in text or "simulate_if_needed(" in text:
out.append({"lever": "simulates", "detail": "runs the simulator when the dataset is absent",
"action": "cold dataset cache → simulation is inside this timing; check cache_datasets"})
tokens = set()
Expand Down
7 changes: 7 additions & 0 deletions tests/test_hygiene_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ def test_levers_are_read_from_the_script_text():
assert "real_search" not in levers


def test_simulate_if_needed_counts_as_simulates():
"""The one-line wrapper swept into the workspaces must keep the lever."""
text = 'al.util.dataset.simulate_if_needed(p, simulator="scripts/sim.py")\n'
levers = {l["lever"] for l in ci.levers_from_text(text)}
assert "simulates" in levers


def test_real_output_token_releases_every_var():
levers = {l["lever"] for l in ci.levers_from_text('"""\n__Env__\nENV: real_output\n"""\n')}
assert {"jax_jit", "full_datasets", "real_search"} <= levers
Expand Down
Loading