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
@DeusData DeusData added the bug Something isn't working label Jul 14, 2026
@DeusData DeusData added this to the 0.9.1-rc milestone Jul 14, 2026
@DeusData DeusData added parsing/quality Graph extraction bugs, false positives, missing edges priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Jul 14, 2026
@DeusData

Copy link
Copy Markdown
Owner

Thanks for the focused JSON escaping fix. This is a high-priority 0.9.1-rc graph-correctness PR. Review will verify that dynamic edge properties are escaped identically in sequential and parallel paths and that quotes, backslashes, control characters, and non-ASCII values remain valid round-trip JSON.

isc-tdyar added a commit to isc-tdyar/codebase-memory-mcp that referenced this pull request Jul 14, 2026
Add cbm_pipeline_set_version() to stamp a version label (e.g. '28.0',
'30.0') on every node emitted during indexing. Versioned runs bypass
the incremental path so both versions accumulate side-by-side in the
graph.

Add diff_versions MCP tool: given a project, from_version, and
to_version, returns added and removed node names (default label: Class,
limit 500 per side) using OPTIONAL MATCH anti-join queries.

Also auto-derives version from trailing numeric path segment in
index_repository (e.g. /exports/MyApp/28.0 → version='28.0') when
the version param is omitted.

Refs DeusData#1065

Signed-off-by: Thomas Dyar <tdyar@intersystems.com>
isc-tdyar added a commit to isc-tdyar/codebase-memory-mcp that referenced this pull request Jul 14, 2026
Add cbm_pipeline_set_version() to stamp a version label (e.g. '28.0',
'30.0') on every node emitted during indexing. Versioned runs bypass
the incremental path so both versions accumulate side-by-side in the
graph.

Add diff_versions MCP tool: given a project, from_version, and
to_version, returns added and removed node names (default label: Class,
limit 500 per side) using OPTIONAL MATCH anti-join queries.

Also auto-derives version from trailing numeric path segment in
index_repository (e.g. /exports/MyApp/28.0 → version='28.0') when
the version param is omitted.

Refs DeusData#1065

Signed-off-by: Thomas Dyar <tdyar@intersystems.com>
isc-tdyar added a commit to isc-tdyar/codebase-memory-mcp that referenced this pull request Jul 15, 2026
Add cbm_pipeline_set_version() to stamp a version label (e.g. '28.0',
'30.0') on every node emitted during indexing. Versioned runs bypass
the incremental path so both versions accumulate side-by-side in the
graph.

Add diff_versions MCP tool: given a project, from_version, and
to_version, returns added and removed node names (default label: Class,
limit 500 per side) using OPTIONAL MATCH anti-join queries.

Also auto-derives version from trailing numeric path segment in
index_repository (e.g. /exports/MyApp/28.0 → version='28.0') when
the version param is omitted.

Refs DeusData#1065

Signed-off-by: Thomas Dyar <tdyar@intersystems.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working parsing/quality Graph extraction bugs, false positives, missing edges priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants