Skip to content

feat: scaffold spc-cpp + spc_core/spc_http/spc_models (Workstream C / PR-1)#1

Merged
Reddimus merged 1 commit into
mainfrom
workstream-c/pr1-scaffold-core
May 17, 2026
Merged

feat: scaffold spc-cpp + spc_core/spc_http/spc_models (Workstream C / PR-1)#1
Reddimus merged 1 commit into
mainfrom
workstream-c/pr1-scaffold-core

Conversation

@Reddimus

Copy link
Copy Markdown
Owner

Workstream C — PR-1 (spc-cpp standalone)

First substantive PR for the new open-source spc-cpp SDK: scaffold to the nws-cpp/ncei-cpp house pattern and implement the lower three layers. Extracted from the internal spc-data ingestion service so its battle-tested NOAA-GeoJSON parser stops being duplicated per consumer.

Layers landed

  • spc_core: error.* (Result<T>=std::expected; net-new ErrorCode::FeedUnavailable for SPC's 404 'no active outlook'), geometry.* + types.hpp extracted verbatim from spc-data (only namespace changed), rate_limit.* / retry.hpp (ncei verbatim), pagination.hpp with the net-new ArcGISPager (offset += 2000, stop on exceededTransferLimit == 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.* (Glaze glz::generic null-safe helpers — bodies copied verbatim from spc-data/src/parser.cpp:28-152), outlook.* (verbatim severity_from_label / parse_categorical / parse_probabilistic; throw-contract preserved), geo.hpp GeoJSON/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 + ctest green (14/14): moved test_geometry.cpp/test_parser.cpp keep identical asserts; test_corpus.cpp drives the shared live-captured fixture corpus.
  • clang-format --dry-run --Werror + cpp_auto_audit.py (empty allowlist) clean.
  • cmake --install exports all 5 spc:: targets at v0.1.0; a downstream find_package(spc 0.1.0) + spc::spc consumer builds and parses correctly.

Glaze divergence (intentional, documented)

spc-cpp parses with Glaze v7.6.0, not nlohmann/json like the sibling SDKs — SPC's properties block is shape-loose and geometry is polymorphic, so the parser walks a glz::generic AST. This is the exact spc-data code path, lifted verbatim so a downstream byte-identity guarantee holds. Documented in README, CHANGELOG, CLAUDE.md. Same glaze v7.6.0 tag 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).

… 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.
@Reddimus Reddimus merged commit ecaeb33 into main May 17, 2026
3 checks passed
@Reddimus Reddimus deleted the workstream-c/pr1-scaffold-core branch May 17, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant