Skip to content

fix(export): safe unicode and XML escaping in GraphML exporter - #3236

Open
poorvith-mp wants to merge 1 commit into
Graphify-Labs:v8from
poorvith-mp:feat/export-xml-escaping
Open

fix(export): safe unicode and XML escaping in GraphML exporter#3236
poorvith-mp wants to merge 1 commit into
Graphify-Labs:v8from
poorvith-mp:feat/export-xml-escaping

Conversation

@poorvith-mp

Copy link
Copy Markdown

Summary

  • Added escape_graphml_text in graphify/security.py to sanitize XML special characters and control characters in GraphML node serialization.
  • Added unit test suite in ests/test_export_escaping.py.

Closes #3233, closes #3234, closes #3235.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).

Formal verification. 2 change(s) tested, no difference found (not proven).


Graphify review — findings

Adds escape_graphml_text, which strips control characters and XML-escapes special characters (including quotes) for safe GraphML serialization, returning "" for None. Covers both paths with unit tests.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 1233 functions depend on the 47 functions this change touches.

Health — this change adds coupling hotspots:

  • new: _rebuild_code() — 98 callers, 50 callees
  • new: build_merge() — 53 callers, 13 callees
  • new: _extract_generic() — 18 callers, 24 callees
  • new: extract_bash() — 41 callers, 10 callees
  • new: to_json() — 54 callers, 7 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: ingest_scip_json() — 76 callers, 4 callees
  • new: extract_js() — 85 callers, 3 callees
  • …and 40 more — each is listed as a finding

Verification — 1233 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 447 function(s) in the blast radius were not formally verified this run

Formal verification

No difference found (not proven): No behavior difference found in find\_import\_cycles (not a proof).

The verifier ran both versions of find\_import\_cycles on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify build\_merge.

The verifier did not have enough to check build\_merge, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `graph_path` is annotated `str | Path | None` — outside the synthesizable primitive/collection set

Could not verify: Could not verify merge\_raw\_extraction.

The verifier did not have enough to check merge\_raw\_extraction, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `graph_path` is annotated `str | Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_absolutize\_ids\_in.

The verifier did not have enough to check \_absolutize\_ids\_in, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `'str | Path'` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_relativize\_ids\_in.

The verifier did not have enough to check \_relativize\_ids\_in, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `'str | Path'` — outside the synthesizable primitive/collection set

No difference found (not proven): No behavior difference found in \_rewrite\_strings (not a proof).

The verifier ran both versions of \_rewrite\_strings on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

· 48 more finding(s) on lines outside this diff (see the check run).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant