fix(pipeline): escape dynamic edge properties as JSON#1065
Open
tmonestudio wants to merge 1 commit into
Open
Conversation
Escape import aliases and GraphQL operation strings before serializing edge properties, preventing raw control characters and quotes from producing malformed JSON. Add a multiline GraphQL regression fixture and assert that emitted edge properties remain valid JSON. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: tmonestudio <tmonestudio@users.noreply.github.com>
a88ccc4 to
67433fc
Compare
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 does this PR do?
Prevents malformed JSON in edge properties when extracted values contain quotes, CR/LF, or other control characters.
Two edge builders serialized parser-derived strings directly:
local_namewithout escaping;A multiline Rust import alias or GraphQL operation could therefore make
json_valid(properties)=0, and JSON-backed SQLite checks/queries could fail withmalformed JSON.Fix
Use the existing
cbm_json_escapehelper for both dynamic values before formatting the properties object.The regression fixture uses a multiline GraphQL operation and asserts that every emitted edge property remains valid JSON.
Validation
PRAGMA quick_checkandjson_validafter reindexing affected repositories.Checklist
git commit -s)make -f Makefile.cbm test(left to CI; local Windows sanitizer runtime is unavailable)