diff --git a/src/usersim/cli/simulate.py b/src/usersim/cli/simulate.py index 71a144b..80da5e7 100644 --- a/src/usersim/cli/simulate.py +++ b/src/usersim/cli/simulate.py @@ -620,7 +620,6 @@ def _simulate_to_parquet( assets_dir=Path(assets_dir).resolve(), trajectories_requested=requested_per_locale, persona_language_filters=applied_language_filters, - source_kind="cli", ) print(f" manifest: {manifest_path_written}") except Exception as e: # pragma: no cover — defensive: never fail a run on manifest issues diff --git a/tests/test_cli_simulate_run_partition.py b/tests/test_cli_simulate_run_partition.py index 8da7ab9..aa5b1fe 100644 --- a/tests/test_cli_simulate_run_partition.py +++ b/tests/test_cli_simulate_run_partition.py @@ -34,6 +34,7 @@ from __future__ import annotations import json +import sys from pathlib import Path from unittest.mock import patch @@ -254,6 +255,10 @@ def _fake_builder(**kwargs): return _FakeDD(), object() models = load_models_config(default_models_path()) + # The command line the manifest should record. + monkeypatch.setattr(sys, "argv", ["usersim", "simulate", "--locale", "en_US", "--num-rows", "1"]) + monkeypatch.delenv("SLURM_JOB_ID", raising=False) + monkeypatch.setattr("usersim.engine.core.manifest._is_running_in_notebook", lambda: False) with patch("usersim.cli._pipeline.build_simulator_config_builder", _fake_builder): rc = _simulate_to_parquet( models=models, @@ -304,6 +309,8 @@ def _fake_builder(**kwargs): assert fresh_manifest.scope.toolset_seed_path is None assert fresh_manifest.scope.toolset_content_hash is None assert fresh_manifest.simulation_config.store_reasoning is False + assert fresh_manifest.source.kind == "cli" + assert fresh_manifest.source.invocation == "usersim simulate --locale en_US --num-rows 1" assert load_run_manifest("1700000000", out) is None def test_simulate_helper_resumes_into_latest_when_skip_existing_true(