feat(parser): RTK Query extractor (6F.4)#46
Merged
Conversation
…ts as data sources (6F.4)
The field run had ~40 injectEndpoints files under src/store/api/** and 0
data-source nodes: the entire server-cache dimension was invisible.
- New "rtk-query" DataSourceKind in core (schema regenerated).
- detectStores recognizes createApi and api.injectEndpoints declarations:
rtkBaseCall resolves the (possibly imported) receiver back to its createApi
through chained injectEndpoints hops; rtkBaseUrl reads the fetchBaseQuery
baseUrl; every builder.query|mutation becomes a DataSourceNode — string-form
and object-form ({ url, method }) query configs, template params normalized
to :param form, baseUrl joined.
- Generated hooks (useXQuery, useXMutation, useLazyXQuery) register in a new
rtkHooks map; the component body walk wires fetches-from edges at call
sites, so traceLineage from a consuming component reaches its endpoint.
Fixture: 3 data sources (GET /api/users, GET /api/invoices,
POST /api/invoices/:id/pay); both 6F.4 attribution xfails removed and passing.
4 new parser tests (205 total across packages). Eval 285 pass / 0 fail /
5 xfail (all owned by 6F.5) / 0 unexpected-pass, gate OK, metrics 1.000.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
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.
Summary
The field validation found ~40
injectEndpointsfiles undersrc/store/api/**and 0 data-source nodes — the entire server-data dimension was invisible on a Redux Toolkit app. This PR adds the RTK Query extractor:createApi/api.injectEndpointsrecognition — the receiver resolves back to itscreateApibase through imports and chainedinjectEndpointshops; thefetchBaseQuerybaseUrl joins every endpointbuilder.query/builder.mutation→DataSourceNodes: string-form and object-form ({ url, method }) configs, template params normalized to:param(POST /api/invoices/:id/pay)useGetUsersQuery,usePayInvoiceMutation,useLazy…Query) registered and wired tofetches-fromedges at component call sites, sotrace_lineagefrom a consuming component reaches its endpointrtk-queryDataSourceKindin core; schema regenerated (drift gate green)Result on the field-patterns fixture
3 data sources extracted; both 6F.4 attribution xfails removed and passing (
UsersPage → /api/users,InvoicesPage → /api/invoices). Remaining 5 xfails are all owned by 6F.5 (object-config routes).Verification
pnpm test: 205 tests green (4 new)pnpm eval: 285 pass · 0 fail · 5 xfail · 0 unexpected-pass, gate OK, metrics 1.000pnpm typecheck: clean🤖 Generated with Claude Code