Returned amounts are full US dollars; the x1000 conversion is undocumented in reader-facing docs #15
Closed
opened 2026-07-29 00:05:29 -04:00 by jared
·
2 comments
No Branch/Tag Specified
main
ci/mirror-canonical-tags
chore/release-47-badges-mirror-pr
docs/readme-perf-remeasure-56
feat/pagination-search-balances-57
feat/duckdb-threads-60
feat/cohort-predicates-58
fix/windows-backslash-paths
ci/mirror-to-github
ci/github-actions-matrix
feat/public-release-0.3.0
chore/fixture-sb203
ci/apt-https
fix/pushdown-pagination
feat/all-categories-37
fix/partial-coverage-signposting-9
fix/schema-v7
fix/cog-categories-balance-subtype
feat/cog-balances-25
feat/revenue-concepts-12
feat/expenditure-concepts-11
feat/coverage-disclosure-13
feat/complete-argument-18
fix/kodor-batch-14-15-16
fix/all-scoped-series-breaks-19
fix/regen-fixture-corpus-18
test/walkthrough-findings
feat/expenditure-concept
fix/3-url-trailing-slash
feat/phase-r3-signposting
fix/fixture-option-b-aggregates
feat/phase-r2-harmonization
feat/phase-r1-forward
feat/cog-gov-search-basket-mode
v0.4.0
Labels
Clear labels
kodor
kodor/feature-proposal
kodor/fix
kodor/needs-review
kodor/triaged
madison-walkthrough
severity/high
severity/low
severity/medium
south-guide
verdict/defect
verdict/definitional
kodor
kodor/feature-proposal
kodor/fix
kodor/needs-review
kodor/triaged
Kodor should process this issue
Kodor has written a feature proposal
Kodor should implement a fix (assigned to Kodor)
Kodor's work or failure needs Jared's review
Kodor has already triaged this issue (skip)
Surfaced while building the client-facing Southern API guide
needs
human
Cannot move without a person -- a decision, a check an agent cannot make, something outside the repo
origin
client
Came from a client ask
origin
obligation
Created by a change elsewhere
origin
review
Came from human review
origin
roborev
Promoted from a roborev finding
type
chore
Maintenance with no behaviour change
type
debt
Owed work -- docs, tests, cleanup a change obligated
type
decision
Needs a decision before work can proceed
type
defect
Something is wrong
type
feature
New capability
ws
api
Query verbs and results
ws
corpus
Corpus, mirror, provenance
ws
docs
Vignettes and guides
Assign a task to kodor
Kodor thinks this needs a feature.
Kodor should fix this
Kodor thinks the user is ready to review this.
Kodor is done with this issue.
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Civilytics/uscogdata#15
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Filed from the Madison walkthrough audit (
cog_explorer/docs/walkthroughs/FINDINGS.md, 2026-07-28). Verdict: definitional — the package's behaviour is the friendlier choice and is not wrong; the conversion is simply not stated where most readers meet the package.Root cause
The raw Census source files report thousands of dollars.
uscogdatamultiplies by 1000 and returnsamt_nominal,amt_real,amt_per_capita_nominal, andamt_per_capita_realin full US dollars. The conversion is real, correct, and recorded in the return value's provenance:Meanwhile
cog_explorer'sCLAUDE.mdstates, correctly of the rawamtcolumn and misleadingly of everything else: "All rawamtvalues are in $1,000s." A reader who applies that rule toamt_nominaloverstates every figure by 1000x.Where it is and isn't already documented (checked 2026-07-29, after the audit was written)
?cog_spending/man/cog_spending.Rd@return?cog_revenue/man/cog_revenue.Rd@returnprovenance$transformations$units_conversionREADME.mdvignettes/total-spending.Rmd,vignettes/population-denominators.Rmdcog-api'sdata-dictionary.mdcog-api'sllms.txt— the agent-facing surfacecog_explorer/CLAUDE.mdSo the finding's proposed data-dictionary sentence has partly landed already. What remains is that a reader who meets this package through its README, a vignette, the agent-facing
llms.txt, orcog_explorer's own conventions doc gets no signal at all — and one of those actively points the wrong way.Findings resolved
amt_nominalis full dollars, not the raw $1,000sReproduction (verbatim from FINDINGS.md, verified against the live corpus)
Why it matters
This is the highest-consequence definitional gap the audit found. A 1000x overstatement produces a plausible-looking dollar amount, not an obvious error — nothing downstream will flag it. The correction is entirely available to the reader; it just isn't where the reader is.
Definition of done
README.mdstates the units once, in the first place a returned data frame is shown. The audit's proposed wording:Both vignettes carry the same statement where they first print amounts.
Secondary task,
cog_explorer/CLAUDE.md: its Data Conventions section needs a clause distinguishing rawamt(thousands) fromamt_nominaland friends (full dollars).cog_explorerhas no git remote, so it cannot carry its own issue; recorded here because this package performs the conversion. Whoever fixes (1) should make that edit in the same pass.Secondary task,
cog-api:llms.txtshould carry the same sentence —data-dictionary.mdalready does, butllms.txtis the surface this API names for agent consumption and it is silent on units.Test goes green:
tests/testthat/test-amount-units-documented.R→test_that("returned amounts are documented as full US dollars where readers meet the package", ...). It assertsREADME.mdand both vignettes state the conversion, and pins it numerically against the fixture — Madison FY2020amt_nominalsums to exactly1000 ×the raw corpus'samtfor the same government-year, read straight from the parquet partitions rather than through the verb — so the documented claim and the behaviour cannot drift apart. It deliberately does not assert on the.Rdfiles, which already carry the statement. Remove theskip()on line 1 of the test body to activate.Severity: high. Verdict: definitional (documentation, plus a disclosure already present in provenance that the prose should point at).
Taking this over. No kodor activity since assignment on 2026-07-29 — no branch, no PR, no comment — so I am picking it up rather than leaving it queued. Reassign back if kodor is simply slow and you would rather it land there; I will not push until this repo is otherwise quiet.
Being fixed together with the other two
kodor/fixissues in one PR: they are all single-file, all have committed acceptance tests, and two of them touch the same documentation surfaces.Fixed and merged in PR #22 (
8db944eonmain). Closing manually: that PR said "Closes #16, #15, #14", and Gitea only parsed the first reference, so #16 auto-closed while this one stayed open. The keyword needs repeating per issue.Verified present on
main, not just claimed.