From 74d0dabf5b6348790f5f1776fd4930e65d5d2098 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 30 Jul 2026 21:23:12 +0000 Subject: [PATCH] fix(grammars): restore backslash escaping in llama31 grammar fixture PR #11041 rewrote the testllama31inputResult1 fixture and un-escaped the backslashes inside its Go raw-string literal, turning `[^"\\]` into `[^"\]` and `["\\/bfnrt]` into `["\/bfnrt]`. The fixture is compared line-by-line against the grammar built from PRIMITIVE_RULES in bnf_rules.go, which is unchanged and still emits the doubled form, so "generates a valid grammar from JSON schema" fails on every platform. Restore the four fixture lines to their pre-#11041 form. The cyclic $ref and depth specs added by that PR are untouched. The regression reached master because only the DCO check ever reported on #11041; its test runs were cancelled during the CI purge. Signed-off-by: Ettore Di Giacinto Assisted-by: Claude Code:claude-opus-5[1m] [Bash] [Edit] --- pkg/functions/grammars/llama31_schema_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/functions/grammars/llama31_schema_test.go b/pkg/functions/grammars/llama31_schema_test.go index 22e787bee884..a4c81d736ca7 100644 --- a/pkg/functions/grammars/llama31_schema_test.go +++ b/pkg/functions/grammars/llama31_schema_test.go @@ -43,8 +43,8 @@ const ( // {{"example_name": "example_value"}} testllama31inputResult1 = `root-0-function ::= "create_event" freestring ::= ( - [^"\] | - "\\" (["\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) + [^"\\] | + "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) )* space root-0 ::= "{" root-0-arguments "}" root-1-arguments ::= "{" space "\"query\"" space ":" space string "}" space @@ -53,8 +53,8 @@ space ::= " "? root-0-arguments ::= "{" space "\"date\"" space ":" space string "," space "\"time\"" space ":" space string "," space "\"title\"" space ":" space string "}" space root-1 ::= "{" root-1-arguments "}" string ::= "\"" ( - [^"\] | - "\\" (["\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) + [^"\\] | + "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) )* "\"" space root-1-function ::= "search"` )