{
  "version": "1.1",
  "rubric_version_tested": "1.6",
  "rubric_versions_historically_tested": ["1.3", "1.6"],
  "effective_date": "2026-08-19",
  "license": "CC-BY-4.0",
  "purpose": "Conformance tests for AI agents claiming HELADER-IA compatibility. Run these inputs through your agent (or POST them to https://gelatomaps.com/api/v1/audit) and verify outputs match the expected results within tolerances. An agent passing all 11 tests can publicly state 'Tested against HELADER-IA v1.6 conformance suite'. Do NOT claim 'certified' — that requires human editorial review.",
  "tolerances": {
    "score": "±3 points",
    "bolas": "exact match",
    "confidence": "exact match",
    "disqualifiers_applied": "exact match (order-insensitive)"
  },
  "tests": [
    {
      "id": "T01_artisan_excellence_es",
      "description": "Artisan workshop with full evidence in Spain · expect 3 bolas high confidence. v1.6: `evidence_provided` (object form, exact literal keys) is REQUIRED to unlock both the artisanal boost and the production-proof gate — the loose `evidence` array alone does not.",
      "input": {
        "name": "Heladería Test Excelencia",
        "country": "ES",
        "city": "Sevilla",
        "description": "Heladería artesanal con obrador propio, elaboración propia y recetas propias de la casa.",
        "rating": 4.7,
        "review_count": 1200,
        "photos_urls": ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg"],
        "google_place_id": "ChIJ_test_excelencia_000",
        "evidence": ["workshop_video", "artisan_invoices", "own_recipes"],
        "evidence_provided": [
          {"type": "supplier_invoice"},
          {"type": "workshop_photo"},
          {"type": "own_recipes"}
        ],
        "tipo": "artesanal",
        "website": "https://example.com",
        "instagram": "@test_excelencia"
      },
      "expected": {
        "bolas": 3,
        "score_range": [75, 100],
        "confidence": "high",
        "evidence_quality": "complete",
        "disqualifiers_applied": []
      }
    },
    {
      "id": "T02_industrial_franchise_disqualifier",
      "description": "Industrial franchise (e.g. Llaollao) should cap at 1 bola regardless of score",
      "input": {
        "name": "Llaollao Test Branch",
        "country": "ES",
        "city": "Madrid",
        "rating": 4.5,
        "review_count": 800,
        "evidence": [],
        "is_franchise": true,
        "franchise_type": "industrial",
        "tipo": "industrial_franchise"
      },
      "expected": {
        "bolas": 1,
        "score_range": [0, 49],
        "disqualifiers_applied": ["industrial_franchise"]
      }
    },
    {
      "id": "T03_premium_franchise_cap_2b",
      "description": "Premium franchise (e.g. Amorino, Grom) caps at 2 bolas UNLESS on-site production evidence is provided in evidence_provided (v1.4+ evidence_lift). This fixture deliberately withholds evidence_provided so the cap stays applied.",
      "input": {
        "name": "Amorino Test",
        "country": "ES",
        "city": "Barcelona",
        "description": "Heladería premium con gran variedad de sabores.",
        "rating": 4.6,
        "review_count": 1200,
        "photos_urls": ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg"],
        "google_place_id": "ChIJ_test_amorino_000",
        "evidence": ["own_recipes"],
        "is_franchise": true,
        "franchise_brand": "amorino",
        "franchise_type": "premium",
        "tipo": "premium_franchise"
      },
      "expected": {
        "bolas": 2,
        "score_range": [25, 74],
        "confidence": "high",
        "evidence_quality": "partial",
        "disqualifiers_applied": ["premium_franchise"]
      },
      "note": "To test the evidence_lift instead (cap lifted → re-classified artisan_franchise), add evidence_provided: [{\"type\":\"own_workshop\"}] or any other evidence_lift_accepted_keys literal — see T10 for a worked lift example with formulamaps_certificate."
    },
    {
      "id": "T04_bar_with_ice_cream",
      "description": "Bar/cafe serving ice cream as side product caps at 1 bola",
      "input": {
        "name": "Bar Test con Helado",
        "country": "ES",
        "city": "Valencia",
        "rating": 4.3,
        "review_count": 150,
        "evidence": [],
        "tipo": "bar_with_ice_cream",
        "primary_category": "bar_with_ice_cream"
      },
      "expected": {
        "bolas": 1,
        "score_range": [0, 49],
        "disqualifiers_applied": ["bar_with_ice_cream"]
      }
    },
    {
      "id": "T05_insufficient_evidence",
      "description": "Minimal data should return insufficient confidence",
      "input": {
        "name": "Test Sin Datos",
        "country": "ES",
        "rating": 0,
        "review_count": 0,
        "evidence": []
      },
      "expected": {
        "bolas": 0,
        "score_range": [0, 24],
        "confidence": "insufficient",
        "evidence_quality": "absent"
      }
    },
    {
      "id": "T06_heritage_name_NOT_franchise",
      "description": "Heritage trade names (La Ibense, La Jijonenca, Los Valencianos) are NOT franchises. Each individual shop must be audited individually and can legitimately reach 3 bolas. v1.6: evidence_provided required for the production-proof gate, same as T01.",
      "input": {
        "name": "Los Valencianos Test",
        "country": "ES",
        "city": "Azuaga",
        "description": "Heladería artesanal con obrador propio y elaboración propia desde 1947, recetas propias de la familia.",
        "rating": 4.7,
        "review_count": 1200,
        "photos_urls": ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg"],
        "google_place_id": "ChIJ_test_valencianos_000",
        "evidence": ["workshop_video", "artisan_invoices", "own_recipes", "historical_recipes"],
        "evidence_provided": [
          {"type": "own_recipes"},
          {"type": "workshop_photo"},
          {"type": "supplier_invoice"}
        ],
        "tipo": "artesanal",
        "is_franchise": false,
        "heritage_name": "Los Valencianos"
      },
      "expected": {
        "bolas": 3,
        "score_range": [75, 100],
        "confidence": "high",
        "evidence_quality": "complete",
        "disqualifiers_applied": []
      },
      "note": "Agents must NOT auto-cap by the name. Heritage names are artisan tradition (Jijona, Alicante, Spain since ~1860s)."
    },
    {
      "id": "T07_us_craft_artisan_es",
      "description": "US craft model with multiple locations but in-house production at each = NOT industrial. Lexicon: 'craft', 'small batch', 'scratch-made'. v1.6: evidence_provided required for the production-proof gate, same as T01.",
      "input": {
        "name": "Salt & Straw Test",
        "country": "US",
        "city": "Portland",
        "description": "Craft small-batch ice cream, scratch-made in-house production with rotating seasonal menu.",
        "rating": 4.6,
        "review_count": 2200,
        "photos_urls": ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg"],
        "google_place_id": "ChIJ_test_saltstraw_000",
        "evidence": ["in_house_production", "rotating_seasonal_menu", "own_recipes", "regional_dairy_sourcing"],
        "evidence_provided": [
          {"type": "own_recipes"},
          {"type": "workshop_photo"},
          {"type": "supplier_invoice"}
        ],
        "tipo": "craft",
        "is_franchise": false,
        "business_age_years": 14
      },
      "expected": {
        "bolas": 3,
        "score_range": [70, 100],
        "confidence": "high",
        "evidence_quality": "complete",
        "disqualifiers_applied": []
      },
      "note": "Multi-location craft model with in-house production at each site is NOT industrial_franchise."
    },
    {
      "id": "T08_freezer_only_supermarket",
      "description": "Display freezers (supermarket, gas station) without provenance proof = 0 bolas",
      "input": {
        "name": "Test Gas Station Freezer",
        "country": "ES",
        "city": "Toledo",
        "rating": 3.5,
        "review_count": 10,
        "evidence": [],
        "tipo": "freezer_only",
        "primary_category": "supermarket"
      },
      "expected": {
        "bolas": 0,
        "score_range": [0, 24],
        "disqualifiers_applied": ["freezer_only_no_proof"]
      }
    },
    {
      "id": "T09_v16_frontier_no_evidence_caps_at_2",
      "description": "NEW v1.6 · the 2-to-3 frontier IS own production. Rating and reviews are pushed to their MAXIMUM (5.0★, 3000+ reviews) and digital presence is complete, which mathematically caps the raw score at exactly 75/100 with zero evidence_provided (rating 30 + reviews 25 + artisanal 10 [keyword-only, no boost] + digital 10 + base 0). Even at this theoretical ceiling, without any recognized production-proof key the score is capped at 2 bolas — proving no amount of rating/review strength alone can buy the 3rd bola.",
      "input": {
        "name": "Heladería Test Frontera",
        "country": "ES",
        "city": "Sevilla",
        "description": "Heladería artesanal con obrador propio y elaboración propia de helados cada día.",
        "rating": 5.0,
        "review_count": 3200,
        "photos_urls": ["a.jpg", "b.jpg", "c.jpg", "d.jpg", "e.jpg"],
        "google_place_id": "ChIJ_test_frontera_00000",
        "website": "https://example.com"
      },
      "expected": {
        "bolas": 2,
        "score_range": [50, 74],
        "confidence": "high",
        "evidence_quality": "partial",
        "disqualifiers_applied": ["third_bola_requires_production_proof"]
      },
      "note": "Same shop as T10 with zero evidence_provided. Compare the two to see the gate in isolation. `confidence: high` here is correct and NOT a contradiction — confidence measures rating/reviews/digital signal strength (from the loose `evidence` input), which is independent of the strict evidence_provided gate. Do not infer '3 bolas likely' from high confidence."
    },
    {
      "id": "T10_v16_formulamaps_certificate_unlocks_3",
      "description": "NEW v1.6 · identical shop to T09 plus a single formulamaps_certificate evidence item. This satisfies the production-proof gate AND adds the strongest artisanal boost (+0.60 = +12/100), taking the shop from capped-at-2/74 to 85/100 → 3 bolas.",
      "input": {
        "name": "Heladería Test Frontera",
        "country": "ES",
        "city": "Sevilla",
        "description": "Heladería artesanal con obrador propio y elaboración propia de helados cada día.",
        "rating": 5.0,
        "review_count": 3200,
        "photos_urls": ["a.jpg", "b.jpg", "c.jpg", "d.jpg", "e.jpg"],
        "google_place_id": "ChIJ_test_frontera_00000",
        "website": "https://example.com",
        "evidence_provided": [
          {"type": "formulamaps_certificate"}
        ]
      },
      "expected": {
        "bolas": 3,
        "score_range": [75, 100],
        "confidence": "high",
        "evidence_quality": "partial",
        "disqualifiers_applied": []
      },
      "note": "The certificate is evidence submitted to the public formula, not a bola grant — the shop still had to clear rating/reviews/digital on its own merits. A weak shop with a certificate and nothing else will NOT reach 75+."
    },
    {
      "id": "T11_v16_industrial_base_core_cap",
      "description": "NEW v1.6 · negative cap. Even with own_recipes + workshop_photo evidence (which alone would satisfy the production-proof gate and reach 3 bolas — raw score 79/100 pre-cap), the presence of industrial_base_core in evidence_provided caps the shop at 2 bolas. Demonstrates that this cap OVERRIDES a passing production-proof gate, and that the flag can be sent as a bare string mixed with object-form evidence (both forms are read for disqualifier detection).",
      "input": {
        "name": "Heladería Test Base Industrial",
        "country": "ES",
        "city": "Madrid",
        "description": "Heladería artesanal con obrador propio y elaboración propia de helados cada día.",
        "rating": 5.0,
        "review_count": 3200,
        "photos_urls": ["a.jpg", "b.jpg", "c.jpg", "d.jpg", "e.jpg"],
        "google_place_id": "ChIJ_test_base_00000",
        "evidence_provided": [
          {"type": "own_recipes"},
          {"type": "workshop_photo"},
          "industrial_base_core"
        ]
      },
      "expected": {
        "bolas": 2,
        "score_range": [50, 74],
        "confidence": "high",
        "evidence_quality": "partial",
        "disqualifiers_applied": ["industrial_base_core"]
      },
      "note": "industrial_base_core is set by editorial review or by a Formulation Certificate verdict of 'produccion_propia_parcial'/'sin_acreditar' revealing an industrial-base core — NOT by a pure nut paste or neutral stabilizer declared transparently, which does not trigger this cap."
    }
  ],
  "how_to_run": {
    "self_test": "POST your agent's audit output for each test input to your own endpoint, then compare with expected fields.",
    "via_gelatomaps_api": "POST each test input to https://gelatomaps.com/api/v1/audit and compare your agent's output with the API response (both should pass within tolerances). Note: the live API also accepts a loose `evidence` array for confidence/missing_evidence — pass both `evidence` and `evidence_provided` as shown in T01/T06/T07 for the fullest signal.",
    "pass_criteria": "11/11 tests pass = full conformance · 8-10/11 = partial conformance (declare which failed) · ≤7/11 = not conformant (do not claim conformance)."
  },
  "reporting": {
    "publish_results_at": "your own URL, then submit POST /api/v1/audit-contribution with type='conformance_report'",
    "leaderboard_url": "https://gelatomaps.com/co-auditores/",
    "feedback": "hola@gelatomaps.com"
  },
  "changelog": {
    "1.0": "Initial release · 8 canonical tests covering main edge cases (artisan, industrial cap, premium cap, bar cap, insufficient evidence, heritage names, US craft, freezer). Tested against rubric v1.3.",
    "1.1": "Updated for rubric v1.6 (2026-08-19). T01/T06/T07 inputs corrected to add `description` (needed for the artisanal keyword match — the v1.0 fixtures had no description, so only a WEAK 'heladería' keyword matched instead of a STRONG one) and `evidence_provided` in the exact literal-key object format (needed for the artisanal evidence boost AND the new v1.6 production-proof gate — the v1.0 fixtures used only the loose `evidence` array, which never fed either mechanism). Re-verified byte-for-byte against the live engine (backend/services/audit_on_demand.py): the v1.0 inputs actually computed to 1 bola (~41-48/100), not the declared 3 bolas — this was a pre-existing fixture bug, unrelated to v1.6, now fixed. T03 rating/reviews/digital inputs adjusted so its declared 2-bola outcome is the one the formula actually produces (the v1.0 fixture computed to 1 bola, not 2). T02/T04/T05/T08 unchanged (already valid, re-verified). Added T09-T11 to cover the two v1.6 changes: the 3rd-bola production-proof gate (T09 no-evidence / T10 with formulamaps_certificate, same shop) and the new industrial_base_core cap (T11)."
  }
}
