Skip to content

Story 19.4 — BI-tool emitted-SQL capture: CapturedSqlProbe (layer-2 parser verdicts for the R2a MINIMUM set) - #255

Merged
fupelaqu merged 2 commits into
mainfrom
feature/19.4
Sep 1, 2026
Merged

Story 19.4 — BI-tool emitted-SQL capture: CapturedSqlProbe (layer-2 parser verdicts for the R2a MINIMUM set)#255
fupelaqu merged 2 commits into
mainfrom
feature/19.4

Conversation

@fupelaqu

Copy link
Copy Markdown
Contributor

Story: _bmad-output/implementation-artifacts/19-4-bi-emitted-sql-capture.md (Epic 19 — R2a function-library audit, Layer 1).

Closes #254

What this PR adds (one tracked source, by design)

sql/src/test/scala/app/softnetwork/elastic/sql/census/CapturedSqlProbe.scala — layer 2 of the BI emitted-SQL extraction: a main-bearing Test/runMain object, deliberately NOT a ScalaTest suite (its input is a gitignored capture artefact that does not exist on a clean checkout — a suite would either pass vacuously via assume or leave sql/test permanently red). It reads the corpus CSV (RFC-4180, explicit UTF-8), runs the real Parser on every captured statement (Throwable-guarded — #250 can throw instead of Left), and emits per-row verdicts, debound re-parses for ?-bearing rows, census-id resolution (form-level where a measured discriminator decides; ALL candidates of the token otherwise — the inflating, safe direction), and an unmatched_spellings scan backed by the real SQLKeywords registry. A resolver/splitter/codec self-check runs before every probe.

Verified: cross-compiles on 2.12.20 + 2.13.16; sbt "sql/test" stays 532/532 and does not collect the probe; scalafmt clean; bare headerCheck unaffected (Apache-2.0 header copied from SQLKeywordsSpec).

Investigation results (artefacts are local-only under gitignored _bmad-output/, per the epic's design)

Findings — 10 product issues filed during capture (lead-approved) + 1 amendment

Repo Issues
softclient4es-jdbc #32 (context-classloader bootstrap — driver unusable under Tableau), #33 (log4j-core without log4j-api in es8/es9 fat jars), #34 (JDBC namespace dead-ends BI browse silently; amended: catalog = constant elasticsearch, schema = cluster name — homogeneous with story 1.2's pinned CatalogName), #35 (misleading Error parsing schema DDL statement: prefix)
softclient4es-arrow #166 (ADBC shares the classloader defect), #167 (sidecar image + ADBC jars share the log4j hole), #168 (JOIN schema probe dies on date columns), #169 (image reads ELASTIC_HOST, docs say ES_HOST)
SoftClient4ES #251 (FROM-less SELECT — both tools' connection idiom), #252 (identifier-quoting coverage, 10-shape acceptance table), #253 (aggregate-free GROUP BY returns per-document rows)

🤖 Generated with Claude Code

… the BI emitted-SQL corpus (R2a MINIMUM set)

A main-bearing Test/runMain object (deliberately not a ScalaTest suite: its
input is a gitignored capture artefact — a suite would pass vacuously or stay
permanently red). Reads the BI corpus CSV (RFC-4180, explicit UTF-8), runs the
real Parser on every captured statement (Throwable-guarded, #250), emits
verdicts + debound re-parses + census-id resolution (form-level where a
measured discriminator decides, ALL candidates token-level otherwise — T4) +
the unmatched-spellings scan backed by the real SQLKeywords registry.
Self-checked resolver/splitter/codec on every run. sbt "sql/test" does not
collect it (532/532 unchanged).

Corpus results (local-only artefacts): 99 statements / 2 tools / 2 venues,
MINIMUM = 49 census rows (17 form / 32 token_only), OQ-4 dialect symmetric
difference = 25 ids. Product issues filed during capture: jdbc#32-#35,
arrow#166-#169, SoftClient4ES#251-#253.

Closed Issue #254

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fupelaqu
fupelaqu marked this pull request as ready for review September 1, 2026 13:34
@fupelaqu
fupelaqu merged commit 4c97a2f into main Sep 1, 2026
4 checks passed
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.

Story 19.4 — BI-tool emitted-SQL capture: CapturedSqlProbe (layer-2 parser verdicts for the R2a MINIMUM set)

1 participant