Low findings from the Nov 4 reviews: version-pinned messages, unstated vintages, cog_suggestions() edges #84

Open
opened 2026-11-13 10:41:48 -05:00 by jared · 1 comment
Owner

Six low findings from roborev reviews 9759 and 9758 of the 2026-11-04 work, promoted so they survive. Each was checked against current main on 2026-11-13.

From review 9759 (c363e19, coverage advice)

  1. Version-pinned messages. R/session.R:120 says "not found in v0.1 corpus", and R/search.R:211 says "(v0.1 scope)". DESCRIPTION is at 0.4.0. Drop "v0.1" from both, and relax the regexes that still accept it (tests/testthat/test-search.R:41,47, tests/testthat/test-spending.R:57).
  2. Counts without a vintage. The FY2022 Georgia counts in R/peers.R:268 and R/rollup.R (567 / 393 / 32 / 142) don't say which corpus build they come from, though the paragraph above them does ("corpus build of 2026-10-26"). Add it, then re-run roxygen.
  3. A test comment overclaims. tests/testthat/test-coverage-disclosure.R:116-121 still calls FY2012 "complete" and says most of the gap is sheriff-contract cities. Nothing in the corpus measures that. Reword it to what the counters support.

From review 9758 (2392808, cog_suggestions())

  1. No warning for an unknown govid. cog_suggestions() never calls .check_govids_in_scope(), so a typo returns list(), which is also what "nothing qualifies" returns, with no hint. Either call it, or document that unknown ids are ignored. Needs a call: should a typo warn here the way the verbs do?
  2. @return overstates the match (R/suggestions.R:90). Its output equals provenance$suggestions only at the default basis = "harmonized" with no recipe. Both basis = "raw" and recipe = calls attach an empty list. Qualify the claim.
  3. File size. R/suggestions.R is 681 lines, and .validate_suggestion_inputs() is about 78. Move the public surface (cog_suggestions(), .SUGGESTION_FLOWS, the validator) into R/suggestions-api.R, and split the validator into two helpers.

Items 1-3 and 5 are documentation or message edits. Item 4 needs a decision first; item 6 is a refactor.

Six low findings from roborev reviews 9759 and 9758 of the 2026-11-04 work, promoted so they survive. Each was checked against current main on 2026-11-13. ## From review 9759 (c363e19, coverage advice) 1. **Version-pinned messages.** `R/session.R:120` says "not found in v0.1 corpus", and `R/search.R:211` says "(v0.1 scope)". DESCRIPTION is at 0.4.0. Drop "v0.1" from both, and relax the regexes that still accept it (`tests/testthat/test-search.R:41,47`, `tests/testthat/test-spending.R:57`). 2. **Counts without a vintage.** The FY2022 Georgia counts in `R/peers.R:268` and `R/rollup.R` (567 / 393 / 32 / 142) don't say which corpus build they come from, though the paragraph above them does ("corpus build of 2026-10-26"). Add it, then re-run roxygen. 3. **A test comment overclaims.** `tests/testthat/test-coverage-disclosure.R:116-121` still calls FY2012 "complete" and says most of the gap is sheriff-contract cities. Nothing in the corpus measures that. Reword it to what the counters support. ## From review 9758 (2392808, cog_suggestions()) 4. **No warning for an unknown govid.** `cog_suggestions()` never calls `.check_govids_in_scope()`, so a typo returns `list()`, which is also what "nothing qualifies" returns, with no hint. Either call it, or document that unknown ids are ignored. *Needs a call:* should a typo warn here the way the verbs do? 5. **@return overstates the match** (`R/suggestions.R:90`). Its output equals `provenance$suggestions` only at the default `basis = "harmonized"` with no `recipe`. Both `basis = "raw"` and `recipe =` calls attach an empty list. Qualify the claim. 6. **File size.** `R/suggestions.R` is 681 lines, and `.validate_suggestion_inputs()` is about 78. Move the public surface (`cog_suggestions()`, `.SUGGESTION_FLOWS`, the validator) into `R/suggestions-api.R`, and split the validator into two helpers. Items 1-3 and 5 are documentation or message edits. Item 4 needs a decision first; item 6 is a refactor.
jared added the
ws
api
type
debt
origin
roborev
labels 2026-11-13 10:41:48 -05:00
Author
Owner

From review 9760 (b6b3e46, fiscal periods, #77)

Four more findings, each checked against current main on 2026-11-13.

  1. No warning for an unknown govid (medium). cog_fiscal_periods() and cog_survey_year() never call .check_govids_in_scope(), so a typo returns a row of NAs that reads as missing data. Same question as item 4: should a typo warn here the way the verbs do?
  2. cog_explain() is silent about fiscal periods. When a result carries transformations$fiscal_period, neither R/explain.R nor inst/schemas/provenance-v1.json mentions it, including how many rows got no period.
  3. Type drifts on all-NA input. R/fiscal.R:362: when every date passed in is NA, cog_survey_year() returns fiscal_year_end as logical. Wrap it in as.integer() like year beside it.
  4. Large IN list. .fiscal_year_lookup sends one quoted id per row. Plausibly slow for a cohort the size of every city; not measured.

Items 7 and 4 are the same decision and should be made together.

## From review 9760 (b6b3e46, fiscal periods, #77) Four more findings, each checked against current main on 2026-11-13. 7. **No warning for an unknown govid (medium).** `cog_fiscal_periods()` and `cog_survey_year()` never call `.check_govids_in_scope()`, so a typo returns a row of NAs that reads as missing data. Same question as item 4: should a typo warn here the way the verbs do? 8. **`cog_explain()` is silent about fiscal periods.** When a result carries `transformations$fiscal_period`, neither `R/explain.R` nor `inst/schemas/provenance-v1.json` mentions it, including how many rows got no period. 9. **Type drifts on all-NA input.** `R/fiscal.R:362`: when every date passed in is NA, `cog_survey_year()` returns `fiscal_year_end` as logical. Wrap it in `as.integer()` like `year` beside it. 10. **Large IN list.** `.fiscal_year_lookup` sends one quoted id per row. Plausibly slow for a cohort the size of every city; not measured. Items 7 and 4 are the same decision and should be made together.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Civilytics/uscogdata#84