{
 "schema": "galena.city-report/1",
 "id": "waterloo-on",
 "name": "Waterloo",
 "province_or_state": "Ontario",
 "country": "CA",
 "generated": "2026-11-03T19:34:06Z",
 "decision": "INSUFFICIENT",
 "headline": "Not enough data to judge the model. The city has 12 lead lines in its records, too few: a check needs at least 100. Those lead lines lie in 3 areas of the map (hexagons with an edge of about 1.4 km), too few: a check needs lead lines in at least 5 areas.",
 "reasons": [
  "12 labelled leads of the 100 verified leads needed, verified_mask: absent",
  "3 lead blocks of the 5 needed, counted on hex cells at the H3 resolution-7 edge"
 ],
 "metrics": {
  "model": null,
  "values": {
   "labelled_lines": {
    "estimate": 6748.0
   }
  }
 },
 "sufficiency": {
  "verified_leads": 12,
  "lead_blocks_h3_7": 3,
  "min_verified_leads": 100,
  "min_lead_blocks": 5,
  "verified_mask": "absent"
 },
 "expected_lead_per_cell": null,
 "estimate": null,
 "counts": {
  "lines": 30972,
  "with_year": 18086,
  "with_coords": 30972,
  "recorded": {
   "unknown": 22788,
   "non_lead": 8159,
   "lead": 25
  },
  "labels_used": {
   "unknown": 22788,
   "non_lead": 8159,
   "lead": 25
  },
  "model_made_categories_read_as_unlabelled": 0,
  "verified_labels": null
 },
 "frame": "Services only: type Service or Private Res Service. A hydrant or flushing lead is a branch to a hydrant, not lead metal.",
 "labels_rule": "A category from the city's record is a label. A category the city made with a predictive model is unlabelled. The city's own verified flag is passed only where the city publishes one; otherwise the gate counts recorded leads and says verified_mask: absent.",
 "note": "The City's 'High Probability Lead' class is the City's own estimate, so it is read as unknown, never as a lead label.",
 "method": {
  "pipeline": "craftpine.worker.fitting.train_product, then craftpine.core.model_score.score_loaded and craftpine.worker.estimates.system_estimates on a PASS",
  "algorithm_requested": "lightgbm",
  "algorithm_stored": "lightgbm",
  "seed": 0,
  "code_commit": "311ccef93841709708e536a00e79c8befaf703f9",
  "runtime_seconds": {
   "load": 0.3,
   "train_and_check": 2.0
  },
  "train_reused_from_earlier_invocation": true,
  "cells_with_model_based_only": 0,
  "cells": "H3 resolution 8; a cell with fewer than 10 lines is not published",
  "suppressed": {
   "cells": 7,
   "lines": 32
  },
  "code_note": "The Galena repository is private. The commit hash pins the exact code.",
  "script": {
   "path": "deploy/cities/run_city.py",
   "branch": "lead/site-2026-11-02",
   "commit": "3d0700ae61b9a625a6013aa816753f41667a2d8a"
  }
 },
 "data_card": {
  "publisher": "City of Waterloo",
  "page": "https://data.waterloo.ca",
  "source_url": "https://services.arcgis.com/ZpeBVw5o1kjit7LT/arcgis/rest/services/Water_Distribution_Service_Leads/FeatureServer/0",
  "licence": "Open Government Licence - City of Waterloo, as the City's open data portal states it. The layer's own licence field is blank.",
  "licence_url": "https://data.waterloo.ca/pages/open-government-licence",
  "attribution": "Contains information licensed under the Open Government Licence - City of Waterloo.",
  "retrieved": "2026-10-24",
  "inputs": [
   {
    "file": "ca-on-waterloo-water-service-leads_harmonised.csv",
    "role": "harmonised copy the run read",
    "sha256": "b61064dbe6e0607040db46e35d26cc70a0a6df395b444a991b06c3774bcedc89",
    "bytes": 11968388,
    "redistributed": false
   },
   {
    "file": "waterloo_water_service_leads.geojson",
    "role": "publisher's file as downloaded",
    "sha256": "b9162a4c0bf5b8df069c94f18b0695849be38896ff68c229624a60aaec1e76ed",
    "bytes": 20318640,
    "redistributed": false
   }
  ],
  "harmonise": {
   "script": "deploy/cities/harmonise/harmonise_w16.py",
   "helper": "deploy/cities/harmonise/harmonise_common.py"
  },
  "redistribution": "Line-level inputs are not republished here, because they give the address or exact place of each line. Download the publisher's file from source_url and compare its checksum. The publisher updates its data, so a new download may differ from our copy of 2026-10-24."
 },
 "bbox": [
  -80.60522,
  43.43736,
  -80.4762,
  43.53007
 ],
 "clearance": null,
 "release_bound": null,
 "plain": {
  "decision": "INSUFFICIENT",
  "headline": "There is not enough data to judge the model.",
  "reasons": [
   "The city has 12 lead lines in its records, too few: a check needs at least 100.",
   "Those lead lines lie in 3 areas of the map (hexagons with an edge of about 1.4 km), too few: a check needs lead lines in at least 5 areas."
  ],
  "notes": []
 },
 "false_non_lead": null,
 "false_non_lead_field_checked": null,
 "calibration": null,
 "equity_failures": [],
 "caveats": [
  "The check follows the rules approved on November 3, 2026 (ADR 0019): it judges the lines a city checked in the field, where the city marks them; a call of not lead must also rule out galvanized pipe needing replacement; each decade must pass on its own, or the model makes no call there; and each \"at most\" figure is the worst of the 10 test runs: an exact binomial bound, widened where misses cluster on the map.",
  "This city marks no lines as checked in the field, so its check is on records only: agreement with the city's records, not what was found in the ground. A pass on records alone never unlocks answers about single homes.",
  "Galena gives no model answer about a single home anywhere yet. It will only after its fixed check passes on a city it was never tuned on, and none of today's cities can be that city."
 ],
 "repeat": [
  "Get the publisher's file from data_card.source_url. Our copy of 2026-10-24 has the sha256 in data_card.inputs. A newer download may differ.",
  "Galena's code is not public yet. You can check each city result against its published files and checksums."
 ]
}