| 1 | """Negative task-oracle tests: fixture validators are not trusted evidence."""
|
| 2 | from __future__ import annotations
|
| 3 |
|
| 4 | import json
|
| 5 | import subprocess
|
| 6 | from pathlib import Path
|
| 7 | import shutil
|
| 8 | import sys
|
| 9 | import tempfile
|
| 10 | import unittest
|
| 11 | from unittest import mock
|
| 12 |
|
| 13 | sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
| 14 | import workflow_ab
|
| 15 | import agent_workflow
|
| 16 | from oakbench import workflow_oracles
|
| 17 |
|
| 18 |
|
| 19 | class ExistingOracleFalsePassTest(unittest.TestCase):
|
| 20 | def test_deleting_rewritten_configs_fails(self):
|
| 21 | with tempfile.TemporaryDirectory() as tmp:
|
| 22 | repo = Path(tmp)
|
| 23 | workflow_ab.make_wide_config_fixture(repo)
|
| 24 | for path in (repo / "services").glob("*/config.toml"):
|
| 25 | path.write_text(path.read_text().replace("timeout_ms = 2500", "timeout_ms = 3000"))
|
| 26 | (repo / "services/service-0003/config.toml").unlink()
|
| 27 | self.assertIsNotNone(workflow_ab.workflow_worktree_payload_failure(
|
| 28 | workflow_ab.WORKFLOWS["wide_config_refactor"], repo
|
| 29 | ))
|
| 30 |
|
| 31 | def test_empty_manifest_fails(self):
|
| 32 | with tempfile.TemporaryDirectory() as tmp:
|
| 33 | repo = Path(tmp)
|
| 34 | (repo / "manifest.json").write_text('{"assets": []}')
|
| 35 | self.assertIsNotNone(workflow_ab.workflow_worktree_payload_failure(
|
| 36 | workflow_ab.WORKFLOWS["large_asset_manifest"], repo
|
| 37 | ))
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 | def finish_configs(repo):
|
| 42 | for path in (repo / "services").glob("*/config.toml"):
|
| 43 | path.write_text(path.read_text().replace("timeout_ms = 2500", "timeout_ms = 3000"))
|
| 44 |
|
| 45 |
|
| 46 | def finish_assets(repo):
|
| 47 | path = repo / "manifest.json"
|
| 48 | data = json.loads(path.read_text())
|
| 49 | for entry in data["assets"]:
|
| 50 | entry["reviewed"] = True
|
| 51 | path.write_text(json.dumps(data))
|
| 52 |
|
| 53 |
|
| 54 | class TrustedWorkflowOracleTest(unittest.TestCase):
|
| 55 | def assert_both_lanes_reject(self, name, repo, reason):
|
| 56 | workflow = workflow_ab.WORKFLOWS[name]
|
| 57 | failure = workflow_ab.workflow_worktree_payload_failure(workflow, repo)
|
| 58 | self.assertIsNotNone(failure)
|
| 59 | self.assertIn(reason, failure)
|
| 60 | # This is the exact external command run by real-agent run_oracle.
|
| 61 | proc = agent_workflow.run_command(agent_workflow.test_command_for(workflow), repo)
|
| 62 | self.assertEqual(proc.returncode, 1, proc.stderr)
|
| 63 | self.assertIn(reason, proc.stdout)
|
| 64 |
|
| 65 | def test_exact_configs_reject_loss_extras_wrong_values_and_types(self):
|
| 66 | with tempfile.TemporaryDirectory() as tmp:
|
| 67 | repo = Path(tmp)
|
| 68 | workflow_ab.make_wide_config_fixture(repo)
|
| 69 | finish_configs(repo)
|
| 70 | self.assertIsNone(workflow_oracles.validate("wide_config_refactor", repo))
|
| 71 | path = repo / "services/service-0003/config.toml"
|
| 72 | original = path.read_bytes()
|
| 73 | for wrong in (b"", original.replace(b"3000", b"1800"), original + b"retries = 99\n"):
|
| 74 | with self.subTest(wrong=wrong):
|
| 75 | path.write_bytes(wrong)
|
| 76 | self.assert_both_lanes_reject("wide_config_refactor", repo, "config_payload_mismatch")
|
| 77 | path.unlink()
|
| 78 | self.assert_both_lanes_reject("wide_config_refactor", repo, "config_path_set_mismatch")
|
| 79 | path.symlink_to("../../service-0000/config.toml")
|
| 80 | self.assert_both_lanes_reject("wide_config_refactor", repo, "payload_path_type")
|
| 81 | path.unlink()
|
| 82 | path.write_bytes(original)
|
| 83 | extra = repo / "services/extra"
|
| 84 | extra.write_bytes(b"unexpected")
|
| 85 | self.assert_both_lanes_reject("wide_config_refactor", repo, "config_path_set_mismatch")
|
| 86 | extra.unlink()
|
| 87 | untouched = repo / "services/service-0001/config.toml"
|
| 88 | untouched.write_bytes(untouched.read_bytes().replace(b"1800", b"3000"))
|
| 89 | self.assert_both_lanes_reject("wide_config_refactor", repo, "config_payload_mismatch")
|
| 90 |
|
| 91 | def test_assets_reject_manifest_lies_and_content_corruption(self):
|
| 92 | with tempfile.TemporaryDirectory() as tmp:
|
| 93 | repo = Path(tmp)
|
| 94 | workflow_ab.make_large_asset_fixture(repo)
|
| 95 | finish_assets(repo)
|
| 96 | self.assertIsNone(workflow_oracles.validate("large_asset_manifest", repo))
|
| 97 | path = repo / "manifest.json"
|
| 98 | valid = json.loads(path.read_text())
|
| 99 | variants = [
|
| 100 | ({"assets": []}, "manifest_asset_count"),
|
| 101 | ({"assets": valid["assets"][:3]}, "manifest_asset_count"),
|
| 102 | ({"assets": valid["assets"] + [valid["assets"][0]]}, "manifest_asset_count"),
|
| 103 | ({"assets": [valid["assets"][0]] * 4}, "manifest_duplicate_asset"),
|
| 104 | ({"assets": [{**item, "bytes": True} for item in valid["assets"]]}, "manifest_asset_fields"),
|
| 105 | ({"assets": [{**item, "reviewed": 1} for item in valid["assets"]]}, "manifest_asset_fields"),
|
| 106 | ({"assets": [{**item, "path": "../outside"} for item in valid["assets"]]}, "manifest_asset_identity"),
|
| 107 | ({"assets": None}, "manifest_asset_count"),
|
| 108 | ({}, "manifest_object_shape"),
|
| 109 | ]
|
| 110 | for data, reason in variants:
|
| 111 | with self.subTest(data=data):
|
| 112 | path.write_text(json.dumps(data))
|
| 113 | self.assert_both_lanes_reject("large_asset_manifest", repo, reason)
|
| 114 | path.write_text('{"assets": [], "assets": []}')
|
| 115 | self.assert_both_lanes_reject("large_asset_manifest", repo, "duplicate_json_key")
|
| 116 | path.write_text(json.dumps(valid))
|
| 117 | extra = repo / "assets/asset-04.bin"
|
| 118 | extra.write_bytes(b"extra")
|
| 119 | self.assert_both_lanes_reject("large_asset_manifest", repo, "asset_path_set_mismatch")
|
| 120 | extra.unlink()
|
| 121 | asset = repo / "assets/asset-03.bin"
|
| 122 | with asset.open("r+b") as stream:
|
| 123 | stream.write(b"X")
|
| 124 | self.assert_both_lanes_reject("large_asset_manifest", repo, "asset_content_mismatch")
|
| 125 | asset.unlink()
|
| 126 | self.assert_both_lanes_reject("large_asset_manifest", repo, "asset_path_set_mismatch")
|
| 127 |
|
| 128 | def test_deleted_or_noop_fixture_validator_cannot_bypass_oracle(self):
|
| 129 | for name, filename, maker, finish in (
|
| 130 | ("wide_config_refactor", "validate_configs.py", workflow_ab.make_wide_config_fixture, finish_configs),
|
| 131 | ("large_asset_manifest", "validate_manifest.py", workflow_ab.make_large_asset_fixture, finish_assets),
|
| 132 | ):
|
| 133 | with self.subTest(name=name), tempfile.TemporaryDirectory() as tmp:
|
| 134 | repo = Path(tmp) / "repo"
|
| 135 | repo.mkdir()
|
| 136 | artifacts = Path(tmp) / "artifacts"
|
| 137 | artifacts.mkdir()
|
| 138 | maker(repo)
|
| 139 | before = agent_workflow.workspace_manifest(repo)
|
| 140 | finish(repo)
|
| 141 | validator = repo / filename
|
| 142 | for replacement in (b"raise SystemExit(0)\n", None):
|
| 143 | if replacement is None:
|
| 144 | validator.unlink()
|
| 145 | else:
|
| 146 | validator.write_bytes(replacement)
|
| 147 | self.assert_both_lanes_reject(name, repo, "fixture_validator_modified_or_missing")
|
| 148 | subject = workflow_ab.Subject(name="git", kind="git", label="git", bin=Path("/git"))
|
| 149 | with mock.patch.object(agent_workflow, "vcs_status", return_value=("", 0, 0.0)), \
|
| 150 | mock.patch.object(agent_workflow, "commit_count", return_value=2):
|
| 151 | result = agent_workflow.run_oracle(
|
| 152 | subject, workflow_ab.WORKFLOWS[name], repo, before, 1, artifacts,
|
| 153 | )
|
| 154 | self.assertFalse(result.success)
|
| 155 | self.assertFalse(result.checks["required_checks_passed"])
|
| 156 | self.assertIn("fixture_validator_modified_or_missing", (artifacts / "oracle.test.log").read_text())
|
| 157 |
|
| 158 | def test_invalid_trusted_oracle_envelope_is_unmeasured(self):
|
| 159 | with tempfile.TemporaryDirectory() as tmp:
|
| 160 | repo = Path(tmp)
|
| 161 | workflow_ab.make_wide_config_fixture(repo)
|
| 162 | before = agent_workflow.workspace_manifest(repo)
|
| 163 | finish_configs(repo)
|
| 164 | artifacts = repo / "logs"
|
| 165 | artifacts.mkdir()
|
| 166 | subject = workflow_ab.Subject("git", "git", "Git", Path("/git"))
|
| 167 | for output, code in (("", 1), ("{}", 0), ("not json", 0),
|
| 168 | (json.dumps({"oracle_version": workflow_oracles.VERSION,
|
| 169 | "workflow_integrity_source": "trusted", "workflow_integrity_passed": None}), 77)):
|
| 170 | with mock.patch.object(agent_workflow, "run_command", return_value=subprocess.CompletedProcess([], code, output, "")), \
|
| 171 | mock.patch.object(agent_workflow, "vcs_status", return_value=("", 0, 0)), \
|
| 172 | mock.patch.object(agent_workflow, "commit_count", return_value=2):
|
| 173 | result = agent_workflow.run_oracle(subject, workflow_ab.WORKFLOWS["wide_config_refactor"], repo, before, 1, artifacts)
|
| 174 | self.assertIsNone(result.evidence["workflow_integrity_passed"])
|
| 175 | self.assertEqual(result.evidence["workflow_integrity_unmeasured_reason"], "trusted_oracle_evidence_invalid_or_missing")
|
| 176 |
|
| 177 | def test_unavailable_required_check_does_not_hide_measured_failure(self):
|
| 178 | with tempfile.TemporaryDirectory() as tmp:
|
| 179 | repo = Path(tmp)
|
| 180 | workflow_ab.make_wide_config_fixture(repo)
|
| 181 | before = agent_workflow.workspace_manifest(repo)
|
| 182 | finish_configs(repo)
|
| 183 | evidence = {"oracle_version": workflow_oracles.VERSION, "workflow_integrity_source": "trusted",
|
| 184 | "workflow_integrity_passed": None, "workflow_integrity_unmeasured_reason": "missing"}
|
| 185 | with mock.patch.object(agent_workflow, "run_command", return_value=subprocess.CompletedProcess([], 77, json.dumps(evidence), "")), \
|
| 186 | mock.patch.object(agent_workflow, "vcs_status", return_value=("dirty", 1, 0)), \
|
| 187 | mock.patch.object(agent_workflow, "expected_change_ok", return_value=True), \
|
| 188 | mock.patch.object(agent_workflow, "commit_count", return_value=2):
|
| 189 | result = agent_workflow.run_oracle(workflow_ab.Subject("git", "git", "Git", Path("/git")),
|
| 190 | workflow_ab.WORKFLOWS["wide_config_refactor"], repo, before, 1, repo)
|
| 191 | self.assertIsNone(result.checks["required_checks_passed"])
|
| 192 | self.assertEqual(result.failure_reason, "final_vcs_clean")
|
| 193 |
|
| 194 | def test_nontrusted_check_return77_is_unmeasured(self):
|
| 195 | with tempfile.TemporaryDirectory() as tmp:
|
| 196 | repo = Path(tmp)
|
| 197 | with mock.patch.object(agent_workflow, "run_command", return_value=subprocess.CompletedProcess([], 77, "", "missing tool")), \
|
| 198 | mock.patch.object(agent_workflow, "vcs_status", return_value=("", 0, 0)), \
|
| 199 | mock.patch.object(agent_workflow, "expected_change_ok", return_value=True), \
|
| 200 | mock.patch.object(agent_workflow, "commit_count", return_value=2):
|
| 201 | result = agent_workflow.run_oracle(workflow_ab.Subject("git", "git", "Git", Path("/git")),
|
| 202 | workflow_ab.WORKFLOWS["bugfix_test_loop"], repo, {}, 1, repo)
|
| 203 | self.assertIsNone(result.checks["required_checks_passed"])
|
| 204 | self.assertIsNone(result.failure_reason)
|
| 205 | self.assertIsNone(result.evidence["workflow_integrity_passed"])
|
| 206 | self.assertEqual(result.evidence["workflow_integrity_unmeasured_reason"], "required_check_instrument_unavailable")
|
| 207 |
|
| 208 | def test_fixture_module_shadowing_is_not_executed(self):
|
| 209 | with tempfile.TemporaryDirectory() as tmp:
|
| 210 | repo = Path(tmp)
|
| 211 | workflow_ab.make_wide_config_fixture(repo)
|
| 212 | finish_configs(repo)
|
| 213 | (repo / "json.py").write_text("raise RuntimeError('untrusted import executed')")
|
| 214 | proc = agent_workflow.run_command(
|
| 215 | agent_workflow.test_command_for(workflow_ab.WORKFLOWS["wide_config_refactor"]), repo,
|
| 216 | )
|
| 217 | self.assertEqual(proc.returncode, 0, proc.stderr)
|
| 218 |
|
| 219 | def test_scripted_unavailable_instrument_row_persists(self):
|
| 220 | from oakbench.rows import validate_rows
|
| 221 | from oakbench.results import ResultsStore
|
| 222 | with tempfile.TemporaryDirectory() as tmp:
|
| 223 | repo = Path(tmp)
|
| 224 | workflow_ab.make_wide_config_fixture(repo)
|
| 225 | finish_configs(repo)
|
| 226 | subject = workflow_ab.Subject("git", "git", "Git", Path("/subject/not-reader"))
|
| 227 | with mock.patch.object(workflow_oracles, "resolve_git_instrument", return_value=(None, {})):
|
| 228 | evidence = workflow_ab.workflow_integrity_fields(subject, workflow_ab.WORKFLOWS["wide_config_refactor"], repo, [])
|
| 229 | row = workflow_ab.sum_rows([], {"bench_id": "test", "profile": "test"}, subject,
|
| 230 | workflow_ab.WORKFLOWS["wide_config_refactor"], 0, "workflow", "workflow.total", evidence)
|
| 231 | self.assertEqual(row["returncode"], 77)
|
| 232 | self.assertEqual(validate_rows([row], "workflow"), [])
|
| 233 | ResultsStore(repo / "results", "workflow").write("test", [row])
|
| 234 |
|
| 235 | def test_workflow_summary_fails_when_trusted_payload_fails(self):
|
| 236 | with tempfile.TemporaryDirectory() as tmp:
|
| 237 | repo = Path(tmp)
|
| 238 | workflow_ab.make_wide_config_fixture(repo)
|
| 239 | finish_configs(repo)
|
| 240 | (repo / "services/service-0003/config.toml").unlink()
|
| 241 | subject = workflow_ab.Subject(name="oak", kind="oak", label="oak", bin=Path("/oak"))
|
| 242 | fields = workflow_ab.workflow_integrity_fields(
|
| 243 | subject, workflow_ab.WORKFLOWS["wide_config_refactor"], repo, [],
|
| 244 | )
|
| 245 | self.assertFalse(fields["correctness_passed"])
|
| 246 | self.assertIn("config_path_set_mismatch", fields["correctness_failure_reason"])
|
| 247 | self.assertEqual(fields["oracle_version"], workflow_oracles.VERSION)
|
| 248 |
|
| 249 |
|
| 250 | @unittest.skipIf(shutil.which("git") is None, "git not installed")
|
| 251 | class CommittedWorkflowOracleTest(unittest.TestCase):
|
| 252 | def test_subject_binary_never_becomes_committed_tree_reader(self):
|
| 253 | with tempfile.TemporaryDirectory() as tmp:
|
| 254 | repo = Path(tmp)
|
| 255 | workflow_ab.make_wide_config_fixture(repo)
|
| 256 | finish_configs(repo)
|
| 257 | subject = workflow_ab.Subject("git", "git", "Git candidate", Path("/candidate/git"))
|
| 258 | with mock.patch.object(workflow_oracles, "resolve_git_instrument", return_value=(None, {})) as resolve:
|
| 259 | workflow_ab.workflow_integrity_fields(subject, workflow_ab.WORKFLOWS["wide_config_refactor"], repo, [])
|
| 260 | resolve.assert_called_once_with(None)
|
| 261 | command = agent_workflow.test_command_for(workflow_ab.WORKFLOWS["wide_config_refactor"], subject)
|
| 262 | self.assertNotIn("/candidate/git", command)
|
| 263 |
|
| 264 | def test_killed_git_instrument_is_unmeasured(self):
|
| 265 | with mock.patch.object(workflow_oracles, "resolve_git_instrument", return_value=("/git", {})), \
|
| 266 | mock.patch.object(workflow_oracles.subprocess, "run", return_value=subprocess.CompletedProcess([], -9, b"", b"")):
|
| 267 | self.assertEqual(workflow_oracles.validate_git_head("wide_config_refactor", Path("/tmp")), "git_head_oracle_unavailable")
|
| 268 | self.assertEqual(workflow_oracles.git_head_text(Path("/tmp"), "x"), (None, "git_head_oracle_unavailable"))
|
| 269 |
|
| 270 | def test_path_instrument_and_missing_instrument_are_not_subject_failures(self):
|
| 271 | real_git = shutil.which("git")
|
| 272 | with tempfile.TemporaryDirectory() as tmp:
|
| 273 | repo = Path(tmp)
|
| 274 | workflow_ab.make_wide_config_fixture(repo)
|
| 275 | finish_configs(repo)
|
| 276 | with mock.patch.object(workflow_oracles.shutil, "which", return_value=None) as lookup:
|
| 277 | evidence = workflow_oracles.task_evidence("wide_config_refactor", repo, "git")
|
| 278 | lookup.assert_called_with("git")
|
| 279 | self.assertIsNone(evidence["workflow_integrity_passed"])
|
| 280 | self.assertEqual(evidence["workflow_integrity_unmeasured_reason"], "git_head_oracle_unavailable")
|
| 281 | self.assertIsNone(evidence["git_head_instrument_sha256"])
|
| 282 | binary, metadata = workflow_oracles.resolve_git_instrument(real_git)
|
| 283 | self.assertTrue(Path(binary).is_absolute())
|
| 284 | self.assertEqual(len(metadata["git_head_instrument_sha256"]), 64)
|
| 285 | self.assertTrue(metadata["git_head_instrument_version"])
|
| 286 |
|
| 287 | @unittest.skipUnless(shutil.which("oak"), "Oak installed binary required")
|
| 288 | def test_correct_oak_worktree_cannot_hide_partial_checkpoint(self):
|
| 289 | binary = shutil.which("oak")
|
| 290 | with tempfile.TemporaryDirectory() as tmp:
|
| 291 | repo = Path(tmp)
|
| 292 | workflow_ab.make_wide_config_fixture(repo)
|
| 293 | def oak(*args):
|
| 294 | process = subprocess.run([binary, *args], cwd=repo, env=workflow_ab.base_env(), capture_output=True, timeout=60)
|
| 295 | self.assertEqual(process.returncode, 0, process.stderr)
|
| 296 | oak("init"); oak("commit", "--no-verify")
|
| 297 | finish_configs(repo)
|
| 298 | oak("commit", "--no-verify", "services/service-0000/config.toml")
|
| 299 | self.assertIsNone(workflow_oracles.validate("wide_config_refactor", repo))
|
| 300 | evidence = workflow_oracles.task_evidence("wide_config_refactor", repo, "oak", binary)
|
| 301 | self.assertIs(evidence["workflow_integrity_passed"], False, evidence)
|
| 302 | self.assertIn("subject_produced_oak_head_export", evidence["workflow_integrity_source"])
|
| 303 | self.assertIn("git_head_config_payload_mismatch", evidence["workflow_integrity_failure_reason"])
|
| 304 | oak("commit", "--no-verify")
|
| 305 | verified = workflow_oracles.task_evidence("wide_config_refactor", repo, "oak", binary)
|
| 306 | self.assertIs(verified["workflow_integrity_passed"], True, verified)
|
| 307 | self.assertNotEqual(evidence["oak_export_head"], verified["oak_export_head"])
|
| 308 |
|
| 309 | def git(self, repo, *args):
|
| 310 | result = subprocess.run(
|
| 311 | [shutil.which("git"), *args], cwd=repo, env=workflow_ab.base_env(),
|
| 312 | stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True,
|
| 313 | )
|
| 314 | self.assertEqual(result.returncode, 0, result.stderr)
|
| 315 |
|
| 316 | def test_correct_worktree_cannot_hide_partial_commit(self):
|
| 317 | for name, maker, finish, staged in (
|
| 318 | ("wide_config_refactor", workflow_ab.make_wide_config_fixture, finish_configs,
|
| 319 | "services/service-0000/config.toml"),
|
| 320 | ("large_asset_manifest", workflow_ab.make_large_asset_fixture, finish_assets, "manifest.json"),
|
| 321 | ):
|
| 322 | with self.subTest(name=name), tempfile.TemporaryDirectory() as tmp:
|
| 323 | repo = Path(tmp)
|
| 324 | maker(repo)
|
| 325 | self.git(repo, "init")
|
| 326 | self.git(repo, "add", ".")
|
| 327 | if name == "large_asset_manifest":
|
| 328 | self.git(repo, "rm", "--cached", "assets/asset-03.bin")
|
| 329 | self.git(repo, "commit", "-m", "initial")
|
| 330 | finish(repo)
|
| 331 | self.git(repo, "add", staged)
|
| 332 | self.git(repo, "commit", "-m", "partial task")
|
| 333 | self.assertIsNone(workflow_oracles.validate(name, repo))
|
| 334 | self.assertIsNotNone(workflow_oracles.validate_git_head(name, repo))
|
| 335 | subject = workflow_ab.Subject(name="git", kind="git", label="Git", bin=Path(shutil.which("git")))
|
| 336 | fields = workflow_ab.workflow_integrity_fields(subject, workflow_ab.WORKFLOWS[name], repo, [])
|
| 337 | self.assertFalse(fields["correctness_passed"])
|
| 338 | proc = agent_workflow.run_command(agent_workflow.test_command_for(workflow_ab.WORKFLOWS[name], subject), repo)
|
| 339 | self.assertEqual(proc.returncode, 1, proc.stderr)
|
| 340 | self.assertIn("git_head_", proc.stdout)
|
| 341 | self.git(repo, "add", ".")
|
| 342 | self.git(repo, "commit", "-m", "complete task")
|
| 343 | self.assertIsNone(workflow_oracles.validate_git_head(name, repo))
|
| 344 | proc = agent_workflow.run_command(agent_workflow.test_command_for(workflow_ab.WORKFLOWS[name], subject), repo)
|
| 345 | self.assertEqual(proc.returncode, 0, proc.stderr)
|
| 346 |
|
| 347 |
|
| 348 | class RealSubjectWorkflowOracleTest(unittest.TestCase):
|
| 349 | def test_mock_agent_config_and_asset_tasks_on_real_vcs(self):
|
| 350 | for kind in ("git", "oak"):
|
| 351 | binary = shutil.which(kind)
|
| 352 | if binary is None:
|
| 353 | with self.subTest(kind=kind):
|
| 354 | self.skipTest(f"{kind} not installed")
|
| 355 | continue
|
| 356 | for name in ("wide_config_refactor", "large_asset_manifest"):
|
| 357 | with self.subTest(kind=kind, name=name), tempfile.TemporaryDirectory() as tmp:
|
| 358 | root = Path(tmp)
|
| 359 | subject = workflow_ab.Subject(name=kind, kind=kind, label=kind, bin=Path(binary))
|
| 360 | workflow = workflow_ab.WORKFLOWS[name]
|
| 361 | fixture = workflow_ab.prepare_fixture(root, workflow)
|
| 362 | row = agent_workflow.run_one(
|
| 363 | agent=agent_workflow.AgentConfig(name="mock", adapter="deterministic_mock", provider="local",
|
| 364 | bin=None, model=None, version="test"),
|
| 365 | subject=subject, workflow=workflow, fixture=fixture, run_index=0,
|
| 366 | run_root=root / "runs", artifacts_root=root / "artifacts", timeout_seconds=300,
|
| 367 | track="agent-default", agent_environment="minimal", instruction_level="full-docs",
|
| 368 | bench_id="oracle-integration", timestamp_utc="2026-09-10T00:00:00Z", source={}, host_meta={},
|
| 369 | )
|
| 370 | self.assertTrue(row["success"], row.get("failure_reason"))
|
| 371 | self.assertEqual(agent_workflow.validate_row(row), [])
|
| 372 | self.assertIn(workflow_oracles.VERSION, row["scenario_version"])
|
| 373 | self.assertEqual(row["oracle_version"], workflow_oracles.VERSION)
|
| 374 | self.assertTrue(row["workflow_integrity_passed"])
|
| 375 | self.assertIn("git_head_instrument_sha256", row)
|
| 376 | from oakbench.populations import comparison_identity
|
| 377 | identity = comparison_identity(row)
|
| 378 | self.assertEqual(identity["oracle_version"], workflow_oracles.VERSION)
|
| 379 | self.assertEqual(identity["env_isolation_version"], agent_workflow.ENV_ISOLATION_VERSION)
|