Skip to content

docs: a sheriff-contract city is not a real zero for Police (#80) - #3

Merged
jknowles merged 1 commit into
mainfrom
claude/great-knuth-4jky3n-issue-80
Nov 4, 2026
Merged

jknowles merged 1 commit into
mainfrom
claude/great-knuth-4jky3n-issue-80

Conversation

@jknowles

@jknowles jknowles commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Gitea issue #80

Finding

The docs said a city that contracts policing to the county sheriff lands among collected governments with no Police rows, and that its Police spending "is a real zero". The published corpus does not support either half of that.

I checked 34 cities with documented sheriff contracts (Los Angeles, San Diego and Orange counties, CA; King County, WA) in FY2012, FY2017 and FY2022. All 102 city-years were collected, and every one carries Police spending:

Police rows that city-year City-years
Direct (E62/F62/G62) and intergovernmental (M62) 39
Direct only 54
Intergovernmental (M62) only 9
Neither 0
  • 93 city-years have direct Police rows, so under the default "primary" concept the city counts as reporting. It is not in the "collected, no rows" group at all.
  • Nine city-years report the contract payment only as intergovernmental Police expenditure (M62, payments to other local governments). "primary" and "direct" leave that out, so these land in the "collected, no Police rows" group. They are still paying for policing: $17,000 to $15.6 million.

The sample is 34 cities in two states, four sheriffs and three census years, not a random draw. The corrected docs report what was found and for how many cities. They do not claim a rate for all contract cities.

What changed (docs only; no code)

  • vignettes/coverage-counters.Rmd
    • The three-group list (former line 75) no longer says the spending is a real zero. It says the default concept leaves out intergovernmental expenditure, so a contract city that reports the payment that way lands in group two while still paying for policing.
    • A new paragraph after the list gives the 34-city / 102-city-year result and points to expenditure_concept = "total" for one government.
    • The FY2022 Georgia paragraph now says a contract city lands in group two only when it reports no direct Police spending.
  • R/peers.R, R/rollup.R (the "Reading coverage" section; former lines 254 and 74)
    • The n_units_reporting bullet is corrected.
    • The adjacent n_units_collected bullet ("separating sampling from real zeros") and the ratio sentence ("real zeros (collected but spends nothing in your category)") made the same claim, so they are reworded too.
    • The FY2022 Georgia sentence is aligned with the vignette.
  • R/coverage.R (.coverage_table() roxygen, @noRd; former line 101): the same bullet and ratio-sentence corrections. The two code comments inside the function body (lines 137 and 145) are untouched, per the brief.
  • man/cog_peer_compare.Rd, man/cog_geographic_rollup.Rd: regenerated with roxygen2 7.3.3, which matches RoxygenNote, so DESCRIPTION is unchanged. Regenerating main without these edits produces no diff, so the .Rd changes are only these edits.

Per-city table

Source: public API, per-government route GET /api/v1/governments/{govid}/spending?years=2012,2017,2022&category=Police&expenditure_concept=total. Corpus build 2026-10-26T22:13:24Z, pipeline commit fccd87c, schema 7, the same in every response. "Collected" means the city has any Direct row that year (GET /api/v1/spending?category=All Categories&expenditure_concept=direct). Amounts are full US dollars.

City Sheriff govid FY Collected Direct Police (E/F/G) Codes Intergovernmental Police Codes
Lakewood, CA LASD 062037183827 2012 yes $2,923,000 E62 $8,473,000 M62
Lakewood, CA LASD 062037183827 2017 yes $12,267,000 E62 none -
Lakewood, CA LASD 062037183827 2022 yes $14,808,000 E62,F62 none -
Carson, CA LASD 062037183833 2012 yes $11,124,000 E62,G62 $10,972,000 M62
Carson, CA LASD 062037183833 2017 yes $24,792,000 E62,G62 $16,780,000 M62
Carson, CA LASD 062037183833 2022 yes $24,091,000 E62 none -
Cerritos, CA LASD 062037161168 2012 yes $1,337,000 E62,G62 $12,253,000 M62
Cerritos, CA LASD 062037161168 2017 yes $12,959,000 E62,G62 $13,341,000 M62
Cerritos, CA LASD 062037161168 2022 yes $17,615,000 E62 none -
Norwalk, CA LASD 062037123117 2012 yes $13,363,000 E62 none -
Norwalk, CA LASD 062037123117 2017 yes $13,904,000 E62 none -
Norwalk, CA LASD 062037123117 2022 yes $20,487,000 E62,F62 none -
Palmdale, CA LASD 062037183832 2012 yes $19,731,000 E62 none -
Palmdale, CA LASD 062037183832 2017 yes $23,961,000 E62 none -
Palmdale, CA LASD 062037183832 2022 yes $32,600,000 E62 none -
Santa Clarita, CA LASD 062037137232 2012 yes $18,878,000 E62 none -
Santa Clarita, CA LASD 062037137232 2017 yes $23,219,000 E62 none -
Santa Clarita, CA LASD 062037137232 2022 yes $32,341,000 E62,F62 none -
West Hollywood, CA LASD 062037123115 2012 yes none - $15,311,000 M62
West Hollywood, CA LASD 062037123115 2017 yes $21,731,000 E62 $18,230,000 M62
West Hollywood, CA LASD 062037123115 2022 yes $27,844,000 E62,F62 none -
Diamond Bar, CA LASD 062037161186 2012 yes none - $5,449,000 M62
Diamond Bar, CA LASD 062037161186 2017 yes $6,351,000 E62 none -
Diamond Bar, CA LASD 062037161186 2022 yes $7,590,000 E62 none -
Calabasas, CA LASD 062037123114 2012 yes $4,298,000 E62 none -
Calabasas, CA LASD 062037123114 2017 yes $4,457,000 E62 none -
Calabasas, CA LASD 062037123114 2022 yes $5,267,000 E62 none -
Lancaster, CA LASD 062037184451 2012 yes $6,102,000 E62 $21,424,000 M62
Lancaster, CA LASD 062037184451 2017 yes $29,684,000 E62 none -
Lancaster, CA LASD 062037184451 2022 yes $6,896,000 E62 none -
Del Mar, CA SDSO 062073123151 2012 yes $2,447,000 E62 none -
Del Mar, CA SDSO 062073123151 2017 yes $2,854,000 E62 none -
Del Mar, CA SDSO 062073123151 2022 yes $3,461,000 E62 none -
Encinitas, CA SDSO 062073183843 2012 yes $11,400,000 E62 none -
Encinitas, CA SDSO 062073183843 2017 yes $13,567,000 E62 $12,583,000 M62
Encinitas, CA SDSO 062073183843 2022 yes $13,486,000 E62,F62 none -
Imperial Beach, CA SDSO 062073207597 2012 yes $1,726,000 E62,G62 $5,597,000 M62
Imperial Beach, CA SDSO 062073207597 2017 yes $8,643,000 E62 none -
Imperial Beach, CA SDSO 062073207597 2022 yes $9,683,000 E62 none -
Lemon Grove, CA SDSO 062073201368 2012 yes $4,460,000 E62,G62 none -
Lemon Grove, CA SDSO 062073201368 2017 yes $5,637,000 E62,G62 $5,237,000 M62
Lemon Grove, CA SDSO 062073201368 2022 yes $6,831,000 E62 none -
Poway, CA SDSO 062073100729 2012 yes $10,476,000 E62,G62 none -
Poway, CA SDSO 062073100729 2017 yes $12,061,000 E62,G62 $10,440,000 M62
Poway, CA SDSO 062073100729 2022 yes $14,803,000 E62,F62 none -
San Marcos, CA SDSO 062073161257 2012 yes $508,000 G62 $14,151,000 M62
San Marcos, CA SDSO 062073161257 2017 yes $17,949,000 E62,G62 $17,101,000 M62
San Marcos, CA SDSO 062073161257 2022 yes $22,637,000 E62 none -
Santee, CA SDSO 062073123152 2012 yes none - $10,673,000 M62
Santee, CA SDSO 062073123152 2017 yes $13,581,000 E62 $13,548,000 M62
Santee, CA SDSO 062073123152 2022 yes $17,190,000 E62,F62 none -
Solana Beach, CA SDSO 062073183864 2012 yes $3,004,000 E62,G62 none -
Solana Beach, CA SDSO 062073183864 2017 yes $5,098,000 E62,G62 $3,715,000 M62
Solana Beach, CA SDSO 062073183864 2022 yes $8,044,000 E62,F62 none -
Vista, CA SDSO 062073211981 2012 yes none - $17,551,000 M62
Vista, CA SDSO 062073211981 2017 yes $23,765,000 E62 $40,830,000 M62
Vista, CA SDSO 062073211981 2022 yes $28,706,000 E62 none -
Mission Viejo, CA OCSD 062059161225 2012 yes $96,000 G62 $15,559,000 M62
Mission Viejo, CA OCSD 062059161225 2017 yes $20,205,000 E62,F62 none -
Mission Viejo, CA OCSD 062059161225 2022 yes $21,438,000 E62 none -
Lake Forest, CA OCSD 062059211208 2012 yes none - $12,540,000 M62
Lake Forest, CA OCSD 062059211208 2017 yes $15,935,000 E62 none -
Lake Forest, CA OCSD 062059211208 2022 yes $19,035,000 E62,F62 none -
Dana Point, CA OCSD 062059184457 2012 yes none - $9,588,000 M62
Dana Point, CA OCSD 062059184457 2017 yes $11,667,000 E62 $12,621,000 M62
Dana Point, CA OCSD 062059184457 2022 yes $8,946,000 E62,F62 none -
Laguna Niguel, CA OCSD 062059183838 2012 yes none - $9,423,000 M62
Laguna Niguel, CA OCSD 062059183838 2017 yes $12,193,000 E62 $11,593,000 M62
Laguna Niguel, CA OCSD 062059183838 2022 yes $16,232,000 E62,F62 none -
Burien, WA KCSO 532033176843 2012 yes $88,000 E62,F62,G62 $9,346,000 M62
Burien, WA KCSO 532033176843 2017 yes $68,000 E62 $11,085,000 M62
Burien, WA KCSO 532033176843 2022 yes $12,736,000 E62 none -
Covington, WA KCSO 532033211887 2012 yes $22,000 E62 $2,787,000 M62
Covington, WA KCSO 532033211887 2017 yes $18,000 E62 $3,771,000 M62
Covington, WA KCSO 532033211887 2022 yes $5,078,000 E62,F62 none -
Kenmore, WA KCSO 532033209729 2012 yes $129,000 E62,G62 $2,677,000 M62
Kenmore, WA KCSO 532033209729 2017 yes $95,000 E62,G62 $3,205,000 M62
Kenmore, WA KCSO 532033209729 2022 yes $3,317,000 E62,F62 none -
Maple Valley, WA KCSO 532033184252 2012 yes $388,000 E62,G62 $3,063,000 M62
Maple Valley, WA KCSO 532033184252 2017 yes $173,000 E62 $4,036,000 M62
Maple Valley, WA KCSO 532033184252 2022 yes $5,163,000 E62,F62 none -
Newcastle, WA KCSO 532033114631 2012 yes $22,000 E62 $1,473,000 M62
Newcastle, WA KCSO 532033114631 2017 yes $5,000 E62 $2,075,000 M62
Newcastle, WA KCSO 532033114631 2022 yes $2,613,000 E62 none -
Sammamish, WA KCSO 532033176845 2012 yes $115,000 E62 $4,145,000 M62
Sammamish, WA KCSO 532033176845 2017 yes $149,000 E62 $6,469,000 M62
Sammamish, WA KCSO 532033176845 2022 yes $7,981,000 E62 none -
SeaTac, WA KCSO 532033176842 2012 yes $403,000 E62 $8,252,000 M62
SeaTac, WA KCSO 532033176842 2017 yes $353,000 E62 $9,353,000 M62
SeaTac, WA KCSO 532033176842 2022 yes $12,647,000 E62,F62 none -
Shoreline, WA KCSO 532033176844 2012 yes $113,000 E62,F62 $9,903,000 M62
Shoreline, WA KCSO 532033176844 2017 yes $2,086,000 E62,F62,G62 $11,019,000 M62
Shoreline, WA KCSO 532033176844 2022 yes $72,000 F62 none -
Woodinville, WA KCSO 532033205591 2012 yes $109,000 E62 $2,289,000 M62
Woodinville, WA KCSO 532033205591 2017 yes $141,000 E62 $3,073,000 M62
Woodinville, WA KCSO 532033205591 2022 yes $4,052,000 E62 none -
Carnation, WA KCSO 532033176834 2012 yes $11,000 E62 $542,000 M62
Carnation, WA KCSO 532033176834 2017 yes $12,000 E62 $485,000 M62
Carnation, WA KCSO 532033176834 2022 yes $549,000 E62,F62 none -
Skykomish, WA KCSO 532033176841 2012 yes none - $17,000 M62
Skykomish, WA KCSO 532033176841 2017 yes none - $26,000 M62
Skykomish, WA KCSO 532033176841 2022 yes $20,000 E62 none -

Contract citations

I found these through web search. The sandbox's network policy blocks every cited host, so I could not open the pages; each citation rests on the search tool's extract. LASD = Los Angeles County Sheriff's Department, SDSO = San Diego County Sheriff's Office, OCSD = Orange County Sheriff's Department, KCSO = King County Sheriff's Office.

Verified

  • The API shows intergovernmental Police rows. For example, Lakewood FY2012 has M62 = $8,473,000 on /governments/062037183827/spending?expenditure_concept=total.
  • Every value in the table comes from the API responses above, which all report the 2026-10-26 build (fccd87c, schema 7).
  • The tallies: 0 of 102 city-years have no Police spending, 93 have direct Police rows, and nine have intergovernmental Police rows only.
  • No M62 in FY2022: none of the 34 cities has an M62 row; all report direct Police rows (Shoreline only $72,000 of F62).
  • Build and tests: roxygen regeneration changes only the two .Rd files, and DESCRIPTION is unchanged. The full suite passes locally (1,108 expectations, 0 failed, 2 opt-in live-corpus skips). The vignette renders. As before, the sandbox can't reach extensions.duckdb.org, so local runs drop cog_open()'s INSTALL httpfs; LOAD httpfs; line in a scratch copy; that is not in the commit.

Not verified

  • Contract dates. I did not confirm that each city's contract was in force in each of FY2012, FY2017 and FY2022. The sources describe current or long-standing contracts, and many cities have contracted since incorporation.
  • What the direct E62 rows are. For the cities with large direct Police rows (e.g., Palmdale, Santa Clarita), the size suggests the contract payment is coded as direct operations. Nothing here distinguishes contract payments from city-employed staff.
  • Shoreline FY2022. It reports $13,228,000 of M89 (intergovernmental, "General Government"), against $11,019,000 of M62 Police in FY2017. That may be the sheriff contract filed under a catch-all code outside Police. It is not confirmed.
  • Generalization. These are 34 cities with documented contracts, chosen from four sheriffs' lists, in census years only. I did not measure what share of the 142 FY2022 Georgia cities in group two contract, or how sample years behave.

Noticed, not changed

  • Possible double counting in FY2017. 22 of the 34 cities carry both direct (E/F/G62) and intergovernmental (M62) Police in FY2017. In nine of them the smaller amount is at least 80% of the larger:

    • Cerritos, West Hollywood, Encinitas, Lemon Grove, Poway, San Marcos, Dana Point and Laguna Niguel
    • Santee: $13,581,000 direct and $13,548,000 intergovernmental

    If both describe the same contract payment, expenditure_concept = "total" double-counts it for those city-years. This needs a data-quality issue against the pipeline.

  • Coding shift between FY2017 and FY2022. No city in the sample has M62 in FY2022, while most King County cities report the contract as M62 in FY2012 and FY2017.

  • Remaining "real zero" wording in code and tests:

    • code comments in R/coverage.R:137 and :145
    • tests/testthat/test-coverage-disclosure.R:114 (test name) and :120 (comment)
    • tests/testthat/test-all-categories-rollup.R:54 (comment)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qbe6u2h83wgZdTgJgE4Xh5

The coverage docs said a city that contracts policing to the county
sheriff has no Police rows and that its Police spending "is a real zero".
Checked against the published corpus (build of 2026-10-26) through the
public API for 34 cities with documented sheriff contracts (Los Angeles,
San Diego and Orange counties, CA; King County, WA) in FY2012, FY2017
and FY2022: all 102 city-years carry Police spending. 93 have direct
Police rows (E62/F62/G62) and so count as reporting. The other nine
report the contract payment only as intergovernmental Police expenditure
(M62), which the "primary" and "direct" concepts leave out, so they land
among the collected governments with no Police rows while paying for
policing.

The vignette's three-group list, the n_units_collected and
n_units_reporting bullets in cog_peer_compare(), cog_geographic_rollup()
and .coverage_table(), and the FY2022 Georgia paragraphs now say that a
collected government with no rows in a category can still spend on it,
and that a contract city lands in that group only when it reports no
direct Police spending. man/ regenerated with roxygen2 7.3.3. No code
changed.

Closes #80

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qbe6u2h83wgZdTgJgE4Xh5
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Thanks for this — and one thing worth knowing before it happens.

This repository is a mirror. Development happens on Gitea at
gitea.civilytics.org/Civilytics/uscogdata. Your pull request will be fetched
from here, landed there, and synced back.

Because that merge preserves your commits at their original SHAs, GitHub will
mark this pull request "Merged" on its own
— without anyone visibly clicking
the Merge button, and possibly without a review comment on this page first.

If your pull request closes as "Merged" and nobody appears to have merged it,
that is the normal, successful outcome — not a rejection.

If it is not going to be merged, you will get an actual reply saying so.

Substantial contributions get a ctb entry in DESCRIPTION, which surfaces in
citation("uscogdata"). There is no CLA and no DCO sign-off.

Full details: CONTRIBUTING.md.

@jknowles
jknowles merged commit 957c563 into main Nov 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants