Releases: wfredricks/polygraph
Releases · wfredricks/polygraph
v0.1.4 \u2014 bridge MERGE + multi-statement support
Cypher bridge grows to unblock the first load-bearing consumer of idempotent anchors: the archetypes-solution-intelligence/contract-loader Solution\u2192Contract relationship.
Added
MERGEin the regex bridge. Both shapes are supported:MERGE (n:Label {props})\u2014 idempotent node match-or-create.MERGE (a)-[:TYPE]->(b)\u2014 idempotent relationship anchor. Two MERGEs of the same edge produce one edge.
- Multi-statement cypher. Queries with multiple top-level
MATCH/CREATE/MERGEclauses (e.g.MATCH (s:\u2026) MATCH (c:\u2026) MERGE (s)-[:R]->(c) RETURN \u2026) are now parsed into amulti-statementplan and executed with a shared variable-binding context. The trailingRETURNclause is lifted onto the wrapper plan so it sees bindings from every sub-statement. - Label-less
MATCH. Patterns likeMATCH (n {contractId: $x, namespace: $ns})now full-scan and filter by inline properties instead of throwing. Used by contract-loader's wipe patternMATCH (n {\u2026}) DETACH DELETE n. DETACH DELETEkeyword. Accepted by the parser and surfaced via adetach: trueflag on thematch-deleteplan. PolyGraph'sdeleteNodealready cascades; DETACH DELETE and plain DELETE remain semantically equivalent.- Differential test vs qengine v0.
MATCH (n:Label) RETURN nreturns the same node ids from both engines. build-history/PHASE-1D-PROBE-2026-05-22.md\u2014 empirical gap survey that drove this release. Re-runnable vianpx tsx scripts/probe-contract-loader-patterns.ts.
Why
Per BUILD-PHASE-1D-PLAN.md: PolyGraph needs to grow up and it does so one limitation fix at a time. The first load-bearing consumer of MERGE is contract-loader's Solution\u2192Contract anchor; the probe surfaced four additional gaps the bridge silently broke (label-less MATCH, DETACH DELETE, multi-statement CREATE+CREATE, multi-statement MATCH+MATCH+MERGE). All five gaps land here.
Out of scope (recorded for posterity)
- Aggregations,
OPTIONAL MATCH,WITH,UNWIND, variable-length paths \u2014 still qengine territory. $parambinding \u2014 consumers inline literals today.ORDER BY\u2014 silently accepted by RETURN parser but not executed; punted.
Stats
- 502 / 502 tests passing (+19 new bridge tests)
- No new npm dependencies
PolyGraph.query(cypher: string): Promise<any[]>signature preserved- qengine
src/qengine/untouched