Skip to content

fix(grammar): allow DEL in built-in JSON strings - #2467

Open
remote-controlled-man wants to merge 2 commits into
abetlen:mainfrom
remote-controlled-man:codex/prflow-0dcb6f08f15a
Open

remote-controlled-man wants to merge 2 commits into
abetlen:mainfrom
remote-controlled-man:codex/prflow-0dcb6f08f15a

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

JSON_GBNF and JSON_ARR_GBNF exclude literal U+007F (DEL) from JSON strings, although RFC 8259 section 7 permits it. With controlled logits, grammar-constrained completions drop DEL from object keys, values and nested strings.

Remove DEL from both character exclusions. Keep the existing U+0000–U+001F exclusions and escape rules. Add real CPU completion regressions using the existing stories15M fixture for keys, values, nested arrays, repeated DEL, neighboring Unicode, escapes and all 32 raw C0 controls.

Validation on macOS arm64 / Python 3.12.14, bundled llama.cpp f5e6915c2, existing native build with GGML_NATIVE=OFF:

  • Final regression matrix on the original implementation: 6 failed, 68 passed.
  • Regression matrix with the fix: 74 passed, no skips.
  • Full make test: 100 collected, 100 passed, no skips.
  • Full make lint: Ruff lint and formatting checks passed for all 29 Python files.
  • git diff --check: passed.
  • Hosted CI: pending. Other platforms were not tested locally.

Prepared with AI assistance, including independent code and validation review.

Copilot AI balanced review requested due to automatic review settings November 30, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants