formal-query-synthesis CAP-0052 · active

Writing a reusable locator: regex, SQL, XPath

Whether a model can turn an intent or a few examples into a grep pattern, regex, SQL query, XPath or jq path that selects the right subset, so the pattern runs over the whole collection without calling the model again.

Also called: locator generation, pattern synthesis, text-to-SQL, regex generation, programming by example, grep, grep-style locators

Tags: coding-agent, general

Proposed 2026-09-19 from ten papers forwarded by Russ under the heading "grep-style locators": neural regex generation (Locascio 2016, SemRegex 2018, REGEL 2019, Zelina 2024), example-driven extractors (FlashExtract 2014, wrapper induction 2000), text-to-SQL (Spider 2018, the 2024 survey) and XPath agents (2025). The pipeline's proposal stage judged three of the ten as pointing at a capability the map lacked and consolidated them into this one; the other seven it read as covered by code-generation, but they are filed here as sources because the set was forwarded as one idea. What makes it distinct from ordinary code generation is the success test: the artefact is judged by whether it selects the right subset (DFA equivalence, execution accuracy, transfer to unseen pages), not by whether it reads correctly, and many different strings mean the same thing. The practical stake is cost: a locator that works is paid for once; a model that must be called per document is paid for every time.

What counts as this capability

Scope boundary used when deciding whether a paper is really about this capability, rather than merely mentioning it.

In scope when the output is a pattern-language artefact (regex, SQL, XPath, CSS selector, jq, a grammar) and the paper measures whether it selects or matches correctly against intent or examples. NOT in scope for general code generation from a specification, nor for the model itself extracting the records at inference time without emitting a reusable pattern.

Claims

Techniques

Sources

Every paper, post or observation behind this capability. Ones cited by a claim show the claim and its stance; ones filed directly are about the capability but have no claim drafted from them yet. Open one to add support or contest it.

Related: Generating and editing working code, Using what was retrieved, and only that
Suggest a change

Capabilities are a way of carving up the subject, and carvings are arguable. Say so if this one is wrong — especially a proposed one, which a pipeline added because several papers used the same framing, not because anyone decided it was right.