Skip to content

feat: Surface the health payload's backend and decoding_strategy - #5

Closed
alex-dr wants to merge 1 commit into
mainfrom
feat/healthz-backend-and-decoding-strategy
Closed

feat: Surface the health payload's backend and decoding_strategy#5
alex-dr wants to merge 1 commit into
mainfrom
feat/healthz-backend-and-decoding-strategy

Conversation

@alex-dr

@alex-dr alex-dr commented Aug 17, 2026

Copy link
Copy Markdown

Summary

HealthMetadata gains optional decoding_strategy and backend fields, so the two informational identifiers the service advertises on /healthz reach SDK callers and jointfm health instead of being dropped during parsing.

Pairs with the service-side change in datarobot/joint (feat/healthz-decoding-strategy), which adds decoding_strategy to the health payload alongside the backend field that landed earlier.

Behavior

Both fields are typed str | None and parsed with _optional_string, which tolerates a missing key and an explicit null alike:

  • The service reports decoding_strategy as null for architecture-backend containers and for checkpoint configs predating the field.
  • Images built before backend landed omit that key entirely.

So neither field can be required without breaking this client against older deployments. Both flow into jointfm health automatically, since the CLI serializes the record with asdict.

Neither field is validated. decoding_strategy is singular rather than a supported_* list because the strategy is fixed at training time and no request field can select another, so there is nothing for the SDK to check. Mirroring the service's closed vocabulary (parallel_dense, parallel_scalable, autoregressive) as a Literal would only add a failure mode — an older client hard-erroring on a deployment that adds a fourth strategy.

Callers still want the field to interpret responses: only autoregressive couples horizons, so under either parallel strategy samples are per-horizon marginal draws rather than coherent sample paths. That caveat is now documented in docs/api-reference.md.

Tests

  • The checked-in health_metadata fixture advertises both fields, asserted in test_fixture_compatibility.py so the fixture stays honest against the service contract.
  • Two parametrized tests in test_contract.py cover missing, explicit-null, and non-string payloads for each field.
  • test_cli.py asserts both reach the jointfm health JSON output.
  • The inline health payloads in test_transport.py and test_configuration.py deliberately keep omitting both fields, so the suite exercises older payload shapes next to current ones.

134 passed, 1 skipped. ruff check, ruff format --check, and ty check all clean.

🤖 Generated with Claude Code


Note

Low Risk
Additive, backward-compatible health parsing and documentation only; no changes to forecast requests, validation policy, or security-sensitive paths.

Overview
Health metadata now carries two optional, informational fields from the service: backend and decoding_strategy. HealthMetadata.from_payload maps them with _optional_string, so older deployments that omit the keys or send explicit null still parse without changing compatibility checks.

jointfm health and API docs pick up the same fields automatically (CLI serialization via asdict). The reference notes that decoding_strategy helps callers interpret samples—parallel strategies yield per-horizon marginals, while only autoregressive produces coherent multi-step paths.

Fixtures and contract/CLI tests assert the new fields; parametrized tests cover missing, null, and invalid non-string payloads.

Reviewed by Cursor Bugbot for commit a3c3e9d. Bugbot is set up for automated code reviews on this repo. Configure here.

`HealthMetadata` gains optional `decoding_strategy` and `backend` fields,
so the two informational identifiers the service advertises on `/healthz`
reach SDK callers and `jointfm health` instead of being dropped during
parsing.

Both are typed `str | None` and parsed with `_optional_string`, which
tolerates a missing key and an explicit null alike. The service emits
`decoding_strategy` as null for architecture-backend containers and for
checkpoint configs predating the field, and omits `backend` entirely on
images built before it landed, so neither can be required without
breaking older deployments.

Neither field is validated. `decoding_strategy` is singular rather than a
`supported_*` list because the strategy is fixed at training time and no
request field can select another, so it constrains nothing the SDK could
check; mirroring the service's closed vocabulary as a `Literal` would
only make an older client hard-error on a deployment that adds a fourth
strategy. Callers still need it to read responses: only `autoregressive`
couples horizons, so under either parallel strategy `samples` are
per-horizon marginal draws rather than coherent sample paths.

The inline health payloads in `tests/test_transport.py` and
`tests/test_configuration.py` deliberately keep omitting both fields, so
the suite covers older payload shapes next to current ones.

Service side: datarobot/joint `feat/healthz-decoding-strategy`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@alex-dr alex-dr closed this Aug 18, 2026
@alex-dr
alex-dr deleted the feat/healthz-backend-and-decoding-strategy branch August 18, 2026 14:14
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