From c22c00b7a69b38feb60bcfa5deea81cf86ef8cf8 Mon Sep 17 00:00:00 2001 From: km Date: Tue, 15 Sep 2026 08:58:07 +0900 Subject: [PATCH] fix(core-spec): drop root-level dialects and vendors from the schema The two arrays were added to the document root by the Sigma converter change, with no definition in spec.md and nothing reading them. Take them back out, stop the Sigma converter from emitting them, and add a validator test so the root shape is covered by the validation workflow. Generated-by: Claude Code --- .../sigma/src/ossie_sigma/sigma_to_ossie.py | 6 +----- core-spec/ossie-schema.json | 14 -------------- validation/test_validate.py | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/converters/sigma/src/ossie_sigma/sigma_to_ossie.py b/converters/sigma/src/ossie_sigma/sigma_to_ossie.py index b108ebb6..b2fff4bf 100644 --- a/converters/sigma/src/ossie_sigma/sigma_to_ossie.py +++ b/converters/sigma/src/ossie_sigma/sigma_to_ossie.py @@ -458,9 +458,5 @@ def convert(self, spec: dict[str, Any]) -> ConverterResult[OssieDocument]: custom_extensions=[_vendor_ext(model_ext)] if model_ext else None, ) - document = OssieDocument( - dialects=[OssieDialect.ANSI_SQL, OssieDialect.SIGMA], - vendors=[OssieVendor.SIGMA], - semantic_model=[semantic_model], - ) + document = OssieDocument(semantic_model=[semantic_model]) return ConverterResult(output=document, issues=issues) diff --git a/core-spec/ossie-schema.json b/core-spec/ossie-schema.json index 4e50f1ee..f20f0e92 100644 --- a/core-spec/ossie-schema.json +++ b/core-spec/ossie-schema.json @@ -16,20 +16,6 @@ "items": { "$ref": "#/$defs/SemanticModel" } - }, - "dialects": { - "type": "array", - "description": "Dialects used anywhere in this document", - "items": { - "$ref": "#/$defs/Dialect" - } - }, - "vendors": { - "type": "array", - "description": "Vendors with custom_extensions present anywhere in this document", - "items": { - "$ref": "#/$defs/Vendor" - } } }, "required": ["version", "semantic_model"], diff --git a/validation/test_validate.py b/validation/test_validate.py index 339396a4..156022a4 100644 --- a/validation/test_validate.py +++ b/validation/test_validate.py @@ -333,6 +333,23 @@ def test_valid_model_still_passes(self): self.assertEqual(result.returncode, 0) self.assertIn("Validation PASSED", result.stdout) + def test_root_dialects_and_vendors_are_rejected(self): + # The document root is version and semantic_model only; the dialect and + # vendor enumerations belong under expression.dialects and custom_extensions. + result = self.run_validator( + "version: 0.2.0.dev0\n" + "dialects: [ANSI_SQL]\n" + "vendors: [DBT]\n" + "semantic_model:\n" + " - name: sales\n" + " datasets:\n" + " - name: orders\n" + " source: analytics.orders\n" + ) + + self.assertEqual(result.returncode, 1) + self.assertIn("'dialects', 'vendors' were unexpected", result.stdout) + if __name__ == "__main__": unittest.main()