Skip to content

fix(pipeline): escape dynamic edge properties as JSON#1065

Open
tmonestudio wants to merge 1 commit into
DeusData:mainfrom
tmonestudio:codex/fix-json-edge-properties
Open

fix(pipeline): escape dynamic edge properties as JSON#1065
tmonestudio wants to merge 1 commit into
DeusData:mainfrom
tmonestudio:codex/fix-json-edge-properties

Conversation

@tmonestudio

Copy link
Copy Markdown

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:

  • sequential import edges wrote local_name without escaping;
  • parallel GraphQL edges escaped the callee but not the operation text.

A multiline Rust import alias or GraphQL operation could therefore make json_valid(properties)=0, and JSON-backed SQLite checks/queries could fail with malformed JSON.

Fix

Use the existing cbm_json_escape helper 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

  • Windows production build succeeds with GCC.
  • MCP suite: 145 passed, 6 platform-specific skips.
  • Independently validated with PRAGMA quick_check and json_valid after reindexing affected repositories.

Checklist

  • Every commit is signed off (git commit -s)
  • Full make -f Makefile.cbm test (left to CI; local Windows sanitizer runtime is unavailable)
  • Full lint (left to CI)
  • New behavior is covered by a reproduce-first regression fixture

@tmonestudio tmonestudio requested a review from DeusData as a code owner July 12, 2026 22:47
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>
@tmonestudio tmonestudio force-pushed the codex/fix-json-edge-properties branch from a88ccc4 to 67433fc Compare July 12, 2026 23:47
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.

1 participant