commit d4321fc2df02ce2f65785d91361ffbd3bb7cc0d5
parent b3643e423e151f0db13c91a7c5d1f9ff211c64e4
Author: triesap <tyson@radroots.org>
Date: Mon, 21 Sep 2026 14:02:47 +0000
runtime: preserve and extend wire compatibility corpus
Diffstat:
4 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/tests/fixtures/hyf_v1_jev/wire/buyer_match_disabled.json b/tests/fixtures/hyf_v1_jev/wire/buyer_match_disabled.json
@@ -0,0 +1,6 @@
+{
+ "fixture_id": "buyer_match_disabled",
+ "capability": "buyer_request.match",
+ "request": "{\"version\":1,\"request_id\":\"wire-match-1\",\"capability\":\"buyer_request.match\",\"input\":{\"need\":{\"need_id\":\"n1\"},\"snapshots\":[]}}",
+ "expected_error_code": "capability_disabled"
+}
diff --git a/tests/fixtures/hyf_v1_jev/wire/farm_update_disabled.json b/tests/fixtures/hyf_v1_jev/wire/farm_update_disabled.json
@@ -0,0 +1,6 @@
+{
+ "fixture_id": "farm_update_disabled",
+ "capability": "farm_update.interpret",
+ "request": "{\"version\":1,\"request_id\":\"wire-farm-1\",\"capability\":\"farm_update.interpret\",\"input\":{\"source\":{\"source_id\":\"s1\",\"revision\":\"r1\",\"text\":\"x\",\"source_time\":\"2026-09-21T09:00:00-07:00\",\"timezone\":\"America/Vancouver\",\"actor_id\":\"a1\",\"farm_id\":\"f1\"}}}",
+ "expected_error_code": "capability_disabled"
+}
diff --git a/tests/fixtures/hyf_v1_jev/wire/manifest.json b/tests/fixtures/hyf_v1_jev/wire/manifest.json
@@ -0,0 +1,7 @@
+{
+ "schema_version": 1,
+ "spec_id": "hyf_v1_jev",
+ "family": "wire_compatibility",
+ "note": "Repo-local wire frames for the new gated operations. The shared-wire mirror tests/fixtures/v1 remains unchanged.",
+ "scenarios": ["farm_update_disabled.json", "buyer_match_disabled.json"]
+}
diff --git a/tests/test_persistent_stdio.mojo b/tests/test_persistent_stdio.mojo
@@ -109,3 +109,23 @@ def test_buyer_match_operation_is_gated_until_enabled() raises:
frames.append(request)
var responses = run_stdio_session(frames, context)
assert_true(responses[0].find("capability_disabled") >= 0)
+
+
+from fixture_loader import load_fixture_json_file as _load_fixture_json
+from std.pathlib import Path as _Path, _dir_of_current_file as _dir_of
+
+
+def test_new_operation_wire_frames_are_gated() raises:
+ var wire_dir = _dir_of() / "fixtures" / "hyf_v1_jev" / "wire"
+ var manifest = _load_fixture_json(wire_dir / "manifest.json")
+ assert_equal(manifest["spec_id"].string_value(), "hyf_v1_jev")
+ with TemporaryDirectory() as temp_dir:
+ var context = _context(temp_dir)
+ for name in manifest["scenarios"].array_items():
+ var scenario = _load_fixture_json(wire_dir / name.string_value())
+ var frames = List[String]()
+ frames.append(scenario["request"].string_value())
+ var responses = run_stdio_session(frames, context)
+ assert_true(
+ responses[0].find(scenario["expected_error_code"].string_value()) >= 0
+ )