← back to La Socrata Ingester
yoloforever c5 FIX (Cody): gate teardown bonus on valuation>=$500k
00f8def8452781e9581c6824521084e85ab12c4a · 2026-08-12 07:06:10 -0700 · steve
Cody c5: a $250k permit on a $6.9M parcel jumping to 98 rewarded parcel wealth, not
a teardown (that's a garage, not a rebuild). Added valuation>=$500k to the teardown
CASE. Now: $250k/$6.9M example 98->90 (tier only); real $2.16M rebuild keeps +->100.
192 true teardowns flagged; 0 penalized. v2 defensible.
Files touched
Diff
commit 00f8def8452781e9581c6824521084e85ab12c4a
Author: steve <steve@designerwallcoverings.com>
Date: Wed Aug 12 07:06:10 2026 -0700
yoloforever c5 FIX (Cody): gate teardown bonus on valuation>=$500k
Cody c5: a $250k permit on a $6.9M parcel jumping to 98 rewarded parcel wealth, not
a teardown (that's a garage, not a rebuild). Added valuation>=$500k to the teardown
CASE. Now: $250k/$6.9M example 98->90 (tier only); real $2.16M rebuild keeps +->100.
192 true teardowns flagged; 0 penalized. v2 defensible.
---
db/lead_score_v2.sql | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/db/lead_score_v2.sql b/db/lead_score_v2.sql
index dffc2dc..13681a3 100644
--- a/db/lead_score_v2.sql
+++ b/db/lead_score_v2.sql
@@ -17,8 +17,9 @@ CREATE OR REPLACE FUNCTION permit_lead_score_v2(
SELECT LEAST(100, (
permit_lead_score(p_issue_date, p_valuation, p_permit_type, p_sub_type, p_status)
+ LEAST(15,
- -- teardown / redevelopment: ground-up build on a valuable, OLD parcel
- (CASE WHEN p_permit_type = 'Bldg-New' AND p_assessed >= 1000000
+ -- teardown / redevelopment: SUBSTANTIAL ground-up build (>=$500k, not a garage/
+ -- partial) on a valuable, OLD parcel — parcel wealth alone isn't a teardown (Cody c5)
+ (CASE WHEN p_permit_type = 'Bldg-New' AND p_valuation >= 500000 AND p_assessed >= 1000000
AND p_year_built ~ '^[0-9]{4}$' AND (p_year_built)::int BETWEEN 1 AND 1970
THEN 8 ELSE 0 END)
-- parcel assessed-value tier
← 48faabe yoloforever c5: permit_lead_score_v2 — parcel-signal teardow
·
back to La Socrata Ingester
·
yoloforever c6: contractor-market intelligence (scripts/cont e534fb9 →