feat(extractors): detect jQuery $.ajax/$.get/$.post and axios object-form as HTTP consumers#887
Conversation
…form as HTTP consumers
The JS/TS HTTP consumer extractor currently recognises fetch() and
axios.<verb>() but misses three patterns extremely common in Laravel
and legacy frontends:
- jQuery shorthand: $.get(url), $.post(url, data)
- jQuery ajax form: $.ajax({ url, method }) / $.ajax({ url, type })
- axios object form: axios({ method, url })
Missing them means the frontend->backend cross-link disappears from
`group sync`, breaking impact analysis for whole classes of repos.
Implementation (node.ts):
- 3 new PatternSpecs alongside the existing FETCH_/AXIOS_ specs
- NodePatternBundle extended with jqueryShorthand / jqueryAjax /
axiosObject slots, compiled for JS / TS / TSX grammars
- readStringProp() helper walks object-literal `pair` children and
resolves `url` / `method` / `type` keys independent of order,
sidestepping the positional S-expression constraint on the
query form proposed in the issue
- 3 new scan loops in scanBundle() emit HttpDetection with
framework 'jquery' (new) or 'axios' (existing), confidence 0.7
to match the existing source-scan consumers, defaulting method
to GET when absent (matches both jQuery and axios runtime)
Tests (http-route-extractor.test.ts): 4 new cases -- 3 positive
(shorthand, ajax with method:/type: and default GET, object-form
with swapped key order and default GET) plus 1 negative control
that asserts unrelated \$.fn.extend / \$.each / non-axios helper
calls with {url, method} literals produce zero consumer contracts.
Closes abhigyanpatwari#828
|
@azizur100389 is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
@claude Act as a senior reviewer for GitNexus. Your job is to determine whether this PR is production-ready for this repo, not to give a generic code review. You are reviewing a PR in the GitNexus monorepo:
Your task has 2 phases, in this exact order: PHASE 1 — DEFINE THE BAR PHASE 2 — REVIEW THE PR AGAINST THAT BAR CONTEXT TO LOAD FIRST
Additional context:
PRIMARY OBJECTIVE Do not optimize for completeness at the expense of signal. REVIEW RULES
For each finding, assign one severity:
REPO-SPECIFIC REVIEW CHECKLIST 1. Correctness & functional completenessCheck:
2. Code clarity & clean codeCheck:
3. Test coverage & change safetyEvaluate against TESTING.md:
4. PerformanceInspect for:
5. Operational riskCheck:
6. MaintainabilityCheck:
NON-NEGOTIABLES TO VERIFY
OUTPUT FORMAT Production-ready bar for this PRGive a concise repo-specific definition in 5–10 bullets. FindingsFor each finding, use this structure exactly: [BLOCKING|NON-BLOCKING|NIT] Short title
Only include findings that are real and supported.
What I could not fully verifyList any behavior you could not prove from the diff, tests, or available context. Final verdictChoose exactly one:
If verdict is not ready, list the blocking items in priority order. IMPORTANT REVIEW BEHAVIOR
|
|
Claude finished @magyargergo's task in 2m 51s —— View job PR Review — feat(extractors): jQuery & axios object-form HTTP consumers
Production-ready bar for this PRBased on AGENTS.md, GUARDRAILS.md, CONTRIBUTING.md, TESTING.md, and ARCHITECTURE.md — applied specifically to a source-scan consumer extractor plugin in
Findings1. Correctness & functional completenessNo blocking issues found. The three new patterns are structurally disjoint:
2. Code clarity & clean codeNIT:
No dead code, no drive-by refactors, no barrel regressions, no 3. Test coverage & change safetyNo blocking issues found. Four new tests in
Assertions are meaningful: NON-BLOCKING: No test for
4. PerformanceNo issues found in this area based on the diff and reviewed context. The three 5. Operational riskNo issues found in this area based on the diff and reviewed context.
6. MaintainabilityNo issues found in this area based on the diff and reviewed context. This change is correctly scoped to Non-negotiables
What I could not fully verify
Final verdict✅ Ready to merge — no blocking issues. The implementation is correct, additive, and maintains all existing contracts. The three new patterns are structurally disjoint from each other and from existing patterns. The single NON-BLOCKING item (missing |
|
Can you please address the findings sections? 🙏 Nice PR btw! 🚀 |
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 6339 tests passed 97 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
Extend the existing $.ajax fixture with `url: \`/api/orders/\${id}\``
and assert the consumer is emitted as http::GET::/api/orders/{param}.
This makes jQuery + template-URL explicit rather than implicit via the
axios object test (readStringProp already accepts template_string for
both; this is coverage, not new behaviour).
Addresses the single non-blocking finding on PR abhigyanpatwari#887.
|
Thanks for the review — addressed the findings below. 1. NON-BLOCKING — missing
|
|
@claude Act as a senior reviewer for GitNexus. Your job is to determine whether this PR is production-ready for this repo, not to give a generic code review. You are reviewing a PR in the GitNexus monorepo:
Your task has 2 phases, in this exact order: PHASE 1 — DEFINE THE BAR PHASE 2 — REVIEW THE PR AGAINST THAT BAR CONTEXT TO LOAD FIRST
Additional context:
PRIMARY OBJECTIVE Do not optimize for completeness at the expense of signal. REVIEW RULES
For each finding, assign one severity:
REPO-SPECIFIC REVIEW CHECKLIST 1. Correctness & functional completenessCheck:
2. Code clarity & clean codeCheck:
3. Test coverage & change safetyEvaluate against TESTING.md:
4. PerformanceInspect for:
5. Operational riskCheck:
6. MaintainabilityCheck:
NON-NEGOTIABLES TO VERIFY
OUTPUT FORMAT Production-ready bar for this PRGive a concise repo-specific definition in 5–10 bullets. FindingsFor each finding, use this structure exactly: [BLOCKING|NON-BLOCKING|NIT] Short title
Only include findings that are real and supported.
What I could not fully verifyList any behavior you could not prove from the diff, tests, or available context. Final verdictChoose exactly one:
If verdict is not ready, list the blocking items in priority order. IMPORTANT REVIEW BEHAVIOR
|
|
Claude finished @magyargergo's task in 3m 6s —— View job PR Review — feat(extractors): jQuery & axios object-form HTTP consumers
Production-ready bar for this PRBased on AGENTS.md, GUARDRAILS.md, CONTRIBUTING.md, TESTING.md, and ARCHITECTURE.md — applied specifically to an additive consumer extractor plugin in
Findings1. Correctness & functional completeness
Structural disjointness verified:
2. Code clarity & clean codeNIT:
No dead code, no drive-by refactors, no barrel regressions, no 3. Test coverage & change safety
The four new tests cover all required dimensions:
Assertions are meaningful: CI confirms: 6339 tests passing across Ubuntu + macOS + Windows, 4. Performance
The three 5. Operational risk
6. Maintainability
This change is correctly scoped to Non-negotiables
What I could not fully verify
Final verdict✅ Ready to merge — no blocking issues. The previously NON-BLOCKING finding (missing |
Bumps gitnexus to v1.6.2 and adds the matching CHANGELOG entry. Highlights since v1.6.1 (61 commits): - Docker support (#848) - Language-agnostic heritage / call / variable extractors (config+factory pattern, #877 #878 #890) - AST-aware embedding chunking (#889) - jQuery / axios HTTP consumer detection (#887) - SemanticModel wired as first-class resolution input, SM-20 (#885) - ImportSemantics split into per-strategy hooks (#886) - Python dotted-import fix (#899); worker warnings non-terminal (#900 / #261); global-install ENOTEMPTY fixes (#843 #846); embeddings staleness fix (#831) See gitnexus/CHANGELOG.md for the full list. After merge, tag `v1.6.2` triggers publish.yml which runs CI, verifies tag↔package.json match, publishes to npm with provenance, and creates the GitHub Release using the extracted CHANGELOG body.
Bumps gitnexus to v1.6.2 and adds the matching CHANGELOG entry. Highlights since v1.6.1 (61 commits): - Docker support (#848) - Language-agnostic heritage / call / variable extractors (config+factory pattern, #877 #878 #890) - AST-aware embedding chunking (#889) - jQuery / axios HTTP consumer detection (#887) - SemanticModel wired as first-class resolution input, SM-20 (#885) - ImportSemantics split into per-strategy hooks (#886) - Python dotted-import fix (#899); worker warnings non-terminal (#900 / #261); global-install ENOTEMPTY fixes (#843 #846); embeddings staleness fix (#831) See gitnexus/CHANGELOG.md for the full list. After merge, tag `v1.6.2` triggers publish.yml which runs CI, verifies tag↔package.json match, publishes to npm with provenance, and creates the GitHub Release using the extracted CHANGELOG body.
…form as HTTP consumers (abhigyanpatwari#887) * feat(extractors): detect jQuery $.ajax/$.get/$.post and axios object-form as HTTP consumers The JS/TS HTTP consumer extractor currently recognises fetch() and axios.<verb>() but misses three patterns extremely common in Laravel and legacy frontends: - jQuery shorthand: $.get(url), $.post(url, data) - jQuery ajax form: $.ajax({ url, method }) / $.ajax({ url, type }) - axios object form: axios({ method, url }) Missing them means the frontend->backend cross-link disappears from `group sync`, breaking impact analysis for whole classes of repos. Implementation (node.ts): - 3 new PatternSpecs alongside the existing FETCH_/AXIOS_ specs - NodePatternBundle extended with jqueryShorthand / jqueryAjax / axiosObject slots, compiled for JS / TS / TSX grammars - readStringProp() helper walks object-literal `pair` children and resolves `url` / `method` / `type` keys independent of order, sidestepping the positional S-expression constraint on the query form proposed in the issue - 3 new scan loops in scanBundle() emit HttpDetection with framework 'jquery' (new) or 'axios' (existing), confidence 0.7 to match the existing source-scan consumers, defaulting method to GET when absent (matches both jQuery and axios runtime) Tests (http-route-extractor.test.ts): 4 new cases -- 3 positive (shorthand, ajax with method:/type: and default GET, object-form with swapped key order and default GET) plus 1 negative control that asserts unrelated \$.fn.extend / \$.each / non-axios helper calls with {url, method} literals produce zero consumer contracts. Closes abhigyanpatwari#828 * test(extractors): cover jQuery $.ajax with template-literal URL Extend the existing $.ajax fixture with `url: \`/api/orders/\${id}\`` and assert the consumer is emitted as http::GET::/api/orders/{param}. This makes jQuery + template-URL explicit rather than implicit via the axios object test (readStringProp already accepts template_string for both; this is coverage, not new behaviour). Addresses the single non-blocking finding on PR abhigyanpatwari#887.
Bumps gitnexus to v1.6.2 and adds the matching CHANGELOG entry. Highlights since v1.6.1 (61 commits): - Docker support (abhigyanpatwari#848) - Language-agnostic heritage / call / variable extractors (config+factory pattern, abhigyanpatwari#877 abhigyanpatwari#878 abhigyanpatwari#890) - AST-aware embedding chunking (abhigyanpatwari#889) - jQuery / axios HTTP consumer detection (abhigyanpatwari#887) - SemanticModel wired as first-class resolution input, SM-20 (abhigyanpatwari#885) - ImportSemantics split into per-strategy hooks (abhigyanpatwari#886) - Python dotted-import fix (abhigyanpatwari#899); worker warnings non-terminal (abhigyanpatwari#900 / abhigyanpatwari#261); global-install ENOTEMPTY fixes (abhigyanpatwari#843 abhigyanpatwari#846); embeddings staleness fix (abhigyanpatwari#831) See gitnexus/CHANGELOG.md for the full list. After merge, tag `v1.6.2` triggers publish.yml which runs CI, verifies tag↔package.json match, publishes to npm with provenance, and creates the GitHub Release using the extracted CHANGELOG body.
Closes #828.
Summary
Extend the JS/TS HTTP consumer extractor (
gitnexus/src/core/group/extractors/http-patterns/node.ts) so that three widely-used call shapes emitconsumercontracts the same wayfetch()andaxios.<verb>()already do:$.get('/api/x'),$.post('/api/x', data)$.ajax({ url: '/api/x', method: 'GET' })/$.ajax({ url: '/api/x', type: 'GET' })axios({ method: 'POST', url: '/api/x' })Why
group syncover any Laravel / legacy frontend repo currently produces zero consumer contracts for files that use$.ajax/$.get/$.post— the cross-link between the frontend caller and the backend route is silently invisible, so downstream impact analysis misses real dependencies. Same story for codebases that callaxios({ method, url })instead of the dotted shorthand.Implementation
node.ts:PatternSpecs alongside the existingFETCH_*_SPEC/AXIOS_SPEC:JQUERY_SHORTHAND_SPEC,JQUERY_AJAX_SPEC,AXIOS_OBJECT_SPEC.NodePatternBundlegainsjqueryShorthand/jqueryAjax/axiosObjectslots, compiled once per JS / TS / TSX grammar via the existingcompileBundle()path.readStringProp()helper walkspairchildren of an(object)literal and resolvesurl/method/typekeys independent of declaration order.scanBundle()emitHttpDetection { role: 'consumer', framework: 'jquery' | 'axios', ... }with confidence0.7(matching the existing source-scan consumers) and default methodGETwhen absent (matches both jQuery$.ajaxand axios runtime defaults).Deviation from the issue's proposed patterns
The issue sketches one tree-sitter query per pattern that encodes
urlandmethodas adjacentpairchildren. S-expression matching is positional — that forces a specific key order, which isn't guaranteed for JS object literals. This PR instead captures the options object and resolves keys in TypeScript post-processing, so{ url, method }and{ method, url }are both matched. The same path also accepts jQuery'stype:synonym formethod:(jQuery supports both; the issue example only showedtype).Tests
gitnexus/test/unit/group/http-route-extractor.test.ts— 4 newit()cases under the existing consumer-extraction block:extracts jQuery $.get and $.post shorthand— assertshttp::GET::/api/usersandhttp::POST::/api/userswithframework: 'jquery'.extracts jQuery $.ajax with method: and type: keys and default GET— coversmethod: 'PUT',type: 'DELETE', and a method-less call defaulting toGET.extracts axios({ method, url }) object form regardless of key order— proves post-processing is order-independent and that a url-only call defaults toGET.does not emit consumers for unrelated object-literal calls (negative control)—$.fn.extend(...),$.each(...), a non-axios helper call, and a bareconst cfg = { url, method }all produce zero consumer contracts, so the new patterns can't overmatch.Test plan
npx vitest run test/unit/group/http-route-extractor.test.ts→22 passed(18 existing + 4 new)npm run test:unit→ only the 4 pre-existing unrelated failures (test/unit/skip-git-cli.test.tsandtest/unit/git-utils.test.ts— both fail identically onmainbefore this change; neither touches the extractor surface)npx tsc --noEmit→ cleanSafety / backwards-compat
PatternSpecs, new bundle slots, new loops. No existing code path modified.HttpDetection/ExtractedContractshape — the orchestrator normalises these detections identically to the existing fetch/axios consumers.framework: 'jquery'is a new label;framework: 'axios'is reused so downstream grouping stays consistent.axios(...)identifier-form vsaxios.x(...)member-form;$.get/$.postshorthand vs$.ajaxobject), so no dedup state is needed.