SPLAT JSON Schema + camelCase docs/examples + CI validation#26
Merged
Conversation
Add internal/splat/schema, which reflects splat.Job into a JSON Schema (draft 2020-12) with the opaque scalar wrappers (Quantity, Duration) mapped to strings. The committed schema/splat.schema.json is regenerated with `make schema` (go test ./internal/splat/schema -update); a drift test runs under `go test ./...` so the schema can never silently fall out of sync with the types. Depends on github.com/invopop/jsonschema (kept out of the core splat package via the reflector's type Mapper). Note: validating the current examples/ against this schema fails because they use snake_case field names while the types/schema use camelCase — a pre-existing docs/impl mismatch tracked separately; the schema here reflects what the tool actually accepts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PnTz6Zxqa4jHocK8kCbyx
BAMMM parses SPLAT via sigs.k8s.io/yaml, which honors the json tags — so the tool only accepts camelCase field names (cpusPerTask, memoryPerTask, ...). But SPEC.md's field reference and every examples/*.yaml used snake_case, so those fields were silently dropped when actually parsed. Rewrite the first-class SPLAT fields to camelCase across SPEC.md and examples/ (scheduler-specific extensions.* keys are left as-is — they are freeform passthrough matching what each parser writes). Also drop the aspirational placement.mpi_mapping block from full-reference.yaml (not a real field). All examples now validate against schema/splat.schema.json and, more importantly, actually round-trip through `bammm convert` without dropping fields. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PnTz6Zxqa4jHocK8kCbyx
Add a Go test (santhosh-tekuri/jsonschema/v6) that compiles schema/splat.schema.json and validates every examples/*.yaml against it. It runs under `go test ./...`, so a future example with a stray or mis-cased field fails CI instead of silently dropping data at parse time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PnTz6Zxqa4jHocK8kCbyx
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PnTz6Zxqa4jHocK8kCbyx
stackedsax
force-pushed
the
fix/splat-camelcase-docs
branch
from
July 18, 2026 21:28
b1efadb to
22521d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The SPLAT JSON Schema, plus the docs/examples fix it surfaced, as one coherent
change. Supersedes #24 (its schema commit is included here).
internal/splat/schemareflectssplat.Jobintoschema/splat.schema.json(draft 2020-12), withQuantityand
Durationmapped to strings. Regenerate withmake schema; a drift testkeeps it in sync.
accepts camelCase, but
SPEC.mdand everyexamples/*.yamlusedsnake_case and were silently dropping those fields at parse time.
Rewrote all first-class fields to camelCase (scheduler-specific
extensions.*keys left as-is), and removed the aspirationalplacement.mpi_mappingfrom full-reference.yaml.a stray or mis-cased field now fails
go test ./...instead of silentlylosing data.
Why combined
The schema and the casing fix are two halves of one thing: the schema is only
correct/useful once the examples match it, and the CI gate ties them together.
Splitting them created a circular dependency (the gate needs both camelCase
examples and the schema), so they land together.
Testing
go test ./internal/splat/schema— schema drift check, shape check, and all 9examples validate.
slurm-job.yaml→--cpus-per-task=4 --mem=8G), which they didn't before.New deps:
github.com/invopop/jsonschema,github.com/santhosh-tekuri/jsonschema/v6.🤖 Generated with Claude Code