fix(vba): remove duplicate Dysflow artifact extraction - #315
Merged
Merged
Conversation
The #154 refactor lifted the three Dysflow sub-extractors into a FrameworkResolver but never removed the dispatch ladder in tree-sitter.ts, so both ran inside a single extractFromSource call. dysflowExportResolver.detect() is true for any project carrying a Dysflow artifact, so every real export parsed each .form.txt, .report.txt, test manifest and test sequence twice per index and stored duplicate unresolved_refs rows. Drop extract() from the resolver and leave per-file dispatch to the tree-sitter.ts ladder, which is the only site that runs on every path into extraction, including callers that pass no frameworkNames. As a side effect the vba.dysflowExport: false opt-out is honoured again when the framework is registered; the resolver's extract() ignored the flag. Test D covers frameworkNames: ['dysflow-export'] with dysflowExport: true, the combination the real index path uses and the one no test exercised before. Refs #314
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.
Closes #314
What was wrong
The #154 refactor lifted the three Dysflow sub-extractors (
VbaFormExtractor,VbaTestManifestExtractor,VbaTestSequenceExtractor) intodysflowExportResolver, but the pre-refactor dispatch ladder insrc/extraction/tree-sitter.tswas never removed. Both ran inside a singleextractFromSourcecall, anddysflowExportResolver.detect()istruefor any project carrying a Dysflow artifact — so every real export parsed each.form.txt/.report.txt/ test manifest / test sequence twice per index.Measured on the pre-fix build:
Deterministic node IDs collapse the duplicate nodes on insert, so what survived was the doubled parse cost plus duplicate
unresolved_refsrows for every manifest entry and sequence procedure.What changed
extract()(and itspickSubExtractorhelper) is removed fromdysflowExportResolver. Per-file dispatch stays in thetree-sitter.tsladder, which is the only site that runs on every path into extraction — including the many callers that pass noframeworkNamesat all (single-file re-index, library consumers, the extraction unit tests). Removing the ladder instead would have silently emptied those paths.The resolver keeps
detect()andresolve(), and its docstring now states where extraction actually lives and why re-adding anextract()here reintroduces the duplication.Second defect fixed on the way
The removed
extract()never checked thedysflowExportflag. With the framework registered,vba.dysflowExport: falsestill emitted the full Dysflow shape instead of thefile-only node it promises. Test D pins the opt-out under that combination.Verification
pnpm exec vitest run vba extraction-sql-query sql-query-discovery— 72 files, 1207 passed, 1 skipped (the Windows CI leg, run locally on Windows).npx tsc --noEmit— clean.Test D(8 cases) coversframeworkNames: ['dysflow-export']withdysflowExport: true, the combination the real index path uses and the one nothing exercised before. Reverting onlysrc/extraction/frameworks/dysflow-export.tsfails all 8; with the fix all 20 tests in the suite pass.