| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path | |
| import pytest | |
| from sctm_next_round import structure_gate | |
| pytestmark = pytest.mark.integration | |
| def test_step2_structure_gate_passes_on_canonical_smoke_tensor(tmp_path: Path) -> None: | |
| args = argparse.Namespace( | |
| tensor_dir=structure_gate.DEFAULT_TENSOR_SMOKE / "tensor", | |
| stage0_dir=structure_gate.DEFAULT_TENSOR_SMOKE / "stage0", | |
| out_dir=tmp_path / "structure_gate", | |
| split="train", | |
| action_dir=None, | |
| max_windows=32, | |
| batch_size=4, | |
| d_model=16, | |
| n_heads=4, | |
| n_layers=1, | |
| dropout=0.0, | |
| device="cpu", | |
| seed=20260605, | |
| ) | |
| summary = structure_gate.run(args) | |
| assert summary["status"] == "pass" | |
| assert summary["n_gates"] == 10 | |
| assert summary["n_fail"] == 0 | |
| assert not summary["blocking_failure_ids"] | |
| assert (args.out_dir / "unit_test_summary.csv").exists() | |
| assert (args.out_dir / "unit_copy_delta_anchor_missing_current.json").exists() | |
| assert (args.out_dir / "informative_observation_gate.json").exists() | |