meta: declared config key specs (typed admin get/edit surface)#21
Merged
Conversation
…validation) GameMeta gains an optional Config []ConfigKeySpec (key, title, description, type text|number|bool|json, default, JSON Schema) so the arcade's admin tools can render typed get/edit forms for a game's config keys. Carried as a trailing presence-guarded section of the packed Meta — a spec/kit minor: old payloads decode with no specs, old hosts ignore the trailing bytes. wire.ValidateConfigSpecs is the shared authoring rule set (unique non-empty keys, no reserved host. prefix, schema only on json keys and well-formed); the guest SDK enforces it at meta() encode time. ABI.md documents the section; GUIDE.md shows the authoring pattern. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tion) ConfigKeySpec/ConfigType on Meta.config, encoded as the trailing config-spec meta section byte-identical to the Go SDK (pinned by a Go golden vector). Authoring rules match wire.ValidateConfigSpecs, with a dependency-free RFC 8259 well-formedness scanner standing in for Go's json.Valid. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Games can now declare the admin-settable config keys they read via
Services.Configin their metadata — key, title, description, value type(
text/number/bool/json), the default used when unset, and (json keys)an optional JSON Schema — so the arcade's admin tools can render typed get/edit
forms instead of a blind key/value prompt.
What's here
(
u16 count; per entrystr key/title/description, u8 type, str default, str schema). Encoders always write the section; decoders treatend-after-leaderboard as a valid pre-section meta. Old hosts ignore the
trailing bytes — ABI major stays 2; this is a minor.
wire.ValidateConfigSpecsis the shared authoring rule set: unique non-emptykeys, no reserved
host.prefix, schema only on json keys and well-formed JSON.ConfigKeySpec/ConfigType+GameMeta.Config, validated atmeta()encode time (fail-fast panic — surfaces in check/dev-run/host load).Meta.config: &'static [ConfigKeySpec],const-constructible), same validation (with a dependency-free RFC 8259
well-formedness scanner standing in for
json.Valid), encoding pinnedbyte-identical to Go by a golden vector.
authoring pattern.
Tests
go test ./...green (round-trip incl. all types, zero-count section,pre-config presence-guard bytes, validation rejections, fuzz extended —
8.4M execs clean locally).
cargo testgreen (44 tests: wire layout, Go golden byte-identity,validation cases, JSON scanner).
Platform-side decode/rendering lands in the private repo after this tags.
🤖 Generated with Claude Code