JSON Contract
Versioning
Section titled “Versioning”Rocky’s CLI output is the interface contract with orchestrators like Dagster. Every JSON output includes a top-level version field that tracks the engine’s release version — it’s set from env!("CARGO_PKG_VERSION") at compile time, so the field reports whichever Rocky binary is producing the output.
Examples throughout the reference docs show "version": "1.6.0" to match the current engine release:
{ "version": "1.6.0", "command": "discover", ...}Stability Guarantees
Section titled “Stability Guarantees”Rocky follows the engine’s semver cadence:
- Patch (
1.6.x) — Bug fixes, no schema changes. - Minor (
1.x.0) — New optional fields may be added. Existing fields are never removed or renamed within a minor series. - Major (
x.0.0) — Breaking changes to field names, types, or structure. Consumers should pin or branch their parsing logic on the major version.
Consumers should parse defensively — tolerate unknown fields, treat absent optional fields as null, and don’t assume the set of enum variants is closed.
Asset Key Format
Section titled “Asset Key Format”The asset_key field in materializations and check results follows a fixed format:
[source_type, ...component_values, table_name]Example: ["fivetran", "acme", "us_west", "shopify", "orders"]
Multi-valued components (like regions) are joined with __:
["fivetran", "acme", "us_west__us_central", "shopify", "orders"]This format is consumed by dagster-rocky to build Dagster AssetKey objects.
Parsing
Section titled “Parsing”Use the parse_rocky_output() function in dagster-rocky to auto-detect the command type:
from dagster_rocky import parse_rocky_output
result = parse_rocky_output(json_str)# Returns: DiscoverOutput | RunOutput | PlanOutput | StateOutput | ...The command is detected from the "command" field in the JSON. Shape-based discrimination (e.g. column vs model lineage) covers the commands whose output shape is disambiguated by the presence of an argument.
Codegen Pipeline
Section titled “Codegen Pipeline”Rocky’s JSON output schemas are autogenerated from typed Rust structs. Every CLI command that emits --output json is backed by a struct in engine/crates/rocky-cli/src/output.rs (or commands/doctor.rs) that derives JsonSchema. The full pipeline:
- Edit the relevant
*Outputstruct inoutput.rs. - Run
just codegenfrom the monorepo root. - That exports 37 JSON schemas to
schemas/, regenerates Pydantic v2 models inintegrations/dagster/src/dagster_rocky/types_generated/, and TypeScript interfaces ineditors/vscode/src/types/generated/. - Commit the schema and regenerated bindings together.
The codegen-drift CI workflow fails any PR where committed bindings don’t match just codegen output. The .git-hooks/pre-commit hook mirrors the same check locally — enable once with just install-hooks.
As of the latest release, there are 37 typed output schemas covering every JSON-emitting command. See the JSON Output reference for the per-command payload shapes.
Adding New Fields
Section titled “Adding New Fields”When adding fields to Rocky’s JSON output:
- Add the field as optional (nullable) in the relevant Rust
*Outputstruct. - Run
just codegento regenerate Pydantic models and TypeScript interfaces. - The new field ships with the next minor engine release; no separate schema version bump is needed.
- Document the new field in the JSON Output reference.