Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Publish a JSON Schema for calibration diagnostics schema 8

Open
#1,293 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@anth-volk is already working on this.

Since Oct 15, 2026.

  • #1298 by @anth-volk — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
json, python
Domain
data, tooling

Research direction

Start with the pydantic models CalibrationDiagnosticsV8 and the UK extension in microcosm-diagnostics, then with calibration_diagnostics_json_schema(), which currently merges schema 8 with the legacy 6/7 envelope. Generate a Draft 2020-12 schema for schema 8 only, commit it under a versioned path, and add a drift test. Done means the drift test passes, the US and UK test builders validate, and every model validator is listed in the schema description. Open PR #1298 already targets this, so check it before starting.

Written by the indexing model from the issue text.

Description

Problem

calibration_diagnostics.json (schema 8) is defined only by the pydantic models in microcosm-diagnostics (CalibrationDiagnosticsV8 and the typed UK extension). Anything that receives the file outside Microcosm has no machine-readable contract to check it against without importing those models.

The collector-as-hub plan has the emitter submit the diagnostics bytes to the collector, which should validate them at intake before building calibration trees. The collector needs a published, versioned schema to do that.

calibration_diagnostics_json_schema() already exists, but it returns the parse adapter's union of schema 8 and the legacy schema-6/7 envelope. It declares no JSON Schema dialect and isn't committed anywhere. It also doesn't say which model rules it leaves out.

Change

  • Generate a Draft 2020-12 JSON Schema for schema 8 from the pydantic models, with a dialect, title, $id and a description.
  • Commit the generated schema at a stable path in microcosm-diagnostics whose name carries the schema version. A tool under tools/ can regenerate or check it.
  • Add a drift test so the committed file always equals freshly generated output.
  • Validate real diagnostics from the existing US and UK engine-free test builders against the committed schema, and check that representative invalid documents fail.
  • Some rules the models enforce can't be expressed in a generated JSON Schema. These include cross-field reconciliations, finite-number checks, strict integers and non-blank text. List each one in the schema's description, and pin with a test that every model validator is listed.

The diagnostics format doesn't change, and nothing is published outside the repository.

Dominant language
Python
Stars
0
Forks
5
Avg merge
1d 8h
Merged PRs (30d)
146

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/microcosm

All issues in PolicyEngine/microcosm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.