Download OFF_DataQuality/results/engine_comparison.json from offCanada/Final_Deliverables: direct link, hf CLI and curl.
- Browser
- Download file 123 kB
-
https://huggingface.co/datasets/offCanada/Final_Deliverables/resolve/main/OFF_DataQuality/results/engine_comparison.json
- Command line
-
hf download hf://datasets/offCanada/Final_Deliverables/OFF_DataQuality/results/engine_comparison.json
-
curl -L -o engine_comparison.json https://huggingface.co/datasets/offCanada/Final_Deliverables/resolve/main/OFF_DataQuality/results/engine_comparison.json
123 kB
| { | |
| "generated_at_utc": "2026-03-20T02:16:51.454190+00:00", | |
| "comparison_fingerprint": { | |
| "comparison_run_id": "comparison_20260320T021651454190p0000_802895b4", | |
| "comparison_sha256": "5e38ef21823aded9830415be43d4189df6c1b7facaa3942d11746129d5cbec94", | |
| "engine_run_ids": { | |
| "python": "parity_20260320T020923217791p0000_522963ec", | |
| "dbt": "parity_20260320T021319241433p0000_babb0a3c", | |
| "soda": "parity_20260320T021651369626p0000_93e7e9a5" | |
| }, | |
| "dataset_fingerprint_sha256_by_engine": { | |
| "python": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76", | |
| "dbt": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76", | |
| "soda": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76" | |
| }, | |
| "rulepack_fingerprint_sha256_by_engine": { | |
| "python": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149", | |
| "dbt": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149", | |
| "soda": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149" | |
| }, | |
| "dataset_fingerprint_consistent": true, | |
| "rulepack_fingerprint_consistent": true, | |
| "dataset_fingerprint_sha256": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76", | |
| "rulepack_fingerprint_sha256": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149", | |
| "code_commit": "fdda1c042a421a0dd81a90c7ca692dccb4915106", | |
| "code_commits_by_engine": { | |
| "python": "fdda1c042a421a0dd81a90c7ca692dccb4915106", | |
| "dbt": "fdda1c042a421a0dd81a90c7ca692dccb4915106", | |
| "soda": "fdda1c042a421a0dd81a90c7ca692dccb4915106" | |
| } | |
| }, | |
| "comparison_method": { | |
| "best_engine_ranking": "Prefer MATCH status, then fewer mismatches, then higher effective_confidence. effective_confidence = overall_confidence * provider_factor.", | |
| "decision_score": "decision_score = effective_confidence + architecture_bonus(declarative for simple rules / python for complex rules) - mismatch_penalty - review_penalty.", | |
| "hybrid_tie_break": "If python and best declarative engine are close (within 0.20 effective confidence): prefer declarative for declarative-friendly rules, prefer python for non-declarative rules.", | |
| "declarative_tie_break": "When dbt and soda are exactly tied on status/mismatches/scores for a rule, use a stable hash of rule_name to select dbt or soda explicitly.", | |
| "provider_factor_notes": { | |
| "python_real_llm": 1.0, | |
| "python_simulated_fallback": 0.55, | |
| "dbt_sql_fallback": 0.85, | |
| "soda_cloud": 1.0, | |
| "soda_sql_fallback": 0.85 | |
| } | |
| }, | |
| "dataset": { | |
| "jsonl_path": "C:\\dev\\OFF_DataQuality_Prototype\\data\\sample_products.jsonl", | |
| "duckdb_path": "C:\\dev\\OFF_DataQuality_Prototype\\off_quality.db", | |
| "products_tested": 400, | |
| "source_jsonl": "C:\\dev\\OFF_DataQuality_Prototype\\openfoodfacts-products.jsonl", | |
| "perl_rules_source": "inline_legacy_rules", | |
| "execution_engine": "python", | |
| "soda_mode": "cloud", | |
| "profile": "hybrid", | |
| "profile_rule_count": 19, | |
| "dataset_fingerprint_sha256": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76", | |
| "rulepack_fingerprint_sha256": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149" | |
| }, | |
| "engines": [ | |
| "python", | |
| "dbt", | |
| "soda" | |
| ], | |
| "engine_run_fingerprints": { | |
| "python": { | |
| "run_id": "parity_20260320T020923217791p0000_522963ec", | |
| "generated_at_utc": "2026-03-20T02:09:23.217791+00:00", | |
| "execution_engine": "python", | |
| "soda_mode": "cloud", | |
| "llm_provider": "groq", | |
| "llm_model": "openai/gpt-oss-120b", | |
| "code_commit": "fdda1c042a421a0dd81a90c7ca692dccb4915106", | |
| "dataset_fingerprint": { | |
| "source_mode": "off_jsonl", | |
| "source_jsonl": "C:\\dev\\OFF_DataQuality_Prototype\\openfoodfacts-products.jsonl", | |
| "requested_size": 400, | |
| "products_tested": 400, | |
| "seed": null, | |
| "product_id_first": "0000101209159", | |
| "product_id_last": "0008295663177", | |
| "sha256": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76" | |
| }, | |
| "rulepack_fingerprint": { | |
| "profile": "hybrid", | |
| "rule_count": 19, | |
| "rule_names_sha256": "c39c2b95539ad714a422b372ca37457381efad3eab0ab3cf6183fb84e78799b2", | |
| "rule_ir_sha256": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149" | |
| } | |
| }, | |
| "dbt": { | |
| "run_id": "parity_20260320T021319241433p0000_babb0a3c", | |
| "generated_at_utc": "2026-03-20T02:13:19.241433+00:00", | |
| "execution_engine": "dbt", | |
| "soda_mode": "cloud", | |
| "llm_provider": "groq", | |
| "llm_model": "openai/gpt-oss-120b", | |
| "code_commit": "fdda1c042a421a0dd81a90c7ca692dccb4915106", | |
| "dataset_fingerprint": { | |
| "source_mode": "off_jsonl", | |
| "source_jsonl": "C:\\dev\\OFF_DataQuality_Prototype\\openfoodfacts-products.jsonl", | |
| "requested_size": 400, | |
| "products_tested": 400, | |
| "seed": null, | |
| "product_id_first": "0000101209159", | |
| "product_id_last": "0008295663177", | |
| "sha256": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76" | |
| }, | |
| "rulepack_fingerprint": { | |
| "profile": "hybrid", | |
| "rule_count": 19, | |
| "rule_names_sha256": "c39c2b95539ad714a422b372ca37457381efad3eab0ab3cf6183fb84e78799b2", | |
| "rule_ir_sha256": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149" | |
| } | |
| }, | |
| "soda": { | |
| "run_id": "parity_20260320T021651369626p0000_93e7e9a5", | |
| "generated_at_utc": "2026-03-20T02:16:51.369626+00:00", | |
| "execution_engine": "soda", | |
| "soda_mode": "cloud", | |
| "llm_provider": "groq", | |
| "llm_model": "openai/gpt-oss-120b", | |
| "code_commit": "fdda1c042a421a0dd81a90c7ca692dccb4915106", | |
| "dataset_fingerprint": { | |
| "source_mode": "off_jsonl", | |
| "source_jsonl": "C:\\dev\\OFF_DataQuality_Prototype\\openfoodfacts-products.jsonl", | |
| "requested_size": 400, | |
| "products_tested": 400, | |
| "seed": null, | |
| "product_id_first": "0000101209159", | |
| "product_id_last": "0008295663177", | |
| "sha256": "edc06c70fc61d470398d05743822716e42722100fe4f1dcb721aff4895aabd76" | |
| }, | |
| "rulepack_fingerprint": { | |
| "profile": "hybrid", | |
| "rule_count": 19, | |
| "rule_names_sha256": "c39c2b95539ad714a422b372ca37457381efad3eab0ab3cf6183fb84e78799b2", | |
| "rule_ir_sha256": "ceec8ffe16d3fc6fd32744c834c7a34068b108a398f12c9abf86da0f5a390149" | |
| } | |
| } | |
| }, | |
| "per_engine_summary": { | |
| "python": { | |
| "rules": 19, | |
| "passed": 19, | |
| "avg_overall_confidence": 0.2826, | |
| "avg_effective_confidence": 0.2826, | |
| "avg_parity_ci_lower": 0.9905, | |
| "avg_equivalence_rate": 1.0, | |
| "avg_mutation_score": 0.6053, | |
| "fallback_rules": 0, | |
| "real_llm_rules": 19, | |
| "real_llm_rate": 1.0, | |
| "repairs_applied": 0 | |
| }, | |
| "dbt": { | |
| "rules": 19, | |
| "passed": 19, | |
| "avg_overall_confidence": 0.2946, | |
| "avg_effective_confidence": 0.2946, | |
| "avg_parity_ci_lower": 0.9905, | |
| "avg_equivalence_rate": 1.0, | |
| "avg_mutation_score": 1.0, | |
| "fallback_rules": 0 | |
| }, | |
| "soda": { | |
| "rules": 19, | |
| "passed": 19, | |
| "avg_overall_confidence": 0.2946, | |
| "avg_effective_confidence": 0.2946, | |
| "avg_parity_ci_lower": 0.9905, | |
| "avg_equivalence_rate": 1.0, | |
| "avg_mutation_score": 1.0, | |
| "fallback_rules": 0 | |
| } | |
| }, | |
| "per_complexity_summary": { | |
| "simple": { | |
| "rules": 9, | |
| "python_wins": 0, | |
| "dbt_wins": 5, | |
| "soda_wins": 4, | |
| "avg_best_effective_confidence": 0.4464 | |
| }, | |
| "medium": { | |
| "rules": 6, | |
| "python_wins": 0, | |
| "dbt_wins": 4, | |
| "soda_wins": 2, | |
| "avg_best_effective_confidence": 0.2306 | |
| }, | |
| "intricate": { | |
| "rules": 4, | |
| "python_wins": 4, | |
| "dbt_wins": 0, | |
| "soda_wins": 0, | |
| "avg_best_effective_confidence": 0.0446 | |
| } | |
| }, | |
| "rule_comparison": [ | |
| { | |
| "rule_name": "ca_allergen_evidence_missing_ingredients_text", | |
| "tag": "ca-allergen-evidence-but-missing-ingredients-text", | |
| "severity": "warning", | |
| "condition": "allergen_evidence_present > 0.0 && ingredients_text_present == 0.0", | |
| "jurisdiction": "ca", | |
| "profile_tags": [ | |
| "canada", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "statutory_proxy", | |
| "legal_citation": "FDR B.01.010.1(2); FDR B.01.010.3", | |
| "source_url": "https://laws-lois.justice.gc.ca/eng/regulations/C.R.C.,_c._870/section-B.01.010.1.html", | |
| "effective_date": "2012-08-04", | |
| "review_status": "draft", | |
| "reviewer": "pending-mentor-review", | |
| "required_fields": [ | |
| "allergen_evidence_present", | |
| "ingredients_text_present", | |
| "ingredients_text" | |
| ], | |
| "exemption_logic": "Proxy check: flags records with allergen evidence but no ingredient text present.", | |
| "rule_notes": "Phase-1 Canada allergen rule using OFF-available proxy fields.", | |
| "rule_ir_hash": "89636a09e83b", | |
| "condition_type": "compound_threshold_and", | |
| "complexity": "medium", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "soda", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-odd->soda", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2015, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 2, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2015, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.3015, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_ca_allergen_evidence_missing_ingredients_text(product):\n \"\"\"\n Returns the rule tag if allergen evidence is present (>0) while ingredients text is missing (==0).\n Returns None otherwise or if required fields are missing/non-numeric.\n \"\"\"\n tag = \"ca-allergen-evidence-but-missing-ingredients-text\"\n\n allergen_val = product.get(\"allergen_evidence_present\")\n ingredients_val = product.get(\"ingredients_text_present\")\n\n # If either value is missing or not a number, do not flag a violation\n if allergen_val is None or ingredients_val is None:\n return None\n if not isinstance(allergen_val, (int, float)) or not isinstance(ingredients_val, (int, float)):\n return None\n\n if allergen_val > 0.0 and ingredients_val == 0.0:\n return tag\n return None", | |
| "conversion_lines": 19, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2193, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2193, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.2543, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE allergen_evidence_present > 0.0 AND ingredients_text_present == 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2193, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2193, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.2543, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: ca_allergen_evidence_missing_ingredients_text\n expression: allergen_evidence_present > 0.0 AND ingredients_text_present == 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "ca_contains_statement_without_allergen_evidence", | |
| "tag": "ca-contains-statement-without-allergen-evidence", | |
| "severity": "warning", | |
| "condition": "contains_statement_present > 0.0 && allergen_evidence_present == 0.0", | |
| "jurisdiction": "ca", | |
| "profile_tags": [ | |
| "canada", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "statutory_proxy", | |
| "legal_citation": "FDR B.01.010.3(1)(b), (2)", | |
| "source_url": "https://laws-lois.justice.gc.ca/eng/regulations/C.R.C.,_c._870/section-B.01.010.3.html", | |
| "effective_date": "2012-08-04", | |
| "review_status": "draft", | |
| "reviewer": "pending-mentor-review", | |
| "required_fields": [ | |
| "contains_statement_present", | |
| "allergen_evidence_present" | |
| ], | |
| "exemption_logic": "Proxy check: 'contains' proxy without allergen evidence proxy.", | |
| "rule_notes": "Phase-1 Canada allergen consistency rule.", | |
| "rule_ir_hash": "224946da0a1f", | |
| "condition_type": "compound_threshold_and", | |
| "complexity": "medium", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0451, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 2, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0451, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1451, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_ca_contains_statement_without_allergen_evidence(product: dict):\n tag = \"ca-contains-statement-without-allergen-evidence\"\n cs = product.get(\"contains_statement_present\")\n ae = product.get(\"allergen_evidence_present\")\n # If either value is missing or not numeric, do not flag\n if cs is None or ae is None:\n return None\n if not isinstance(cs, (int, float)) or not isinstance(ae, (int, float)):\n return None\n if cs > 0.0 and ae == 0.0:\n return tag\n return None", | |
| "conversion_lines": 12, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE contains_statement_present > 0.0 AND allergen_evidence_present == 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: ca_contains_statement_without_allergen_evidence\n expression: contains_statement_present > 0.0 AND allergen_evidence_present == 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "ca_fop_required_but_symbol_missing", | |
| "tag": "ca-fop-required-but-symbol-missing", | |
| "severity": "error", | |
| "condition": "fop_threshold_exceeded > 0.0 && fop_symbol_present == 0.0 && fop_exempt_proxy == 0.0 && product_is_prepackaged_proxy > 0.0", | |
| "jurisdiction": "ca", | |
| "profile_tags": [ | |
| "canada", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "statutory_proxy", | |
| "legal_citation": "FDR B.01.350(1)", | |
| "source_url": "https://laws-lois.justice.gc.ca/eng/regulations/C.R.C.,_c._870/section-B.01.350.html", | |
| "effective_date": "2026-01-01", | |
| "review_status": "draft", | |
| "reviewer": "pending-mentor-review", | |
| "required_fields": [ | |
| "fop_threshold_exceeded", | |
| "fop_symbol_present", | |
| "fop_exempt_proxy", | |
| "product_is_prepackaged_proxy" | |
| ], | |
| "exemption_logic": "Applies only when proxy not exempt and prepackaged proxy is true.", | |
| "rule_notes": "Phase-1 Canada FOP threshold-vs-symbol proxy.", | |
| "rule_ir_hash": "6a505be71205", | |
| "condition_type": "compound_threshold_and", | |
| "complexity": "medium", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.8902, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 2, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.8902, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.9902, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_ca_fop_required_but_symbol_missing(product):\n \"\"\"\n Returns the rule tag \"ca-fop-required-but-symbol-missing\" if the compound condition is met,\n otherwise returns None.\n \"\"\"\n # Extract required fields\n fop_threshold_exceeded = product.get(\"fop_threshold_exceeded\")\n fop_symbol_present = product.get(\"fop_symbol_present\")\n fop_exempt_proxy = product.get(\"fop_exempt_proxy\")\n product_is_prepackaged_proxy = product.get(\"product_is_prepackaged_proxy\")\n\n # If any required field is missing or not a number, do not flag a violation\n for value in (\n fop_threshold_exceeded,\n fop_symbol_present,\n fop_exempt_proxy,\n product_is_prepackaged_proxy,\n ):\n if value is None:\n return None\n if not isinstance(value, (int, float)):\n return None\n\n # Evaluate the compound condition\n if (\n fop_threshold_exceeded > 0.0\n and fop_symbol_present == 0.0\n and fop_exempt_proxy == 0.0\n and product_is_prepackaged_proxy > 0.0\n ):\n return \"ca-fop-required-but-symbol-missing\"\n\n return None", | |
| "conversion_lines": 33, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.9684, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.9684, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 1.0034, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE fop_threshold_exceeded > 0.0 AND fop_symbol_present == 0.0 AND fop_exempt_proxy == 0.0 AND product_is_prepackaged_proxy > 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.9684, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.9684, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 1.0034, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: ca_fop_required_but_symbol_missing\n expression: fop_threshold_exceeded > 0.0 AND fop_symbol_present == 0.0 AND fop_exempt_proxy == 0.0 AND product_is_prepackaged_proxy > 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "ca_fop_symbol_present_but_not_required", | |
| "tag": "ca-fop-symbol-present-but-not-required", | |
| "severity": "warning", | |
| "condition": "fop_symbol_present > 0.0 && fop_threshold_exceeded == 0.0 && fop_exempt_proxy == 0.0 && product_is_prepackaged_proxy > 0.0", | |
| "jurisdiction": "ca", | |
| "profile_tags": [ | |
| "canada", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "guidance_proxy", | |
| "legal_citation": "FDR B.01.350; CFIA FOP guidance", | |
| "source_url": "https://inspection.canada.ca/en/food-labels/labelling/industry/nutrition-labelling/fop-nutrition-symbol", | |
| "effective_date": "2026-01-01", | |
| "review_status": "draft", | |
| "reviewer": "pending-mentor-review", | |
| "required_fields": [ | |
| "fop_threshold_exceeded", | |
| "fop_symbol_present", | |
| "fop_exempt_proxy", | |
| "product_is_prepackaged_proxy" | |
| ], | |
| "exemption_logic": "Proxy warning for symbol present when threshold proxy not exceeded and not exempt.", | |
| "rule_notes": "Phase-1 Canada FOP over-labelling consistency rule.", | |
| "rule_ir_hash": "4d20f5612a17", | |
| "condition_type": "compound_threshold_and", | |
| "complexity": "medium", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0451, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 2, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0451, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1451, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_ca_fop_symbol_present_but_not_required(product: dict):\n tag = \"ca-fop-symbol-present-but-not-required\"\n # Required fields\n fields = [\"fop_symbol_present\", \"fop_threshold_exceeded\", \"fop_exempt_proxy\", \"product_is_prepackaged_proxy\"]\n values = {}\n for f in fields:\n v = product.get(f, None)\n # Missing field rule: None, empty, whitespace -> violation (but not applicable for this rule type)\n if v is None:\n return None\n # Non-numeric check for field_comparison/threshold rules\n if not isinstance(v, (int, float)):\n return None\n values[f] = v\n if (values[\"fop_symbol_present\"] > 0.0 and\n values[\"fop_threshold_exceeded\"] == 0.0 and\n values[\"fop_exempt_proxy\"] == 0.0 and\n values[\"product_is_prepackaged_proxy\"] > 0.0):\n return tag\n return None", | |
| "conversion_lines": 20, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE fop_symbol_present > 0.0 AND fop_threshold_exceeded == 0.0 AND fop_exempt_proxy == 0.0 AND product_is_prepackaged_proxy > 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: ca_fop_symbol_present_but_not_required\n expression: fop_symbol_present > 0.0 AND fop_threshold_exceeded == 0.0 AND fop_exempt_proxy == 0.0 AND product_is_prepackaged_proxy > 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "ca_fop_symbol_present_on_exempt_product", | |
| "tag": "ca-fop-symbol-present-on-exempt-product", | |
| "severity": "warning", | |
| "condition": "fop_symbol_present > 0.0 && fop_exempt_proxy > 0.0 && product_is_prepackaged_proxy > 0.0", | |
| "jurisdiction": "ca", | |
| "profile_tags": [ | |
| "canada", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "guidance_proxy", | |
| "legal_citation": "FDR B.01.350(5)-(15)", | |
| "source_url": "https://laws-lois.justice.gc.ca/eng/regulations/C.R.C.,_c._870/section-B.01.350.html", | |
| "effective_date": "2026-01-01", | |
| "review_status": "draft", | |
| "reviewer": "pending-mentor-review", | |
| "required_fields": [ | |
| "fop_symbol_present", | |
| "fop_exempt_proxy", | |
| "product_is_prepackaged_proxy" | |
| ], | |
| "exemption_logic": "Proxy warning on symbol presence for exempt categories.", | |
| "rule_notes": "Phase-1 Canada FOP exemption consistency rule.", | |
| "rule_ir_hash": "4e274edaa3ca", | |
| "condition_type": "compound_threshold_and", | |
| "complexity": "medium", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "soda", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-odd->soda", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0451, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 2, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0451, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1451, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_ca_fop_symbol_present_on_exempt_product(product: dict):\n \"\"\"\n Returns the rule tag if the product violates the rule:\n fop_symbol_present > 0.0 && fop_exempt_proxy > 0.0 && product_is_prepackaged_proxy > 0.0\n Otherwise returns None.\n \"\"\"\n tag = \"ca-fop-symbol-present-on-exempt-product\"\n\n # Helper to validate numeric fields\n def _is_valid_number(value):\n return isinstance(value, (int, float)) and not isinstance(value, bool)\n\n fop_symbol_present = product.get(\"fop_symbol_present\")\n fop_exempt_proxy = product.get(\"fop_exempt_proxy\")\n product_is_prepackaged_proxy = product.get(\"product_is_prepackaged_proxy\")\n\n # If any required field is missing or not numeric, rule does not apply\n if not (_is_valid_number(fop_symbol_present) and\n _is_valid_number(fop_exempt_proxy) and\n _is_valid_number(product_is_prepackaged_proxy)):\n return None\n\n if (fop_symbol_present > 0.0 and\n fop_exempt_proxy > 0.0 and\n product_is_prepackaged_proxy > 0.0):\n return tag\n\n return None", | |
| "conversion_lines": 28, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE fop_symbol_present > 0.0 AND fop_exempt_proxy > 0.0 AND product_is_prepackaged_proxy > 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: ca_fop_symbol_present_on_exempt_product\n expression: fop_symbol_present > 0.0 AND fop_exempt_proxy > 0.0 AND product_is_prepackaged_proxy > 0.0", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "carbohydrates_over_105g", | |
| "tag": "carbohydrates-value-over-105g", | |
| "severity": "warning", | |
| "condition": "carbohydrates > 105", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: carbohydrates_over_105g", | |
| "rule_ir_hash": "7261087f016d", | |
| "condition_type": "field_threshold", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "soda", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-odd->soda", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.9181, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 1.0, | |
| "mutation_total": 1, | |
| "mutation_killed": 1, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.9181, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 1.0181, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_carbohydrates_over_105g(product: dict):\n \"\"\"\n Returns the tag 'carbohydrates-value-over-105g' if the product's\n 'carbohydrates' field is numeric and greater than 105.\n Otherwise returns None.\n \"\"\"\n tag = \"carbohydrates-value-over-105g\"\n value = product.get(\"carbohydrates\", None)\n\n # If the value is missing or not a number, do not flag a violation\n if value is None or not isinstance(value, (int, float)):\n return None\n\n # Check the threshold condition\n if value > 105:\n return tag\n\n return None", | |
| "conversion_lines": 18, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.9371, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.9371, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.9721, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE carbohydrates > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.9371, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.9371, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.9721, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: carbohydrates_over_105g\n expression: carbohydrates > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "energy_kcal_vs_kj", | |
| "tag": "energy-value-in-kcal-greater-than-in-kj", | |
| "severity": "error", | |
| "condition": "energy_kcal > energy_kj", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: energy_kcal_vs_kj", | |
| "rule_ir_hash": "413d25898535", | |
| "condition_type": "field_comparison", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "soda", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-odd->soda", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 23, | |
| "mutation_score": 0.0, | |
| "mutation_total": 1, | |
| "mutation_killed": 0, | |
| "verification_score": 0.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.099, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_energy_kcal_vs_kj(product):\n \"\"\"\n Returns the rule tag if energy_kcal > energy_kj.\n Returns None if any value is missing, None, empty/whitespace string, or non-numeric.\n \"\"\"\n tag = \"energy-value-in-kcal-greater-than-in-kj\"\n left = product.get(\"energy_kcal\")\n right = product.get(\"energy_kj\")\n\n # Missing or None values\n if left is None or right is None:\n return None\n\n # Empty or whitespace-only strings are considered missing for this rule\n if isinstance(left, str) and left.strip() == \"\":\n return None\n if isinstance(right, str) and right.strip() == \"\":\n return None\n\n # Non-numeric values\n if not isinstance(left, (int, float)):\n return None\n if not isinstance(right, (int, float)):\n return None\n\n if left > right:\n return tag\n return None", | |
| "conversion_lines": 28, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE energy_kcal > energy_kj", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: energy_kcal_vs_kj\n expression: energy_kcal > energy_kj", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "energy_kj_computed_mismatch_high", | |
| "tag": "energy-value-in-kj-does-not-match-value-computed-from-other-nutrients-high", | |
| "severity": "error", | |
| "condition": "energy_kj_computed > (1.3 * energy_kj + 5.0)", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: energy_kj_computed_mismatch_high", | |
| "rule_ir_hash": "ac2e3831ada8", | |
| "condition_type": "affine_field_comparison", | |
| "complexity": "intricate", | |
| "declarative_friendly": false, | |
| "products_tested": 400, | |
| "best_engine": "python", | |
| "selection_reason": "hybrid-close-procedural:prefer-python", | |
| "declarative_tie_break_applied": false, | |
| "recommendation": "Procedural preference: rule is intricate (affine_field_comparison). Python migration is preferred under current evidence.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0446, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 0.0, | |
| "mutation_total": 3, | |
| "mutation_killed": 0, | |
| "verification_score": 0.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0446, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1296, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_energy_kj_computed_mismatch_high(product):\n \"\"\"\n Returns the rule tag if energy_kj_computed > (1.3 * energy_kj + 5.0),\n otherwise returns None. Missing or non\u2011numeric values also yield None.\n \"\"\"\n tag = \"energy-value-in-kj-does-not-match-value-computed-from-other-nutrients-high\"\n left = product.get(\"energy_kj_computed\")\n right = product.get(\"energy_kj\")\n\n # Missing values\n if left is None or right is None:\n return None\n\n # Non\u2011numeric values (exclude bool which is subclass of int)\n if isinstance(left, bool) or isinstance(right, bool):\n return None\n if not isinstance(left, (int, float)) or not isinstance(right, (int, float)):\n return None\n\n # Apply affine comparison\n if left > (1.3 * right + 5.0):\n return tag\n return None", | |
| "conversion_lines": 23, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE energy_kj_computed > (1.3 * energy_kj + 5.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: energy_kj_computed_mismatch_high\n expression: energy_kj_computed > (1.3 * energy_kj + 5.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "energy_kj_computed_mismatch_low", | |
| "tag": "energy-value-in-kj-does-not-match-value-computed-from-other-nutrients-low", | |
| "severity": "error", | |
| "condition": "energy_kj_computed < (0.7 * energy_kj - 5.0)", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: energy_kj_computed_mismatch_low", | |
| "rule_ir_hash": "2845fdb42a7e", | |
| "condition_type": "affine_field_comparison", | |
| "complexity": "intricate", | |
| "declarative_friendly": false, | |
| "products_tested": 400, | |
| "best_engine": "python", | |
| "selection_reason": "hybrid-close-procedural:prefer-python", | |
| "declarative_tie_break_applied": false, | |
| "recommendation": "Procedural preference: rule is intricate (affine_field_comparison). Python migration is preferred under current evidence.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0446, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 1.0, | |
| "mutation_total": 2, | |
| "mutation_killed": 2, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0446, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1796, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_energy_kj_computed_mismatch_low(product):\n tag = \"energy-value-in-kj-does-not-match-value-computed-from-other-nutrients-low\"\n # missing_field rule for the whole input\n if product is None or (isinstance(product, str) and product.strip() == \"\"):\n return tag\n if not isinstance(product, dict):\n return None\n left = product.get(\"energy_kj_computed\")\n right = product.get(\"energy_kj\")\n # field_comparison rule: missing or non-numeric values yield None\n if left is None or right is None:\n return None\n try:\n left_val = float(left)\n right_val = float(right)\n except (TypeError, ValueError):\n return None\n if left_val < (0.7 * right_val - 5.0):\n return tag\n return None", | |
| "conversion_lines": 20, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE energy_kj_computed < (0.7 * energy_kj - 5.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: energy_kj_computed_mismatch_low\n expression: energy_kj_computed < (0.7 * energy_kj - 5.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "energy_kj_mismatch_high", | |
| "tag": "energy-value-in-kcal-does-not-match-value-in-kj-high", | |
| "severity": "error", | |
| "condition": "energy_kj > (4.7 * energy_kcal + 2.0)", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: energy_kj_mismatch_high", | |
| "rule_ir_hash": "13c3c72ed774", | |
| "condition_type": "affine_field_comparison", | |
| "complexity": "intricate", | |
| "declarative_friendly": false, | |
| "products_tested": 400, | |
| "best_engine": "python", | |
| "selection_reason": "hybrid-close-procedural:prefer-python", | |
| "declarative_tie_break_applied": false, | |
| "recommendation": "Procedural preference: rule is intricate (affine_field_comparison). Python migration is preferred under current evidence.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0446, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 0.0, | |
| "mutation_total": 3, | |
| "mutation_killed": 0, | |
| "verification_score": 0.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0446, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1296, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_energy_kj_mismatch_high(product):\n \"\"\"\n Returns the rule tag if energy_kj > (4.7 * energy_kcal + 2.0), otherwise None.\n Missing or non-numeric values result in None.\n \"\"\"\n tag = \"energy-value-in-kcal-does-not-match-value-in-kj-high\"\n left = product.get(\"energy_kj\")\n right = product.get(\"energy_kcal\")\n\n # Missing values\n if left is None or right is None:\n return None\n\n # Non-numeric values\n if not isinstance(left, (int, float)) or not isinstance(right, (int, float)):\n return None\n\n if left > (4.7 * right + 2.0):\n return tag\n return None", | |
| "conversion_lines": 20, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE energy_kj > (4.7 * energy_kcal + 2.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: energy_kj_mismatch_high\n expression: energy_kj > (4.7 * energy_kcal + 2.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "energy_kj_mismatch_low", | |
| "tag": "energy-value-in-kcal-does-not-match-value-in-kj-low", | |
| "severity": "error", | |
| "condition": "energy_kj < (3.7 * energy_kcal - 2.0)", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: energy_kj_mismatch_low", | |
| "rule_ir_hash": "5a7e9e033cc8", | |
| "condition_type": "affine_field_comparison", | |
| "complexity": "intricate", | |
| "declarative_friendly": false, | |
| "products_tested": 400, | |
| "best_engine": "python", | |
| "selection_reason": "hybrid-close-procedural:prefer-python", | |
| "declarative_tie_break_applied": false, | |
| "recommendation": "Procedural preference: rule is intricate (affine_field_comparison). Python migration is preferred under current evidence.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0446, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 0.5, | |
| "mutation_total": 2, | |
| "mutation_killed": 1, | |
| "verification_score": 0.5, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0446, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1546, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_energy_kj_mismatch_low(product):\n \"\"\"\n Returns the rule tag if energy_kj is less than (3.7 * energy_kcal - 2.0).\n Returns None for missing or non-numeric values or when the condition is false.\n \"\"\"\n tag = \"energy-value-in-kcal-does-not-match-value-in-kj-low\"\n left = product.get(\"energy_kj\")\n right = product.get(\"energy_kcal\")\n\n # Missing values\n if left is None or right is None:\n return None\n\n # Convert to float, treat conversion failures as non-numeric\n try:\n left_val = float(left)\n right_val = float(right)\n except (TypeError, ValueError):\n return None\n\n # Apply affine comparison\n if left_val < (3.7 * right_val - 2.0):\n return tag\n return None", | |
| "conversion_lines": 24, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE energy_kj < (3.7 * energy_kcal - 2.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.049, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: energy_kj_mismatch_low\n expression: energy_kj < (3.7 * energy_kcal - 2.0)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "energy_kj_over_3911", | |
| "tag": "value-over-3911-energy", | |
| "severity": "error", | |
| "condition": "energy_kj > 3911", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: energy_kj_over_3911", | |
| "rule_ir_hash": "abd124f391c9", | |
| "condition_type": "field_threshold", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "soda", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-odd->soda", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.8599, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 0.0, | |
| "mutation_total": 1, | |
| "mutation_killed": 0, | |
| "verification_score": 0.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.8599, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.9099, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_energy_kj_over_3911(product):\n \"\"\"\n Returns the tag 'value-over-3911-energy' if product['energy_kj'] > 3911.\n Returns None for missing, None, empty, whitespace-only, or non-numeric values.\n \"\"\"\n tag = \"value-over-3911-energy\"\n value = product.get(\"energy_kj\", None)\n\n # Missing or None\n if value is None:\n return None\n\n # Empty or whitespace-only strings (treated as missing for this rule)\n if isinstance(value, str) and value.strip() == \"\":\n return None\n\n # Non-numeric values\n if not isinstance(value, (int, float)) or isinstance(value, bool):\n return None\n\n # Apply threshold condition\n if value > 3911:\n return tag\n return None", | |
| "conversion_lines": 24, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.8776, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.8776, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.9126, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE energy_kj > 3911", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.8776, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.8776, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.9126, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: energy_kj_over_3911\n expression: energy_kj > 3911", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "fat_over_105g", | |
| "tag": "fat-value-over-105g", | |
| "severity": "warning", | |
| "condition": "fat > 105", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: fat_over_105g", | |
| "rule_ir_hash": "c6f7c59ce9c9", | |
| "condition_type": "field_threshold", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.6888, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 1.0, | |
| "mutation_total": 1, | |
| "mutation_killed": 1, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.6888, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.7888, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_fat_over_105g(product):\n \"\"\"\n Returns the tag 'fat-value-over-105g' if the product's 'fat' field\n exceeds 105. Returns None for missing, empty, whitespace-only,\n or non-numeric values, or when the condition is not met.\n \"\"\"\n tag = \"fat-value-over-105g\"\n value = product.get(\"fat\")\n\n # Missing field or None\n if value is None:\n return None\n\n # Non-numeric values (including strings, bools, etc.)\n if not isinstance(value, (int, float)):\n return None\n\n # Apply the threshold condition\n if value > 105:\n return tag\n\n return None", | |
| "conversion_lines": 22, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.703, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.703, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.738, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE fat > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.703, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.703, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.738, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: fat_over_105g\n expression: fat > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "main_language_code_missing", | |
| "tag": "main-language-code-missing", | |
| "severity": "bug", | |
| "condition": "missing(lc)", | |
| "jurisdiction": "ca", | |
| "profile_tags": [ | |
| "canada", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "statutory", | |
| "legal_citation": "SFCR 206(1); FDR B.01.012(2)", | |
| "source_url": "https://laws-lois.justice.gc.ca/eng/regulations/SOR-2018-108/section-206.html", | |
| "effective_date": "2019-01-15", | |
| "review_status": "draft", | |
| "reviewer": "pending-mentor-review", | |
| "required_fields": [ | |
| "lc", | |
| "lang", | |
| "language_code" | |
| ], | |
| "exemption_logic": "Not all products require bilingual labels; this prototype uses a conservative language-presence proxy.", | |
| "rule_notes": "Canada pack: proxy check for missing primary language code in label metadata.", | |
| "rule_ir_hash": "d6c3ad98509c", | |
| "condition_type": "missing_field", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0466, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 5, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0466, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1466, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_main_language_code_missing(product: dict) -> str | None:\n \"\"\"\n Returns the tag 'main-language-code-missing' if the 'lc' field is missing,\n None, empty, or contains only whitespace. Otherwise returns None.\n \"\"\"\n tag = \"main-language-code-missing\"\n lc = product.get(\"lc\")\n if lc is None:\n return tag\n if isinstance(lc, str) and lc.strip() == \"\":\n return tag\n return None", | |
| "conversion_lines": 12, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE lc IS NULL OR TRIM(lc) = ''", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: main_language_code_missing\n expression: lc IS NULL OR TRIM(lc) = ''", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "main_language_missing", | |
| "tag": "main-language-missing", | |
| "severity": "bug", | |
| "condition": "missing(lang)", | |
| "jurisdiction": "ca", | |
| "profile_tags": [ | |
| "canada", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "statutory", | |
| "legal_citation": "SFCR 206(1); FDR B.01.012(2)", | |
| "source_url": "https://laws-lois.justice.gc.ca/eng/regulations/C.R.C.,_c._870/section-B.01.012.html", | |
| "effective_date": "2019-01-15", | |
| "review_status": "draft", | |
| "reviewer": "pending-mentor-review", | |
| "required_fields": [ | |
| "lang", | |
| "language_code", | |
| "lc" | |
| ], | |
| "exemption_logic": "Prototype proxy only; legal exemptions by product class must be modeled before strict enforcement.", | |
| "rule_notes": "Canada pack: proxy check for missing primary language value.", | |
| "rule_ir_hash": "342123898ecb", | |
| "condition_type": "missing_field", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0466, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 5, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0466, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.1466, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_main_language_missing(product):\n \"\"\"\n Checks if the 'lang' field is missing (None, empty, or whitespace-only).\n Returns the rule tag 'main-language-missing' if the condition is met, otherwise None.\n \"\"\"\n tag = \"main-language-missing\"\n value = product.get(\"lang\")\n if value is None:\n return tag\n if isinstance(value, str) and value.strip() == \"\":\n return tag\n return None", | |
| "conversion_lines": 12, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE lang IS NULL OR TRIM(lang) = ''", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: main_language_missing\n expression: lang IS NULL OR TRIM(lang) = ''", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "saturated_fat_over_105g", | |
| "tag": "saturated-fat-value-over-105g", | |
| "severity": "warning", | |
| "condition": "saturated_fat > 105", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: saturated_fat_over_105g", | |
| "rule_ir_hash": "aafe1ceddbf5", | |
| "condition_type": "field_threshold", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "soda", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-odd->soda", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2148, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 0.0, | |
| "mutation_total": 1, | |
| "mutation_killed": 0, | |
| "verification_score": 0.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2148, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.2648, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_saturated_fat_over_105g(product):\n \"\"\"\n Returns the tag \"saturated-fat-value-over-105g\" if product['saturated_fat'] > 105.\n Returns None if the field is missing, None, non\u2011numeric, or the condition is false.\n \"\"\"\n value = product.get(\"saturated_fat\")\n if value is None:\n return None\n\n # Determine if value is numeric\n if isinstance(value, (int, float)):\n num = float(value)\n else:\n try:\n num = float(value)\n except Exception:\n return None\n\n if num > 105:\n return \"saturated-fat-value-over-105g\"\n return None", | |
| "conversion_lines": 21, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2193, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2193, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.2543, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE saturated_fat > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2193, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2193, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.2543, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: saturated_fat_over_105g\n expression: saturated_fat > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "saturated_fat_vs_fat", | |
| "tag": "saturated-fat-greater-than-fat", | |
| "severity": "error", | |
| "condition": "saturated_fat > (1.0 * fat + 0.001)", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: saturated_fat_vs_fat", | |
| "rule_ir_hash": "3b10c7bc2547", | |
| "condition_type": "affine_field_comparison", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.1993, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 0.0, | |
| "mutation_total": 3, | |
| "mutation_killed": 0, | |
| "verification_score": 0.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.1993, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.2493, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_saturated_fat_vs_fat(product: dict):\n tag = \"saturated-fat-greater-than-fat\"\n left = product.get(\"saturated_fat\")\n right = product.get(\"fat\")\n # Missing or empty values\n if left is None or right is None:\n return None\n if isinstance(left, str) and left.strip() == \"\":\n return None\n if isinstance(right, str) and right.strip() == \"\":\n return None\n # Convert to numeric\n try:\n left_val = float(left)\n right_val = float(right)\n except (TypeError, ValueError):\n return None\n # Affine comparison: saturated_fat > (1.0 * fat + 0.001)\n if left_val > (1.0 * right_val + 0.001):\n return tag\n return None", | |
| "conversion_lines": 21, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2193, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2193, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.2543, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE saturated_fat > (1.0 * fat + 0.001)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.2193, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.2193, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.2543, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: saturated_fat_vs_fat\n expression: saturated_fat > (1.0 * fat + 0.001)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "sugars_over_105g", | |
| "tag": "sugars-value-over-105g", | |
| "severity": "warning", | |
| "condition": "sugars > 105", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: sugars_over_105g", | |
| "rule_ir_hash": "f4924feaa2f8", | |
| "condition_type": "field_threshold", | |
| "complexity": "simple", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.8961, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 1.0, | |
| "mutation_total": 1, | |
| "mutation_killed": 1, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.8961, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.9961, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_sugars_over_105g(product):\n \"\"\"\n Returns the tag 'sugars-value-over-105g' if the product's 'sugars' field\n exceeds 105. Returns None for missing, non-numeric, or non\u2011violating values.\n \"\"\"\n tag = \"sugars-value-over-105g\"\n value = product.get(\"sugars\")\n\n # Missing or None -> no violation\n if value is None:\n return None\n\n # Attempt to interpret numeric values\n try:\n numeric_value = float(value)\n except (TypeError, ValueError):\n return None\n\n # Apply threshold condition\n if numeric_value > 105:\n return tag\n\n return None", | |
| "conversion_lines": 23, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.9146, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.9146, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.9496, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE sugars > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.9146, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.9146, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.9496, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: sugars_over_105g\n expression: sugars > 105", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| }, | |
| { | |
| "rule_name": "sugars_plus_starch_vs_carbohydrates", | |
| "tag": "sugars-plus-starch-greater-than-carbohydrates", | |
| "severity": "error", | |
| "condition": "(sugars + starch) > (carbohydrates + 0.001)", | |
| "jurisdiction": "global", | |
| "profile_tags": [ | |
| "global", | |
| "hybrid" | |
| ], | |
| "regulatory_type": "off_internal", | |
| "legal_citation": "", | |
| "source_url": "", | |
| "effective_date": "", | |
| "review_status": "reviewed", | |
| "reviewer": "prototype", | |
| "required_fields": [], | |
| "exemption_logic": "none", | |
| "rule_notes": "OFF-derived global rule: sugars_plus_starch_vs_carbohydrates", | |
| "rule_ir_hash": "7160c946ab45", | |
| "condition_type": "sum_fields_comparison", | |
| "complexity": "medium", | |
| "declarative_friendly": true, | |
| "products_tested": 400, | |
| "best_engine": "dbt", | |
| "selection_reason": "hybrid-close-declarative:explicit-hash-tie-break-even->dbt", | |
| "declarative_tie_break_applied": true, | |
| "recommendation": "Declarative-friendly rule; prefer dbt/soda for readability and operations.", | |
| "engines": { | |
| "python": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.0456, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 22, | |
| "mutation_score": 0.0, | |
| "mutation_total": 1, | |
| "mutation_killed": 0, | |
| "verification_score": 0.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.0456, | |
| "provider_factor": 1.0, | |
| "real_llm_used": true, | |
| "decision_score": 0.0956, | |
| "conversion_provider": "groq", | |
| "conversion_notes": "Converted via Groq (openai/gpt-oss-120b).", | |
| "execution_mode": "", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "def check_sugars_plus_starch_vs_carbohydrates(product):\n \"\"\"\n Returns the rule tag if (sugars + starch) > (carbohydrates + 0.001).\n Returns None if any required field is missing, non\u2011numeric, or the condition is false.\n \"\"\"\n tag = \"sugars-plus-starch-greater-than-carbohydrates\"\n # Helper to determine if a value is numeric (int or float, but not bool)\n def _is_numeric(v):\n return isinstance(v, (int, float)) and not isinstance(v, bool)\n\n sugars = product.get(\"sugars\")\n starch = product.get(\"starch\")\n carbohydrates = product.get(\"carbohydrates\")\n\n # Missing or non\u2011numeric values cause the rule to be ignored\n if not (_is_numeric(sugars) and _is_numeric(starch) and _is_numeric(carbohydrates)):\n return None\n\n if (sugars + starch) > (carbohydrates + 0.001):\n return tag\n return None", | |
| "conversion_lines": 21, | |
| "failed_test_cases": [] | |
| }, | |
| "dbt": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "dbt_core", | |
| "conversion_notes": "dbt tests executed through dbt-core. Command: dbt debug + dbt run-operation count_violations (per-rule x19) --project-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project --profiles-dir C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\dbt\\dbt_project | Success: True | Return code: 0", | |
| "execution_mode": "local", | |
| "cloud_connected": false, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "", | |
| "conversion_artifact": "SELECT product_id\nFROM {{ source('off_source', 'nutrition_table') }}\nWHERE (sugars + starch) > (carbohydrates + 0.001)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| }, | |
| "soda": { | |
| "status": "MATCH", | |
| "mismatches": 0, | |
| "parity_ci_lower": 0.9905, | |
| "overall_confidence": 0.049, | |
| "equivalence_match_rate": 1.0, | |
| "equivalence_status": "PASS", | |
| "equivalence_cases": 0, | |
| "mutation_score": 1.0, | |
| "mutation_total": 0, | |
| "mutation_killed": 0, | |
| "verification_score": 1.0, | |
| "counterexample_repair_applied": false, | |
| "equivalence_counterexamples": [], | |
| "effective_confidence": 0.049, | |
| "provider_factor": 1.0, | |
| "real_llm_used": null, | |
| "decision_score": 0.084, | |
| "conversion_provider": "soda_cloud", | |
| "conversion_notes": "Soda Cloud scan executed successfully. Command: soda contract verify (per-rule x19) -ds C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\data_source.yml -sc C:\\dev\\OFF_DataQuality_Prototype\\results\\declarative_runtime\\soda\\soda_cloud\\soda_cloud.yml -p | Success: True | Return code: 0", | |
| "execution_mode": "cloud", | |
| "cloud_connected": true, | |
| "cloud_scan_id": "", | |
| "cloud_scan_url": "https://cloud.us.soda.io/o/c9e7e376-1da2-49c5-93cb-78c6d95273ee/datasets/5e60cafe-18fc-4d01-8390-0057b49d7765", | |
| "conversion_artifact": " - failed_rows:\n name: sugars_plus_starch_vs_carbohydrates\n expression: (sugars + starch) > (carbohydrates + 0.001)", | |
| "conversion_lines": 3, | |
| "failed_test_cases": [] | |
| } | |
| } | |
| } | |
| ], | |
| "run_config": { | |
| "llm_provider": "groq", | |
| "llm_model": "openai/gpt-oss-120b", | |
| "require_real_llm": true, | |
| "groq_api_key_set": true, | |
| "profile": "hybrid", | |
| "dataset_size": 400, | |
| "seed": 17, | |
| "mode": "off", | |
| "source_jsonl": "C:\\dev\\OFF_DataQuality_Prototype\\openfoodfacts-products.jsonl", | |
| "soda_mode": "cloud", | |
| "soda_cloud_credentials_set": true | |
| } | |
| } |