'Total spending' semantics: design cog_spending()/docs so colloquial total-spending queries resolve to the right concept #6

Closed
opened 2026-07-23 10:37:37 -04:00 by jared · 0 comments
Owner

Companion to census_of_governments_finance_pipeline#28 (Option B ruling, 2026-07-23) and #42 there.

Context. The corpus will publish ONE aggregate row per legacy family = the Direct-expenditure flavor; Census's "Total" concept = Direct + the function's M-code (intergovernmental), an exact identity. Owner directive: colloquial "total spending" questions are first-class — "total spending in my county, 2017 vs today" (single-gov trend) and "all counties in my state, 10 years ago vs today vs the neighboring state" (cross-gov rollup). The second shape MUST use Direct (summing Total double-counts intergovernmental flows).

Design work in this package:

  1. Decide the surfaced concept(s) in cog_spending() and the rollup/peer verbs: e.g. an explicit concept = c("direct", "total") argument with direct default, where total adds the M-code rows and is refused/warned for cross-government rollups (cog_geographic_rollup, cog_peer_compare) unless intergovernmental de-duplication is explicitly acknowledged.
  2. Provenance attr should state which concept a result used.
  3. README + a vignette anchored on the two archetype questions, with worked code.
  4. Signposting: when a user filters aggregate codes, the coverage/recipe machinery should mention the concept choice where relevant.
  5. Regenerate the fixture corpus once the pipeline change lands; expect pinned aggregate counts in tests to change (adjudicate against the #28 ruling, per the e813ffd discipline).
Companion to census_of_governments_finance_pipeline#28 (Option B ruling, 2026-07-23) and #42 there. **Context.** The corpus will publish ONE aggregate row per legacy family = the Direct-expenditure flavor; Census's "Total" concept = Direct + the function's M-code (intergovernmental), an exact identity. Owner directive: colloquial "total spending" questions are first-class — "total spending in my county, 2017 vs today" (single-gov trend) and "all counties in my state, 10 years ago vs today vs the neighboring state" (cross-gov rollup). The second shape MUST use Direct (summing Total double-counts intergovernmental flows). **Design work in this package:** 1. Decide the surfaced concept(s) in `cog_spending()` and the rollup/peer verbs: e.g. an explicit `concept = c("direct", "total")` argument with `direct` default, where `total` adds the M-code rows and is refused/warned for cross-government rollups (`cog_geographic_rollup`, `cog_peer_compare`) unless intergovernmental de-duplication is explicitly acknowledged. 2. Provenance attr should state which concept a result used. 3. README + a vignette anchored on the two archetype questions, with worked code. 4. Signposting: when a user filters aggregate codes, the coverage/recipe machinery should mention the concept choice where relevant. 5. Regenerate the fixture corpus once the pipeline change lands; expect pinned aggregate counts in tests to change (adjudicate against the #28 ruling, per the e813ffd discipline).
jared closed this issue 2026-07-27 13:13:02 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Civilytics/uscogdata#6