test: add Go native fuzz tests for schema generation#2792
Merged
tempusfrangit merged 2 commits intofix/dict-list-output-schemafrom Mar 1, 2026
Merged
test: add Go native fuzz tests for schema generation#2792tempusfrangit merged 2 commits intofix/dict-list-output-schemafrom
tempusfrangit merged 2 commits intofix/dict-list-output-schemafrom
Conversation
Four fuzz targets exercising the schema pipeline: - FuzzResolveSchemaType: arbitrary TypeAnnotation trees through the recursive resolver - FuzzJSONSchema: random SchemaType trees through JSON Schema rendering - FuzzParsePredictor: arbitrary bytes as Python source through the tree-sitter parser - FuzzParseTypeAnnotation: arbitrary return type strings in predict signatures Includes: - mise task 'test:fuzz' (FUZZTIME=30s per target by default) - CI job 'fuzz-go' running 30s per target on Go changes - Byte encoder/decoder for deterministic TypeAnnotation and SchemaType tree construction from fuzz corpus
Member
|
@markphelps merged this to the bigger refactor of the schema-gen, which we still need to land. i forgot i stacked them, but it’s the right approach. thanks for looking! |
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.
Summary
Adds Go native fuzz testing for the schema generation pipeline. Based on the schema gen PR (#2788).
Fuzz Targets
FuzzResolveSchemaTypepkg/schemaFuzzJSONSchemapkg/schemaFuzzParsePredictorpkg/schema/pythonFuzzParseTypeAnnotationpkg/schema/pythonRunning
CI
New
fuzz-gojob runs on Go changes, 30s per target (~2 min total). Independent of other test jobs — only needschanges.Approach
Byte encoder/decoder maps arbitrary fuzz corpus bytes to deterministic TypeAnnotation and SchemaType trees, giving the fuzzer structured exploration of the recursive type system rather than just random bytes.