feat: scaffold spc-cpp + spc_core/spc_http/spc_models (Workstream C / PR-1)#1
Merged
Merged
Conversation
… PR-1) Open-source C++23 SDK for NOAA SPC products, extracted from the internal spc-data ingestion service. Repo scaffolded to the nws-cpp/ncei-cpp house pattern (layered libs, install/export spc::, Makefile, CI, .clang-format/.editorconfig/.markdownlint, Keep-a-Changelog, empty cpp_auto_allowlist). spc_core: - error.* — Result<T>=std::expected; adds ErrorCode::FeedUnavailable for SPC's 404 'no active outlook' (callers clear rows, not fault). - geometry.* + types.hpp — EXTRACTED VERBATIM from spc-data (ray-cast PIP; contract-stable shapes; only namespace changed). - rate_limit.* (ncei verbatim), retry.hpp (ncei verbatim), and pagination.hpp with the net-new ArcGISPager (offset+=2000, stop on exceededTransferLimit==false). spc_http: - http_client.* pimpl GET-only, behavior-parity with spc-data's fetcher (FOLLOWLOCATION/NOSIGNAL/ACCEPT_ENCODING/UA) + absolute-URL pass-through so one client serves spc.noaa.gov / ArcGIS / IEM. spc_models: - common.* — Glaze null-safe glz::generic helpers, bodies copied VERBATIM from spc-data/src/parser.cpp:28-152. - outlook.* — EXTRACTED VERBATIM severity_from_label / parse_categorical / parse_probabilistic (the parity-critical convective path; throw-contract preserved). - geo.hpp — GeoJSON + Esri FeatureSet wrapper shapes. spc_api: PR-1 placeholder TU (locks the layered target + export shape); StaticFeed/ArcGIS/Archive clients land in PR-2. Tests: test_geometry.cpp / test_parser.cpp moved with IDENTICAL asserts + test_corpus.cpp over the shared live fixture corpus. 14/14 green. clang-format + cpp_auto_audit clean. install/export verified: all 5 spc:: targets, a downstream find_package(spc)+spc::spc consumer builds and parses correctly. Glaze-divergence (only house SDK on Glaze, not nlohmann) documented in README + CHANGELOG + CLAUDE.md. Net-new models + clients + examples + the v0.1.0 tag come in PR-2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workstream C — PR-1 (spc-cpp standalone)
First substantive PR for the new open-source
spc-cppSDK: scaffold to thenws-cpp/ncei-cpphouse pattern and implement the lower three layers. Extracted from the internalspc-dataingestion service so its battle-tested NOAA-GeoJSON parser stops being duplicated per consumer.Layers landed
spc_core:error.*(Result<T>=std::expected; net-newErrorCode::FeedUnavailablefor SPC's 404 'no active outlook'),geometry.*+types.hppextracted verbatim from spc-data (only namespace changed),rate_limit.*/retry.hpp(ncei verbatim),pagination.hppwith the net-newArcGISPager(offset += 2000, stop onexceededTransferLimit == false).spc_http: pimpl GET-only client, behavior-parity with spc-data's libcurl fetcher (FOLLOWLOCATION / NOSIGNAL / ACCEPT_ENCODING / UA) + absolute-URL pass-through so one client serves spc.noaa.gov / ArcGIS / IEM.spc_models:common.*(Glazeglz::genericnull-safe helpers — bodies copied verbatim fromspc-data/src/parser.cpp:28-152),outlook.*(verbatimseverity_from_label/parse_categorical/parse_probabilistic; throw-contract preserved),geo.hppGeoJSON/Esri shapes.spc_api: PR-1 placeholder TU — locks the layered target +install(EXPORT)shape. Real StaticFeed/ArcGIS/Archive clients land in PR-2.Verification
make build+ctestgreen (14/14): movedtest_geometry.cpp/test_parser.cppkeep identical asserts;test_corpus.cppdrives the shared live-captured fixture corpus.clang-format --dry-run --Werror+cpp_auto_audit.py(empty allowlist) clean.cmake --installexports all 5spc::targets at v0.1.0; a downstreamfind_package(spc 0.1.0)+spc::spcconsumer builds and parses correctly.Glaze divergence (intentional, documented)
spc-cpp parses with Glaze v7.6.0, not
nlohmann/jsonlike the sibling SDKs — SPC's properties block is shape-loose and geometry is polymorphic, so the parser walks aglz::genericAST. This is the exact spc-data code path, lifted verbatim so a downstream byte-identity guarantee holds. Documented in README, CHANGELOG, CLAUDE.md. Same glazev7.6.0tag the estate uses.Series: PR-0 (spc-data prep, merged) → PR-1 (this) → PR-2 (net-new models + clients + examples, tag v0.1.0) → PR-3 (spc-data refactor + byte-identity gate).