Skip to content

fix(models): require whole numeric strings and real timestamps - #50

Merged
Reddimus merged 2 commits into
mainfrom
fix/numeric-strings-and-timestamps
Nov 21, 2026
Merged

Reddimus merged 2 commits into
mainfrom
fix/numeric-strings-and-timestamps

Conversation

@Reddimus

Copy link
Copy Markdown
Owner

Summary

Fixes #46. Fixes #49. Both reproduced on v0.4.8 through the public parse_* API before the fix.

Parity: spc-data links spc-cpp and stores this output. Among the captured fixtures:

  • No value read through the numeric helper has trailing text.
  • All 206 twelve-digit timestamps are real.

So output on published data is unchanged, and tests/golden/ didn't move.

Testing

  • make test, make lint, make lint-md, make fixtures-check, and make test-consumers pass
  • CHANGELOG.md has an [Unreleased] entry for user-visible changes
  • Public API changes are called out above (behaviour only: malformed numeric strings read as 0; impossible timestamps stay as sent)

Where it ran:

  • macOS (arm64, libcurl 8.7.1): all five gates, plus ASan/UBSan and TSan.
  • Linux, natively: GCC 15 with libcurl 8.18, plus ASan and TSan.
  • Linux, in ubuntu:24.04 (libcurl 8.5.0): GCC 13, Clang 18 with libc++, and clang-tidy-18 on the final commit.

Live: tools/verify_arcgis_metadata.py and every example pass, and real SPC timestamps still convert.

Review: an independent review found two issues, both fixed in the second commit. Year 0 was accepted, and two tests couldn't catch a revert. The re-review approved.

Fixes #46. json_number_or_numeric_string took a string's leading number,
so "5xyz" was 5 and a fire-weather dn of "5xyz" became ELEV, while the
no-risk check required the whole string. Now every numeric field does.

Fixes #49. spc_ts_to_iso8601 reformatted any twelve digits, turning
202613400000 into 2026-13-40T00:00:00Z. Digits that name no real UTC time
are returned as sent, as the helper documents.

No captured fixture has either shape, so golden output is unchanged.
…ero bands

From review: std::chrono::year{0} is ok(), but the civil calendar has no
year 0 and Postgres rejects it. The dn cases "0abc" and "0 " read as 0
with or without the fix, so "5 " and "5e" now guard against a revert.
@Reddimus
Reddimus merged commit 75a5deb into main Nov 21, 2026
14 checks passed
@Reddimus
Reddimus deleted the fix/numeric-strings-and-timestamps branch November 21, 2026 07:05
@Reddimus Reddimus mentioned this pull request Nov 21, 2026
3 tasks done
Reddimus added a commit that referenced this pull request Nov 21, 2026
## Summary

Sets the version to 0.4.9, dates the changelog section, and moves the
README `GIT_TAG` to `v0.4.9`. The changes are in #50.

## Testing

- [x] `make test-consumers` passes (checks both README versions)
- [x] `make lint-md` passes
- [x] Public API changes: none beyond #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant