Skip to content

grammar: preserve tagged unions through singleton allOf - #66

Open
joelteply wants to merge 4 commits into
dc3a1f4c/container-reader-custodyfrom
25c6a4dd/preserve-tagged-union-through-singleton
Open

joelteply wants to merge 4 commits into
dc3a1f4c/container-reader-custodyfrom
25c6a4dd/preserve-tagged-union-through-singleton

Conversation

@joelteply

@joelteply joelteply commented Oct 17, 2026 •

Copy link
Copy Markdown

A tagged edit argument expressed as allOf: [{"$ref": "#/definitions/EditMode"}], where EditMode is a oneOf union, currently becomes an empty-object-only grammar. The union is ignored by the allOf property collector, so a valid search_replace argument is rejected while {} is admitted.

Delegate a transparent singleton union wrapper to the existing union visitor. Only annotation/definition siblings are allowed; semantic siblings and general allOf intersections retain their existing behavior. The Qwen3.5 fixture uses the captured full edit schema and exercises actual grammar acceptance/rejection plus XML argument round-tripping.

Validation on Windows MSVC Release CPU-only:

  • Same always-active fixture with the old converter rejects valid search_replace (Expected 1, Actual 0).
  • Restored fix passes the Qwen3.5 template tests, including append/search_replace, empty/unknown rejection, and sibling constraints.
  • Existing test-json-schema-to-grammar passes.

This PR is stacked on dc3a1f4c/container-reader-custody at 3794294, the current reviewed native pin. It does not promote an engine or change serving settings. The native bug also exists in the older 178 baseline; newer wrapped tool schemas expose it. This does not establish that every observed coding stall has the same cause.

AI assistance: Codex implemented and reviewed the narrow fix under the maintainer's explicit direction; independent agent source review and compiled before/after evidence are recorded in the governed task25c6a4dd.

Fresh ARM64 CI found two existing speculative batch aggregates missing the final label_weight initializer under -Werror. Both now explicitly initialize nullptr, preserving their prior zero initialization without warning suppression. Focused Windows compilation and Qwen regression pass after this correction; fresh hosted checks remain required.

Further fresh CI exposed preexisting test-walk-exact build defects: unsigned window bound compared to signed loop index, and private symbols linked from a Windows DLL. The loop now uses uint32_t; the unchanged target is registered beside existing internal tests under NOT WIN32 OR NOT BUILD_SHARED_LIBS, retaining Linux and Windows static coverage. Windows static test-walk-exact compiles and links; no assertion or model scenario was removed.

@joelteply
joelteply marked this pull request as ready for review October 17, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant