{
 "schema": "galena.city-report/1",
 "id": "calgary-ab",
 "name": "Calgary",
 "province_or_state": "Alberta",
 "country": "CA",
 "generated": "2026-11-03T19:34:03Z",
 "decision": "FAIL",
 "headline": "Check failed. The city's records show 0.03% of the model's not-lead calls as lead or galvanized pipe needing replacement, at most 0.05% with 98.33% confidence. Lines built in the 1920s and the 1940s fail on their own. The limits are 1% for that share and 2% for the \"at most\" figure. A simple rule by year built clears 100.0% of the test lines and the model clears 94.7%, so the model adds nothing over the rule. For lines built in the 1940s, the lines the model called not lead were lead 2.0% of the time, against 0.03% overall. No group may be more than 1 percentage point above the overall rate.",
 "reasons": [
  "cleared share 0.9466 is not above the year-built rule's 1.0000; abstain rate 0.0534 against 0.0000",
  "false non-lead gap exceeds 0.01 for decade_built:1940",
  "release bound fails on records-only clears of lead or GRR: decade 1920 0.31% (upper 2.11%); decade 1940 2.07% (upper 3.88%)"
 ],
 "metrics": {
  "model": "lightgbm",
  "values": {
   "brier_lead": {
    "estimate": 0.0003388093114748336,
    "lower": 0.00027376043595919556,
    "upper": 0.00040686849337091705,
    "level": 0.95
   },
   "brier_multiclass": {
    "estimate": 0.0006776186275699534,
    "lower": 0.0005475208781304177,
    "upper": 0.0008137369891330517,
    "level": 0.95
   },
   "brier_reliability": {
    "estimate": 2.5829643494591136e-08,
    "lower": 8.126822123583593e-09,
    "upper": 1.4739123403693204e-07,
    "level": 0.95
   },
   "brier_resolution": {
    "estimate": 1.6667691164377228e-06,
    "lower": 9.62514554837711e-07,
    "upper": 2.598000443924272e-06,
    "level": 0.95
   },
   "brier_uncertainty": {
    "estimate": 0.0004548802935311851,
    "lower": 0.000347541736007994,
    "upper": 0.0005564586083579578,
    "level": 0.95
   },
   "lead_found_top_decile": {
    "estimate": 162.6,
    "lower": 124.955,
    "upper": 202.925,
    "level": 0.95
   },
   "log_loss": {
    "estimate": 0.001407359502713376,
    "lower": 0.001126620214151554,
    "upper": 0.0017404281703563879,
    "level": 0.95
   },
   "pr_auc_lead": {
    "estimate": 0.33231627302999106,
    "lower": 0.271500527147005,
    "upper": 0.405540994286563,
    "level": 0.95
   },
   "pr_auc_macro": {
    "estimate": 0.6661461079496049,
    "lower": 0.6357293451373062,
    "upper": 0.7027621149926631,
    "level": 0.95
   },
   "pr_auc_non_lead": {
    "estimate": 0.9999759428692192,
    "lower": 0.9999575730641439,
    "upper": 0.9999901758055172,
    "level": 0.95
   },
   "recall_at_precision_0_8": {
    "estimate": 0.0029239766081871343,
    "lower": 0.001129167442726765,
    "upper": 0.02256451878707976,
    "level": 0.95
   },
   "roc_auc_lead": {
    "estimate": 0.9717511789258875,
    "lower": 0.9530041949488859,
    "upper": 0.9870737151474448,
    "level": 0.95
   },
   "roc_auc_macro": {
    "estimate": 0.971751240429039,
    "lower": 0.9530042022040286,
    "upper": 0.9870736048235791,
    "level": 0.95
   },
   "roc_auc_non_lead": {
    "estimate": 0.9717513019321908,
    "lower": 0.953004209459171,
    "upper": 0.9870734944997133,
    "level": 0.95
   }
  }
 },
 "sufficiency": {
  "lead_blocks_h3_7": 15,
  "min_lead_blocks": 5,
  "min_verified_leads": 100,
  "verified_leads": 171,
  "verified_mask": "absent"
 },
 "expected_lead_per_cell": null,
 "estimate": null,
 "counts": {
  "lines": 384888,
  "with_year": 384870,
  "with_coords": 384888,
  "recorded": {
   "unknown": 9118,
   "non_lead": 375599,
   "lead": 171
  },
  "labels_used": {
   "unknown": 9118,
   "non_lead": 375599,
   "lead": 171
  },
  "model_made_categories_read_as_unlabelled": 0,
  "verified_labels": null
 },
 "frame": "Every public (City-side) water service line in the City's layer.",
 "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": null,
 "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": "0b808dd530ab2ba9c9bcefbacec390ceb7e1a8fe",
  "runtime_seconds": {
   "load": 3.3,
   "train_and_check": 11768.1
  },
  "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": 63,
   "lines": 281
  },
  "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 Calgary",
  "page": "https://data.calgary.ca/Environment/Public-Water-Service-Lines/ta76-7bfx",
  "source_url": "https://data.calgary.ca/Environment/Public-Water-Service-Lines/ta76-7bfx",
  "licence": "Open Government Licence - City of Calgary, version 2.1",
  "licence_url": "https://data.calgary.ca/stories/s/Open-Calgary-Terms-of-Use/u45n-7awa",
  "attribution": "Contains information licensed under the Open Government Licence - City of Calgary.",
  "retrieved": "2026-10-24",
  "inputs": [
   {
    "file": "ca-ab-calgary-public-water-service-lines_harmonised.csv.gz",
    "role": "harmonised copy the run read",
    "sha256": "1fe4d64518776be4f2ab7eb5d563ebb608c5c663340906b946e1ba07c5ad9fdf",
    "bytes": 14067220,
    "redistributed": false
   },
   {
    "file": "public_water_service_lines.csv",
    "role": "publisher's file as downloaded",
    "sha256": "05257d8a8a81027416054a83e463e73cb70da5437e8b6e062e2c1075042eb4f9",
    "bytes": 51139738,
    "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": [
  -114.28695,
  50.8511,
  -113.88329,
  51.19759
 ],
 "clearance": {
  "baseline_share": 0.9999680640422406,
  "min_share": 0.05,
  "non_lead_calls": 355700,
  "scored_rows": 375752,
  "sentence": null,
  "share": 0.9466350145840874,
  "useful": true
 },
 "release_bound": {
  "status": "fail",
  "basis": "records_only",
  "miss_classes": [
   "LEAD",
   "GRR"
  ],
  "confidence": 0.9833333333333333,
  "candidates": 3,
  "decade_support": 203,
  "summary": "release bound fails on records-only clears of lead or GRR: decade 1920 0.31% (upper 2.11%); decade 1940 2.07% (upper 3.88%)",
  "statement": "Records only: the city marks no lines as checked in the field. Of the model's not-lead calls on test lines, the city's records show 0.03% as lead or galvanized pipe needing replacement; with 98.33% confidence the share is at most 0.05%. This is agreement with the records, not what was found in the ground, so it cannot unlock answers about single homes. The model makes no call for lines built in the 1910s: too few labelled lines there to judge it.",
  "reasons": [
   "Lines built in the 1920s: across 10 test runs, the city's records show 9 of the model's 2,902 not-lead calls (0.31%) as lead or galvanized pipe needing replacement, at most 2.11% with 98.33% confidence.",
   "Lines built in the 1940s: across 10 test runs, the city's records show 963 of the model's 46,485 not-lead calls (2.07%) as lead or galvanized pipe needing replacement, at most 3.88% with 98.33% confidence.",
   "The limits are 1.00% for the share of misses and 2.00% for its upper bound, in each decade and over all decades judged."
  ],
  "overall": {
   "calls": 3640485,
   "misses": 1064,
   "point": 0.0002922687499055758,
   "upper": 0.0005365540886762942,
   "lead_misses": 1064,
   "lead_point": 0.0002922687499055758,
   "lead_upper": 0.0004944019474837295
  },
  "decades": [
   {
    "decade": "1900",
    "status": "no calls",
    "judged_calls": 0,
    "misses": 0,
    "point": 0.0,
    "upper": 1.0
   },
   {
    "decade": "1910",
    "status": "withdrawn",
    "judged_calls": 2000,
    "misses": 20,
    "point": 0.01,
    "upper": 0.05877542474847704
   },
   {
    "decade": "1920",
    "status": "fail",
    "judged_calls": 2902,
    "misses": 9,
    "point": 0.0031013094417643005,
    "upper": 0.02110381734292397
   },
   {
    "decade": "1930",
    "status": "pass",
    "judged_calls": 27203,
    "misses": 10,
    "point": 0.00036760651398742785,
    "upper": 0.0022719827599924506
   },
   {
    "decade": "1940",
    "status": "fail",
    "judged_calls": 46485,
    "misses": 963,
    "point": 0.020716360116166507,
    "upper": 0.038826384292962715
   },
   {
    "decade": "1950",
    "status": "pass",
    "judged_calls": 260069,
    "misses": 19,
    "point": 7.30575347311675e-05,
    "upper": 0.0003055965208390621
   },
   {
    "decade": "1960",
    "status": "pass",
    "judged_calls": 320942,
    "misses": 0,
    "point": 0.0,
    "upper": 0.00012985944466048505
   },
   {
    "decade": "1970",
    "status": "pass",
    "judged_calls": 612625,
    "misses": 10,
    "point": 1.6323199347072025e-05,
    "upper": 0.00010249998403784946
   },
   {
    "decade": "1980",
    "status": "pass",
    "judged_calls": 329732,
    "misses": 17,
    "point": 5.1557022066405446e-05,
    "upper": 0.00024480505973156834
   },
   {
    "decade": "1990",
    "status": "pass",
    "judged_calls": 545090,
    "misses": 18,
    "point": 3.3022069749949546e-05,
    "upper": 0.00014484752759456055
   },
   {
    "decade": "2000",
    "status": "pass",
    "judged_calls": 656061,
    "misses": 18,
    "point": 2.7436473132833686e-05,
    "upper": 0.00012225752782765798
   },
   {
    "decade": "2010",
    "status": "pass",
    "judged_calls": 486934,
    "misses": 0,
    "point": 0.0,
    "upper": 8.837913938974928e-05
   },
   {
    "decade": "2020",
    "status": "pass",
    "judged_calls": 352442,
    "misses": 0,
    "point": 0.0,
    "upper": 0.00011946251924355167
   }
  ],
  "withdrawn_decades": [
   "1910"
  ],
  "limits": {
   "share": 0.01,
   "upper": 0.02
  },
  "weighted": null,
  "meaning": "Each of the 10 test runs' calls of not lead, on the lines the city checked in the field (or, records only, on every labelled line). A miss is lead or galvanized pipe needing replacement. Calls are summed over the runs, so a line counts once a run. The upper value is the worst run's at the stated confidence: an exact binomial bound, widened where misses cluster on the map. A decade with too few judged calls is withdrawn: the model makes no call there."
 },
 "plain": {
  "decision": "FAIL",
  "headline": "The model failed the check.",
  "notes": [
   "Records only: the city marks no lines as checked in the field. Of the model's not-lead calls on test lines, the city's records show 0.03% as lead or galvanized pipe needing replacement; with 98.33% confidence the share is at most 0.05%. This is agreement with the records, not what was found in the ground, so it cannot unlock answers about single homes. The model makes no call for lines built in the 1910s: too few labelled lines there to judge it."
  ],
  "reasons": [
   "A simple rule by year built clears 100.0% of the test lines and the model clears 94.7%, so the model adds nothing over the rule.",
   "For lines built in the 1940s, 2.00% of the lines the model called not lead were lead, against 0.03% overall. No group may be more than 1 percentage point above the overall rate.",
   "Lines built in the 1920s: across 10 test runs, the city's records show 9 of the model's 2,902 not-lead calls (0.31%) as lead or galvanized pipe needing replacement, at most 2.11% with 98.33% confidence.",
   "Lines built in the 1940s: across 10 test runs, the city's records show 963 of the model's 46,485 not-lead calls (2.07%) as lead or galvanized pipe needing replacement, at most 3.88% with 98.33% confidence.",
   "The limits are 1.00% for the share of misses and 2.00% for its upper bound, in each decade and over all decades judged."
  ]
 },
 "false_non_lead": {
  "rate": 0.00029734678206631246,
  "upper": 0.0003441672943276403,
  "non_lead_calls": 355700,
  "seed_summary": {
   "failing_seeds": 0,
   "rate_max": 0.0004222223417473013,
   "rate_mean": 0.00029734678206631246,
   "rate_mean_ci95": [
    0.0002642540278145566,
    0.0003304395363180683
   ],
   "rate_min": 0.0002113747042126704,
   "rate_sd": 5.339208034886212e-05,
   "seeds": 10,
   "seeds_with_calls": 10,
   "upper_mean": 0.0003441672943276403
  },
  "meaning": "Of the held-out lines the model called not lead, the share that the records say are lead, as the mean over the release runs. It counts lead only, not galvanized pipe requiring replacement. Upper is an average of the runs' own interval ends, not a bound on the mean: a single run can be above it. Kept for comparison; the check now judges release_bound (ADR 0019)."
 },
 "false_non_lead_field_checked": null,
 "calibration": {
  "ece_lead_equal_width": 0.00012843958941498833,
  "ece_lead_equal_mass": 3.0791842789648485e-05,
  "slope": 1.082277882863107,
  "intercept": 0.13939722843985436,
  "log_loss_improvement": {
   "estimate": 0.002255758340060717,
   "excludes_zero": true,
   "level": 0.95,
   "lower": 0.0017636582539805005,
   "upper": 0.0028218093843334125
  }
 },
 "equity_failures": [
  {
   "group": "decade_built:1940",
   "rate": 0.02003446790176648,
   "overall": 0.00029519257801518135,
   "gap": 0.0197392753237513,
   "lines": 4801.0,
   "recorded_lead": 158
  }
 ],
 "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.",
  "The other false non-lead figures in this report count lead only and are kept for comparison, not as the check's bound. The one against the records is the mean of the 10 test runs.",
  "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."
 ]
}