Commit 62746dc
committed
fix(skills): correct index-recipe SQL surfaced by EQL docs audit
An audit of the EQL repo's documentation against the shipped
@cipherstash/eql@3.0.2 SQL surfaced four defects that had been copied
into the new indexing guidance:
- The JSON containment GIN recipe was a PostgreSQL syntax error: a cast
over a function call is a general expression and needs its own parens
in an index_elem — ((eql_v3.to_ste_vec_query(col)::jsonb)
jsonb_path_ops). Verified both forms against Postgres 17. Fixed in
stash-indexing, stash-supabase, and stash-prisma-next (the Drizzle
helper already emitted the correct form).
- The troubleshooting operand-typing example cast a query parameter to
the column domain (public.eql_v3_text_eq), whose CHECK requires the
ciphertext key 'c' that query payloads deliberately omit — the correct
cast is the term-only eql_v3.query_text_eq domain.
- The term probe checked hm/ob/bf but not op, the CLLW-OPE term the
same page names as the equality-and-range term for _ord domains.
- GROUP BY guidance now says which extractor to group on per domain:
eq_term only exists on hm-carrying domains; numeric/date/timestamp
*Ord/*OrdOre group on their injective ordering term.
Also documented a trap the audit exposed: the EQL install SQL begins
with DROP SCHEMA eql_v3 CASCADE, so stash eql upgrade / reinstall
silently cascade-drops every functional index built on the extractors.
stash-indexing and stash-cli (eql upgrade) now say to re-run index
migrations + ANALYZE afterwards.
Claude-Session: https://claude.ai/code/session_01BkEpKJC3975NHsKgMrCT8R1 parent 0f16174 commit 62746dc
4 files changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| |||
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| 237 | + | |
235 | 238 | | |
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
240 | | - | |
| 243 | + | |
241 | 244 | | |
242 | 245 | | |
243 | 246 | | |
| |||
259 | 262 | | |
260 | 263 | | |
261 | 264 | | |
| 265 | + | |
| 266 | + | |
262 | 267 | | |
263 | 268 | | |
264 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments