Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions tests/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from harel.validator import schema as bundled_schema

from .harness import (
SUITE_DIR,
SPEC_DIR,
SUPPORTED,
cli_cases,
engine_cases,
Expand Down Expand Up @@ -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()


Expand Down
1 change: 1 addition & 0 deletions vendor/harel-conformance
Submodule harel-conformance added at dd61c0
Loading