Extend C-095 to the RFC 8259 control-character escape rule - #111
Merged
Merged
Conversation
… with a json_stringify_control_chars fixture Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
Requirements-first half of almide/almide#2802.
json.stringify/value.stringify/json.stringify_prettyescaped only\"\n\r\t, so every other U+0000–U+001F came out raw. RFC 8259 §7 forbids that, and a strict parser such as Python'sjson.loadsrejects it.\\ \" \n \r \t. Every other U+0000..U+001F is written as\u00xxin lowercase hex, with no\b/\fshort forms. Everything else, U+007F included, stays raw UTF-8. AnEXTENDED (#2802)clause records what the old output was and how it surfaced. The title is unchanged, and the ALS-D6 prose does not state the escape rule, so it is untouched and its validation hash stays valid.spec/wasm_cross/json_stringify_control_chars.almd(C-095). It runs each of the 32 control characters plus",\and U+007F, as a value and as a key, through compact, pretty andvalue.stringify. Each output is parsed back withjson.parse.ref/src/value.rsjson_quotefollows the same rule. On the new fixture its output is byte-identical to the implementation's fixed native, structural-wasm and incumbent-wasm legs (checked locally against the almide fix branch).Local gates: check-contracts, contract-provenance, element-coverage, links, als-style, als-validation, gate-verification, ref-kernel, ref-totality (no new abstain), ref-independence, selftest-conformance, runner-coverage. All green.
Author / verifier record
Ratchets loosened in this PR (ceiling up / floor down): none.