"""Thin CLI smoke coverage for `giant rollout` (issues.md Issue 5) — confirms the CheckpointCompatibilityError raised by giant.checkpoint_io.load_for_inference surfaces as a clean typer.Exit(1) with the expected message, end-to-end through the CLI, not just at the giant.checkpoint_io unit level.""" from __future__ import annotations import torch from typer.testing import CliRunner from giant.cli import app runner = CliRunner() def test_rollout_exits_1_on_checkpoint_missing_model_config(tmp_path): checkpoint = tmp_path / "bad.pt" torch.save({"sec_decoder": {}, "normalizer": {"sec_phys": {}}}, checkpoint) result = runner.invoke( app, [ "rollout", "dummy.parquet", "--checkpoint", str(checkpoint), "--geometry", "dummy_geometry.pkl", ], ) assert result.exit_code == 1 assert "checkpoint has no model_config" in result.output