Skip to content

fix(ts): wire schema.forecast_nwp.v1 into TS codegen pipeline#72

Closed
zax0rz wants to merge 4 commits into
mostlyrightmd:mainfrom
zax0rz:fix/nwp-ts-codegen-parity
Closed

fix(ts): wire schema.forecast_nwp.v1 into TS codegen pipeline#72
zax0rz wants to merge 4 commits into
mostlyrightmd:mainfrom
zax0rz:fix/nwp-ts-codegen-parity

Conversation

@zax0rz

@zax0rz zax0rz commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses P2 review finding on PR #68: schema.forecast_nwp.v1 was exported to schemas/json/ but not listed in SCHEMA_FILES, so pnpm codegen never emitted ForecastNwpV1 types or validators for TS consumers.

Per CLAUDE.md dual-SDK rule, TS codegen parity is required when new schemas are added.

Changes

  • Add schema.forecast_nwp.v1.json to SCHEMA_FILES in packages-ts/codegen/src/codegen.ts
  • Regenerate all generated TS files (codegen --check passes — 31 files byte-equal across runs)
  • ForecastNwpV1 interface, ajv standalone validator, and format-map entry now emitted

Verification

pnpm --filter @mostlyrightmd/codegen run codegen:check  # 31 files byte-identical ✅

Existing validator function renumbering in ajv standalone output is cosmetic (internal function refs shift when a new schema joins the compilation batch) — same behavior seen in prior schema additions.

Resolves: P2 finding on #68

zach added 4 commits June 5, 2026 09:35
…stlyrightmd#63)

- Resolve the latent GFS precipitation twin bug by adding a `_pick_record` helper to forecast_nwp.py.
  It filters duplicates by prioritizing instantaneous records and breaking ties using lowest `record_no`.
- Implement `cloud_cover_pct`, `visibility_m`, and `cloud_ceiling_m` for GFS and HRRR.
- Define and integrate physics-bounds QC rules for the three new fields.
- Regenerate schema.forecast_nwp.v1 JSON schemas.
- Add comprehensive test coverage in test_qc_rules_nwp.py, test_forecast_nwp.py, and test_forecast_nwp_multi_cycle.py.
- Include planning artifacts and research briefs in .briefs/ directory.
Reverted accidental inclusion of all extras in root dependency list.
The [nwp] extra pulls eccodes which is not available in CI without the
full extra install, causing test detection guards to pass while the
actual eccodes binary fails to load.
Addresses P2 review finding on PR mostlyrightmd#68: NWP schema was exported to
schemas/json/ but not listed in SCHEMA_FILES, so pnpm codegen never
emitted ForecastNwpV1 types or validators for TS consumers.

Changes:
- Add schema.forecast_nwp.v1.json to SCHEMA_FILES in codegen.ts
- Regenerate all generated TS files (codegen --check passes)
- ForecastNwpV1 interface, ajv validator, and format-map entry now emitted

Existing validator function renumbering (ajv internal) is cosmetic
and expected when adding a schema to the standalone compilation batch.
@helloiamvu

Copy link
Copy Markdown
Member

Closing as superseded by v1.6.0 (already on main, published to PyPI; npm vts-1.6.0 publishing now).

This PR wires schema.forecast_nwp.v1 into the TS codegen — the exact change that shipped in #71 (merged as 4c0bd19). Reviewing the diff against current main: git diff main..fix/nwp-ts-codegen-parity is +206 / −2013 — i.e. this branch is strictly behind main. Merging it would revert the v1.6.0 release: it would drop the four packages-ts versions from 1.6.0 back to 1.5.2, delete the new Open-Meteo chunking/cache/variables tests, revert _pairs.py/research.py/_open_meteo.py to pre-fix state, and remove the CHANGELOG 1.6.0 entry.

The generated TS surface here is byte-identical to main apart from a cosmetic reordering of SCHEMA_FILES (which only renumbers the internal ajv validators). main already exports ForecastNwpV1 + its validator and passes codegen/build/typecheck/vitest/size. Nothing actionable to merge. Thanks @zax0rz — the underlying fix is live.

@helloiamvu helloiamvu closed this Jun 6, 2026
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.

2 participants