Skip to content

[FFL-2914] Reject inline Unicode targeting regex flags - #32

Open
btthomas wants to merge 2 commits into
mainfrom
blake.thomas/FFL-2914-reject-inline-unicode-authoring
Open

[FFL-2914] Reject inline Unicode targeting regex flags#32
btthomas wants to merge 2 commits into
mainfrom
blake.thomas/FFL-2914-reject-inline-unicode-authoring

Conversation

@btthomas

@btthomas btthomas commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

FFL-2914

Motivation

Inline Unicode flags and repeated inline flags are not accepted consistently by every shipped targeting-regex engine. The portable authoring contract should reject them instead of requiring consumers to normalize or reinterpret the pattern.

Changes

  • Bump the portable targeting-regex contract to v3.
  • Classify standalone, combined, and scoped inline Unicode flags as rejected authoring syntax.
  • Add rejected cases for a repeated enabled flag and the same flag on both sides of -.
  • Keep native compile and match observations separate from the authoring decision.
  • Update the contract documentation and content hash.

Validation

  • jq empty ufc-config.json evaluation-cases/*.json regex-conformance/targeting-regex-conformance.json
  • Canonical regex-conformance validator and negative validator tests
  • SHA-256 verification
  • python3 ci/validate-fixtures.py (307 evaluation cases across 41 files)

Blast Radius

This changes the authoring decision for one existing case and adds two rejected cases. The expanded Snowflake/Iceberg inventory fetched on 2026-08-20 contained 535 distinct regexes and found no inline Unicode or repeated inline flags.

QA

No application QA is required because this PR changes shared test data only. Downstream consumers should update their fixture pin after this PR merges.

@btthomas
btthomas marked this pull request as ready for review August 20, 2026 17:37
@btthomas
btthomas requested a review from a team as a code owner August 20, 2026 17:37
@btthomas
btthomas requested review from danyal002, dd-oleksii and sameerank and removed request for a team August 20, 2026 17:37
"expectedMatch": null,
"engineExpectations": {
"go": { "compile": true, "match": true },
"re2js": { "compile": true, "match": true },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

major: why do we even have re2js here? We don't use it. And plain js rejects (?i) groups completely

Comment on lines +631 to +632
"rustRulesBased": { "compile": false, "match": null },
"rustRkyv": { "compile": false, "match": null }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

minor: I think I mentioned this somewhere else but Rust evaluators should behave the same — they are using the same regex library, so we don't need separate rows for them

Comment on lines 339 to 349
{
"id": "accepted-inline-case-insensitive",
"description": "The case-insensitive inline flag is portable.",
"category": "inline-flag",
"contract": "accepted",
"rawPattern": "(?i)^alice$",
"normalizedPattern": "(?i)^alice$",
"expectedCompile": true,
"input": "ALICE",
"expectedMatch": true
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

major: we want to reject this one (and all of the (?x) flags) because JS does not support it

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.

3 participants