Summary
NewParser accepts arbitrary rune input through io.RuneReader in engine/parser.go:31-54, while engine/parser_test.go:24-230 provides a finite table corpus. The parser must return a term or error for hostile input without panicking.
Why it matters
Parser panics turn malformed source into a host failure rather than a Prolog parse error and can expose untested lexer-parser state transitions.
Scope
Add engine/parser_fuzz_test.go with FuzzParser. Use a fresh zero VM and parser for each input, bound inputs to 8 KiB, and seed "", "foo.", "[", "'don''t panic'.", "9223372036854775808.", and "tag{x:}.".
Acceptance criteria
Verification
Run the seed corpus through go test ./engine -run '^FuzzParser$' and run go test ./engine -run '^$' -fuzz '^FuzzParser$' -fuzztime=30s; both commands must complete without a panic.
Summary
NewParseraccepts arbitrary rune input throughio.RuneReaderinengine/parser.go:31-54, whileengine/parser_test.go:24-230provides a finite table corpus. The parser must return a term or error for hostile input without panicking.Why it matters
Parser panics turn malformed source into a host failure rather than a Prolog parse error and can expose untested lexer-parser state transitions.
Scope
Add
engine/parser_fuzz_test.gowithFuzzParser. Use a fresh zero VM and parser for each input, bound inputs to 8 KiB, and seed"","foo.","[","'don''t panic'.","9223372036854775808.", and"tag{x:}.".Acceptance criteria
FuzzParsercreates a fresh zero VM and parser for every fuzz input.Verification
Run the seed corpus through
go test ./engine -run '^FuzzParser$'and rungo test ./engine -run '^$' -fuzz '^FuzzParser$' -fuzztime=30s; both commands must complete without a panic.