From 170d085cf0b9dbf3b1ce7460b84fffb5a4909eab Mon Sep 17 00:00:00 2001 From: Brett Heap <1513478+brettheap@users.noreply.github.com> Date: Tue, 6 Oct 2026 19:00:03 +0000 Subject: [PATCH 1/2] T096: the contract family's tests read the composed farm where the run is composed (plan 038; T094's map R2-INV-R9, CS) The four contracts-only files took Path(__file__).parents[2] as openxFactory's root. Composed, that is the directory above the checkout, so T094 measured all 74 of their nodes red composed (11, 13, 32 and 18). Where the run is composed, tests/conftest.py (T095) names the family's composed farm CONTRACTS_DIR. SCHEMAS, EXAMPLES and REGISTER_SCHEMA now read that farm, with the examples beside it, and SCRIPT is this leg's own validator, which reads the same farm. In a lone checkout CONTRACTS_DIR is None and every path is what it was, so each file still fails alone for its declared reason, openxfactory-contracts. One docstring's account of SCRIPT is brought up to date. Lane: openXfactory-3 Co-Authored-By: Claude Opus 5.5 --- tests/test_project_action_contracts.py | 16 ++++++++-- tests/test_project_schema_election.py | 14 ++++++-- ...t_validate_ideation_dashboard_contracts.py | 32 +++++++++++++------ tests/test_wheel_action_contracts.py | 16 ++++++++-- 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/tests/test_project_action_contracts.py b/tests/test_project_action_contracts.py index ec84d3c..0562e82 100644 --- a/tests/test_project_action_contracts.py +++ b/tests/test_project_action_contracts.py @@ -14,10 +14,20 @@ import pytest import yaml -ROOT = Path(__file__).resolve().parents[2] +from conftest import CONTRACTS_DIR + +# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map, +# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's +# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads +# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths +# openxFactory's tree kept, above the checkout: this file's declared reason, +# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it. +_COMPOSED = CONTRACTS_DIR is not None +ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2] SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py" -SCHEMAS = ROOT / "contracts" / "schemas" -EXAMPLES = ROOT / "examples" / "ideation-dashboard" +CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts" +SCHEMAS = CONTRACTS / "schemas" +EXAMPLES = CONTRACTS.parent / "examples" / "ideation-dashboard" INTENT_SCHEMA = SCHEMAS / "gate-intent.schema.yaml" ACTION_SCHEMA = SCHEMAS / "gate-action-record.schema.yaml" diff --git a/tests/test_project_schema_election.py b/tests/test_project_schema_election.py index bf6d53b..8955b43 100644 --- a/tests/test_project_schema_election.py +++ b/tests/test_project_schema_election.py @@ -24,9 +24,19 @@ import pytest import yaml -ROOT = Path(__file__).resolve().parents[2] +from conftest import CONTRACTS_DIR + +# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map, +# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's +# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads +# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths +# openxFactory's tree kept, above the checkout: this file's declared reason, +# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it. +_COMPOSED = CONTRACTS_DIR is not None +ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2] SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py" -REGISTER_SCHEMA = ROOT / "contracts" / "schemas" / "project-register.schema.yaml" +CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts" +REGISTER_SCHEMA = CONTRACTS / "schemas" / "project-register.schema.yaml" def _load_module(): diff --git a/tests/test_validate_ideation_dashboard_contracts.py b/tests/test_validate_ideation_dashboard_contracts.py index e90ca15..1b7ee3b 100644 --- a/tests/test_validate_ideation_dashboard_contracts.py +++ b/tests/test_validate_ideation_dashboard_contracts.py @@ -25,10 +25,20 @@ import pytest import yaml -ROOT = Path(__file__).resolve().parents[2] +from conftest import CONTRACTS_DIR + +# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map, +# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's +# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads +# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths +# openxFactory's tree kept, above the checkout: this file's declared reason, +# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it. +_COMPOSED = CONTRACTS_DIR is not None +ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2] SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py" -SCHEMAS = ROOT / "contracts" / "schemas" -EXAMPLES = ROOT / "examples" / "ideation-dashboard" +CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts" +SCHEMAS = CONTRACTS / "schemas" +EXAMPLES = CONTRACTS.parent / "examples" / "ideation-dashboard" NEGATIVE = EXAMPLES / "negative" CATALOG_SCHEMA = SCHEMAS / "xfactory-workbench-model-catalog.schema.yaml" @@ -376,13 +386,15 @@ def test_every_schema_the_consumer_validates_is_on_disk(): kind's only where the running tree supplies it. THE VALIDATOR IS THE INSTALLED DISTRIBUTION'S, never this module's own - `SCRIPT`, whose `ROOT` is the carve's `parents[2]`, above the checkout - (V2-10): it is the one `openxdox.snapshot.find_validator` answers, and its - sources are the ones it reports (`schema_sources`). In a lone install its - tree carries no `contracts/`, so the three come from the distribution's - packaged copies, each held to `copies.yaml`'s digest. This module's - fixtures are not used: they read openxFactory's tree, which is why the file - is declared under `openxfactory-contracts`, and F7.1 runs this case by node + `SCRIPT`, which a lone checkout looks for at the carve's `parents[2]`, + above the checkout (V2-10), and a composed run takes from this leg to read + the farm CONTRACTS_DIR names: it is the one + `openxdox.snapshot.find_validator` answers, and its sources are the ones it + reports (`schema_sources`). In a lone install its tree carries no + `contracts/`, so the three come from the distribution's packaged copies, + each held to `copies.yaml`'s digest. This module's fixtures are not used: + in a lone checkout they read openxFactory's tree, which is why the file is + declared under `openxfactory-contracts`, and F7.1 runs this case by node id.""" from openxdox import contracts, snapshot diff --git a/tests/test_wheel_action_contracts.py b/tests/test_wheel_action_contracts.py index 6b748ea..0df2cc9 100644 --- a/tests/test_wheel_action_contracts.py +++ b/tests/test_wheel_action_contracts.py @@ -9,10 +9,20 @@ import pytest import yaml -ROOT = Path(__file__).resolve().parents[2] +from conftest import CONTRACTS_DIR + +# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map, +# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's +# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads +# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths +# openxFactory's tree kept, above the checkout: this file's declared reason, +# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it. +_COMPOSED = CONTRACTS_DIR is not None +ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2] SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py" -SCHEMAS = ROOT / "contracts" / "schemas" -EXAMPLES = ROOT / "examples" / "ideation-dashboard" +CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts" +SCHEMAS = CONTRACTS / "schemas" +EXAMPLES = CONTRACTS.parent / "examples" / "ideation-dashboard" NEGATIVE = EXAMPLES / "negative" INTENT_SCHEMA = SCHEMAS / "gate-intent.schema.yaml" From 98739e8807eac135a10f1c01d98df68c286eeac0 Mon Sep 17 00:00:00 2001 From: Brett Heap <1513478+brettheap@users.noreply.github.com> Date: Tue, 6 Oct 2026 23:29:00 +0000 Subject: [PATCH 2/2] T096: the consumer-validator test's docstring tells the composed source-tree case from the lone one (Copilot r4201041192) Run from this source tree, snapshot.find_validator() answers this checkout's scripts/validate-ideation-dashboard-contracts.py, which is the module's SCRIPT where the run is composed and not where it is lone. The docstring said "never SCRIPT", so it now states each case. Docstring only; no behaviour changes. Lane: openXfactory-3 Co-Authored-By: Claude Opus 5.5 --- ...t_validate_ideation_dashboard_contracts.py | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/test_validate_ideation_dashboard_contracts.py b/tests/test_validate_ideation_dashboard_contracts.py index 1b7ee3b..6e34c37 100644 --- a/tests/test_validate_ideation_dashboard_contracts.py +++ b/tests/test_validate_ideation_dashboard_contracts.py @@ -385,17 +385,18 @@ def test_every_schema_the_consumer_validates_is_on_disk(): schema THIS INSTALL validates is on disk, its own three always, and another kind's only where the running tree supplies it. - THE VALIDATOR IS THE INSTALLED DISTRIBUTION'S, never this module's own - `SCRIPT`, which a lone checkout looks for at the carve's `parents[2]`, - above the checkout (V2-10), and a composed run takes from this leg to read - the farm CONTRACTS_DIR names: it is the one + THE VALIDATOR IS THE INSTALLED DISTRIBUTION'S, the one `openxdox.snapshot.find_validator` answers, and its sources are the ones it - reports (`schema_sources`). In a lone install its tree carries no - `contracts/`, so the three come from the distribution's packaged copies, - each held to `copies.yaml`'s digest. This module's fixtures are not used: - in a lone checkout they read openxFactory's tree, which is why the file is - declared under `openxfactory-contracts`, and F7.1 runs this case by node - id.""" + reports (`schema_sources`). Run from this source tree, it is this + checkout's `scripts/validate-ideation-dashboard-contracts.py`. Where the + run is composed that is this module's `SCRIPT` too. In a lone checkout it + is not, because there `SCRIPT` is looked for at the carve's `parents[2]`, + above the checkout (V2-10). Run from an install, it is the packaged + validator. In a lone install its tree carries no `contracts/`, so the three + come from the distribution's packaged copies, each held to `copies.yaml`'s + digest. This module's fixtures are not used: in a lone checkout they read + openxFactory's tree, which is why the file is declared under + `openxfactory-contracts`, and F7.1 runs this case by node id.""" from openxdox import contracts, snapshot validator = snapshot.find_validator()