th config push: emit the server's JSON-Schema shape (land stranded fix) - #179
Merged
Conversation
`pushConfigSchemaVersion` persists the POSTed `jsonSchema` verbatim. push was
POSTing the local *manifest* doc (`{public:[SCREAMING_SNAKE], …, types:{…}}`),
which would overwrite the remote's *JSON-Schema* form
(`properties.<tier>ConfigSchema.properties.<camelKey>`) — changing the shape every
consumer of the stored schema reads. So push could never safely carry a real
change, even after the diff was fixed (#102).
Add `manifest_to_json_schema`: converts the manifest to the server's JSON-Schema
shape before POST (camelCase property names from `types`, tier from matching each
key's canonical form against the tier arrays; bare type strings become
`{type: ...}`). Already-JSON-Schema input passes through. Both push paths (update +
create) now POST the converted form.
Tests: produces the server shape; passthrough for JSON-Schema input; and the key
invariant — the converted form flattens to the SAME key→tier map as the manifest
(`compute_diff(manifest, converted)` is empty), so a push is a key-set update, not
a format rewrite. 3 new tests pass (+ the #102 diff tests).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
brentrager
enabled auto-merge (squash)
July 8, 2026 21:44
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.
Problem
th config pushPOSTed the local manifest doc ({public:[SCREAMING_SNAKE], secret:[...], featureFlag:[...], types:{camelKey:...}}) verbatim. The config server persists the POSTedjsonSchemaas-is, so a push would overwrite the stored JSON-Schema form (properties.<tier>ConfigSchema.properties.<camelKey>) — changing the shape every consumer of the stored schema reads. push could never safely carry a real change, even after the diff fix (#102).Solution
Adds
manifest_to_json_schema: converts the manifest to the server's JSON-Schema shape before POST (camelCase property names fromtypes, tier resolved by matching each key's canonical form against the manifest tier arrays; bare type strings become{type: ...}). Already-JSON-Schema input passes through unchanged. Both push paths (update + create) now POST the converted form.This is a stranded fix (commit 3be5bee) cherry-picked onto main — it was verified absent from main (
cmd_pushstill POSTedlocal_schemaverbatim).Verification
cargo test -p smooai-smooth-cli— 325 passed, including 3 new tests: produces the server shape; passthrough for JSON-Schema input; and the key invariant that the converted form flattens to the SAME key→tier map as the manifest (compute_diff(manifest, converted)empty) — a push is a key-set update, not a format rewrite.rustfmt --checkclean; clippy shows only pre-existing workspace pedantic warnings.🤖 Generated with Claude Code
https://claude.ai/code/session_01LE7V35vzRiHyxBFE8wAxb4