Skip to content

Fix #1219: quote-aware pattern-existence pre-scan + whitebox tests#1291

Merged
lmeyerov merged 1 commit intomasterfrom
issue-1219-whitebox-amplification
May 4, 2026
Merged

Fix #1219: quote-aware pattern-existence pre-scan + whitebox tests#1291
lmeyerov merged 1 commit intomasterfrom
issue-1219-whitebox-amplification

Conversation

@lmeyerov
Copy link
Copy Markdown
Contributor

@lmeyerov lmeyerov commented May 4, 2026

Summary

Fixes a concrete #1219 front-end policy-boundary bug found during whitebox amplification.

The parser's pre-parse unsupported-form check for pattern-existence syntax (exists { ... }, not((pattern))) previously scanned raw query text, so it falsely rejected valid row-only queries when those lexemes appeared inside string literals.

This PR makes the pre-scan quote/backtick-aware and adds regression coverage.

Changes

  • graphistry/compute/gfql/cypher/parser.py
    • Added masking helper for quoted/backticked spans before unsupported-pattern regex checks.
    • _check_unsupported_syntax_patterns() now scans masked text.
  • graphistry/tests/compute/gfql/cypher/test_parser.py
    • Added parser tests proving quoted lexemes are accepted.
    • Added guard tests proving true pattern-existence expressions still reject.
  • graphistry/tests/compute/gfql/cypher/test_where_row_boolean_policy_boundary.py
    • Added runtime boundary test proving quoted lexemes behave as row literals.
  • CHANGELOG.md
    • Added Development/Internal note for the fix.

Validation

  • python -m pytest -q graphistry/tests/compute/gfql/cypher/test_parser.py -k "pattern_existence_lexemes_inside_string_literals or still_rejects_true_pattern_existence"
    • 7 passed, 115 deselected
  • python -m pytest -q graphistry/tests/compute/gfql/cypher/test_where_row_boolean_policy_boundary.py
    • 10 passed
  • python -m pytest -q graphistry/tests/compute/gfql/cypher/test_lowering.py -k "pattern_existence"
    • 4 passed, 881 deselected
  • UV_CACHE_DIR=/tmp/uv-cache uv run ruff check graphistry/compute/gfql/cypher/parser.py graphistry/tests/compute/gfql/cypher/test_parser.py graphistry/tests/compute/gfql/cypher/test_where_row_boolean_policy_boundary.py
    • All checks passed

Refs #1219

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