From d418a6f531c239dcc623634004742051f38eda8f Mon Sep 17 00:00:00 2001 From: Christian-Manuel Butzke Date: Tue, 30 Jun 2026 18:31:22 +0900 Subject: [PATCH] tests: source conformance from harel-conformance submodule The cross-language conformance suite moved to fruwehq/harel-conformance. Add it as vendor/harel-conformance and load engine cases, cli cases, and the black-box run_cli.py from there. Keep vendor/harel pinned solely for the schema-drift check (bundled machine.schema.json vs the spec repo's). Closes #18. --- .gitmodules | 3 +++ README.md | 14 ++++++++------ tests/harness.py | 8 +++++--- tests/test_conformance.py | 6 +++--- vendor/harel-conformance | 1 + 5 files changed, 20 insertions(+), 12 deletions(-) create mode 160000 vendor/harel-conformance diff --git a/.gitmodules b/.gitmodules index c962f48..74e4047 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "vendor/harel"] path = vendor/harel url = https://github.com/fruwehq/harel.git +[submodule "vendor/harel-conformance"] + path = vendor/harel-conformance + url = https://github.com/fruwehq/harel-conformance.git diff --git a/README.md b/README.md index e38bb84..8d46f6a 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,13 @@ the build order in [issue #3][issue]. ## Conformance suite -The normative `SPEC.md`, JSON Schema, and cross-language **conformance suite** -are consumed as a pinned git submodule at [`vendor/harel`](vendor/harel) -(single source of truth — no copy-paste drift). The harness lives in `tests/` -and discovers `conformance/*/` from there. This repository is correct **iff it -passes the suite**. +The cross-language **conformance suite** is consumed as a pinned git submodule at +[`vendor/harel-conformance`](vendor/harel-conformance) (single source of truth — no +copy-paste drift); the harness in `tests/` discovers `conformance/*/` from there. The +normative `SPEC.md` and JSON Schema live in +[`fruwehq/harel`](https://github.com/fruwehq/harel), pinned at +[`vendor/harel`](vendor/harel) solely for the schema-drift check. This repository is +correct **iff it passes the suite**. ## Scope (per the spec) - Load and validate machine YAML against `schema/machine.schema.json`, parsed under @@ -80,7 +82,7 @@ error types. See [`tests/test_library_api.py`](tests/test_library_api.py). ## Develop ``` -git submodule update --init # fetch the conformance suite +git submodule update --init # fetch the conformance suite + schema (two submodules) python -m venv .venv && . .venv/bin/activate pip install -e '.[dev]' ruff check . && mypy src/harel && pytest diff --git a/tests/harness.py b/tests/harness.py index e135efd..fb0c6f3 100644 --- a/tests/harness.py +++ b/tests/harness.py @@ -18,8 +18,10 @@ from harel import Host REPO_ROOT = Path(__file__).resolve().parent.parent -SUITE_DIR = REPO_ROOT / "vendor" / "harel" -CONFORMANCE_DIR = SUITE_DIR / "conformance" +# The spec repo (fruwehq/harel) is pinned only for the schema-drift check; the +# language-agnostic conformance suite lives in fruwehq/harel-conformance. +SPEC_DIR = REPO_ROOT / "vendor" / "harel" +CONFORMANCE_DIR = REPO_ROOT / "vendor" / "harel-conformance" / "conformance" # Cases the engine is known to pass. Others are skipped until their features # land; extend this set as build-order steps are completed. @@ -123,7 +125,7 @@ def run_cli_case(case_dir: Path) -> None: def _load_cli_runner() -> ModuleType: - path = SUITE_DIR / "conformance" / "run_cli.py" + path = CONFORMANCE_DIR / "run_cli.py" spec = importlib.util.spec_from_file_location("harel_cli_runner", path) assert spec is not None and spec.loader is not None, f"runner not found: {path}" mod = importlib.util.module_from_spec(spec) diff --git a/tests/test_conformance.py b/tests/test_conformance.py index 8f037b4..471b849 100644 --- a/tests/test_conformance.py +++ b/tests/test_conformance.py @@ -21,7 +21,7 @@ from harel.validator import schema as bundled_schema from .harness import ( - SUITE_DIR, + SPEC_DIR, SUPPORTED, cli_cases, engine_cases, @@ -52,8 +52,8 @@ def test_machine_file_loads_and_validates(path: Path) -> None: def test_bundled_schema_matches_submodule() -> None: """The engine's bundled schema must equal the spec repo's schema (no drift).""" - upstream = SUITE_DIR / "schema" / "machine.schema.json" - assert upstream.exists(), "harel submodule not initialized" + upstream = SPEC_DIR / "schema" / "machine.schema.json" + assert upstream.exists(), "harel (spec) submodule not initialized" assert json.loads(upstream.read_text(encoding="utf-8")) == bundled_schema() diff --git a/vendor/harel-conformance b/vendor/harel-conformance new file mode 160000 index 0000000..dd61c00 --- /dev/null +++ b/vendor/harel-conformance @@ -0,0 +1 @@ +Subproject commit dd61c0051b9d7164b9eeaf95d9109d1a3eb2ef0b