feat(v1.4.0): report every object a query touches - #4
Merged
Conversation
Query lineage now reports every source a statement reads, joins, or produces: - comma-separated FROM lists wire every source, not just the first; - CROSS/OUTER APPLY and tabular functions (UNNEST, XMLTABLE, JSON_TABLE, GENERATE_SERIES) become structured read references (heuristic) or documented-opaque references; - MERGE ... USING and DELETE ... USING sources are now extracted; UPDATE ... FROM extraction is preserved; - recursive CTEs are marked "recursive CTE" in graph metadata with an informational cte_recursive annotation; an opaque source inside the recursion cycle emits a cte_recursion_approx warning; - derived-table/subquery inner sources are wired into query graphs. Adds an 'info' diagnostic severity that is excluded from the findings count (E), and query-graph export-parity fixtures (F). Version bumped to 1.4.0 in package.json and README.md; v1.4.0 example, PR note, and release note added. dist/ rebuilt in sync. Verification: typecheck, build, file-smoke, local-only URL check clean; golden 188/188 (was 181), fuzz 400, ui 13/13.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: v1.4.0 — Report every object a query touches
Summary
Implements the v1.4.0 — Report every object a query touches milestone from
ROADMAP.md: Workstream C in full, plus the E query diagnostics/annotations andF export-parity fixtures each construct requires. Query lineage now reports
every object a statement reads, joins, or produces. The golden suite grows from
181 to 188; fuzz and UI suites stay green.
What's included
Comma-separated
FROMsourcesrefsIn(src/lineage.ts) tracks a FROM/JOIN source list and its clause-endkeywords, so
FROM a, b, cwires every source — previously only the first.Commas in
SELECTlists,IN (…), function calls,VALUES,GROUP BY, andUSING (col)lists do not produce false references.APPLY/LATERAL/ tabular functionsCROSS/OUTER APPLY fn(…)adds the function as a structuredread/heuristicreference.UNNEST,XMLTABLE,JSON_TABLE,GENERATE_SERIESareread/opaque(documented opaque) references.
LATERALsubqueries keep their inner sources wired.Read extraction without
FROMMERGE … USINGandDELETE … USINGnow extract theUSINGsource as a read(they previously produced none).
UPDATE … FROMextraction is preserved unchanged.Recursive CTEs
the node, and counted in
graph.stats.recursive.infocte_recursiveannotation; an opaquesource inside the recursion cycle emits a
warningcte_recursion_approx.a normal table reference stays resolved.
Derived-table inner sources
FROM (SELECT … FROM dbo.t) xnow plotsdbo.tas a source node.E diagnostics + F export parity
infoseverity (src/types.d.ts); informational annotations areexcluded from the findings count in
estateHealthandsetAnalysisHealth(
src/app.ts), so they never inflate the diagnostics counter.cte_recursiveandcte_recursion_approxare region-scoped with validspans, asserted in
tests/tests.ts.toMermaid/toDrawioexport-paritytests (well-formed draw.io XML, provenance metadata, all new sources present).
Other
examples/dbo.v140_demo.sqldemonstrates all headline outcomes in oneT-SQL procedure.
NOT_TABLE(now unused) removed fromsrc/lineage.ts.Not changed
that now report comma/
APPLY/USING/recursive-CTE/derived sources gainsource nodes, which is the intended accuracy fix.
untouched.
Fixtures
tests/tests.ts— v1.4.0 block: comma refs, APPLY/tabular refs, MERGE/DELETE/UPDATE read extraction, recursive-CTE info + approx warning, derived-table and
comma wiring, query-graph export parity.
Verification
npm run typecheck— passesnpm run build— passesnpm run test:file— passesdist/committed in syncDeferred (per roadmap)