Repository navigation
Conversation
Static endpoint extraction reads the first literal argument of any call
named get as an HTTP request path unless the receiver is a provable keyed
collection. VS Code extension bundles read settings through
`workspace.getConfiguration(section).get(key)`, so every setting key
became a network endpoint: the bundled Git extension's dist/main.js
reported 173 network endpoints, nearly all of them setting names such as
`autofetchPeriod` and `blame.statusBarItem.enabled`.
The lexical receiver classifier now records a `configuration` fact for a
`.get` call whose receiver is a `getConfiguration(...)` call, inline or
through a binding whose only visible write is one unconditional
initializer. Minifiers emit `let` for these bindings, so the proof relies
on the recorded writes rather than the declaration kind, as tRPC client
root resolution already does. Endpoint extraction skips non-URL literals
for that fact in both application and web bundle analysis. Reassigned,
conditional, and shadowed receivers, URL or path literals, and other
clients such as `api.get("users")` keep their endpoints.
The receiver fact union was duplicated in three modules; consumers now
import the classifier's type.
On the Git extension bundle, network endpoints drop from 173 to 7 with
unchanged analysis time (2.1 s).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
baron
left a comment
There was a problem hiding this comment.
Source verdict: APPROVE for 24b04f2a7a602666418a8260e25ec9b81508a7b9.
Configuration receiver interpretation stays at the existing shared binding-analysis producer; static endpoint consumers use its fact instead of each reparsing source. The shared named fact type replaces duplicated unions. Stable initializer checks preserve reassignment, conditional and shadowed cases, while explicitly URL-shaped arguments remain endpoint evidence rather than being silently removed.
Focused source and public static CLI validation passed; current-main integration at 653067d799591ce2b8fdc84e99c160ac17e2860f passed typecheck and semantic regressions, including the newer memoization owner. Exact-head hosted Static checks, Test (coverage + timing), and CI required are terminal green after approving the existing unchanged repository CI workflow. No workflow/dependency/install code was changed by this PR.
This is static classification within existing capability scope, not runtime attribution or real-provider verification. Earlier sandbox process-helper failure is not reported as a source pass or a cleanup settlement; validation limits remain separate.
Review Finding & Edge CaseThe exclusion of configuration accessor keys from endpoint discovery is well-intentioned, but there is an edge case in const isConfigurationAccessorCall = (node: t.Node): boolean =>
(t.isCallExpression(node) || t.isOptionalCallExpression(node)) &&
(t.isIdentifier(node.callee)
? node.callee.name === "getConfiguration"
: (t.isMemberExpression(node.callee) ||
t.isOptionalMemberExpression(node.callee)) &&
semanticStaticPropertyKey(node.callee.property, node.callee.computed) ===
"getConfiguration");Finding
Suggested FixTighten the check to verify that member-expression calls originate from known configuration hosts (e.g. |
A bare or differently scoped `getConfiguration(...)` may be an
application's own HTTP client factory, so `.get("users")` on its result
lost its endpoint. Only `workspace.getConfiguration(...)` and
`<x>.workspace.getConfiguration(...)` now produce the configuration fact.
Minifiers keep property names, so the bundled VS Code Git extension still
reports 7 network endpoints instead of 173.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@matbrgz Thanks, good catch on the scoping. One correction: Fixed in 67123bf: the configuration fact now requires |
baron
left a comment
There was a problem hiding this comment.
Merge gate: HELD at 67123bf5debab3ddbb83f0c8bd1f832c9efc6965.
The head moved from the previously approved24b04f2 while merging. I reviewed the two-file update narrowing configuration recognition to workspace.getConfiguration and preserving application HTTP factories. Fresh integration with main c462a4e passed typecheck and171 focused semantic/web-bundle/artifact-path regressions.
However, the newly approved exact-head CI run38325817119 is red: shard4/6 fails three GhidraInstallation.test.ts native-decompiler admission assertions (lines619, accepted-header explanation case, and709). Required Test (coverage + timing) and CI required consequently fail. The assertions are outside this JavaScript update; attribution to this PR versus its baseline/integration is not established. Passing focused tests cannot override these failed mandatory gates. No merge, timeout/assertion weakening or rerun-to-hide-failure was performed.
|
@greptileai review |
|
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Configuration recognition previously depended only on workspace spelling. The classifier now consults lexical bindings and known vscode import/require origins; a locally declared unrelated workspace or namespace keeps its endpoint candidates. Both analyzer parity cases were extended. Current source: f3397e0. Validation: source inspection only; tests and checks were skipped at the user's explicit request. The lexical proof now accepts a single default namespace import from vscode in addition to namespace and require forms. A default-import case was added to the existing two-analyzer parity fixture; unrelated local workspace/namespace objects still retain endpoint candidates. Current source: f3397e0. Validation: source inspection only; tests and checks were skipped at the user's explicit request. |
The configuration-read parity test from main (morluto#2402) compared every static analysis endpoint with the web bundle analyzer. This branch (2cf4d02) deliberately reports URL-like strings that no request consumes as data endpoints, so the path-like getConfiguration("/api") arguments now appear with kind "data". The web bundle analyzer does not report data values. The assertion now ignores data endpoints, as the neighbouring parity tests on this branch already do; the configuration get keys are still not endpoints.
Problem
Static endpoint extraction treats the first literal argument of any
*.get(...)call as an HTTP request path unless the receiver is a provable keyed collection (eb68761). VS Code extension bundles read settings throughworkspace.getConfiguration(section).get(key), so every setting key is reported as a network endpoint.Running the published
[email protected]analyze-javascript-applicationon the Git extension bundled with VS Code (resources/app/extensions/git) returned 109networkendpoint nodes, nearly all of them setting names such asautofetchPeriod,blame.statusBarItem.enabled, andtimeline.date. Static analysis of that extension'sdist/main.jsalone yields 173 network endpoint findings.Change
classifyParsedJavaScriptOpenReceivers(the single owner of lexical receiver facts) now records aconfigurationfact for a.getcall whose receiver is agetConfiguration(...)call:vscode.workspace.getConfiguration("git").get("autofetch")let c = Mt.workspace.getConfiguration("git", uri), l = c.get("timeline.date"). Minifiers emitlethere, so the proof uses the recorded writes (semanticStableInitializer) rather than the declaration kind, as tRPC client root resolution already does.endpointArgumentskips non-URL literals for that fact, in both application analysis and web bundle analysis (both consume the same facts).config.get("/v1/settings")); and other possible base-URL clients such asapi.get("users").javascriptStaticAnalysisHelpers.tsandjavascriptStaticAnalysisState.tsnow importJavaScriptOpenReceiverFact.Measurements
analyzeJavaScriptStaticSourceon VS Code'sextensions/git/dist/main.js(warm, same host):The 7 remaining are not provable by this rule and are left untouched:
(isTrusted ? getConfiguration(...) : e).get(...)receivers and VS CodeMementoreads (globalState.get,workspaceState) — the latter could be a follow-up.Verification
keeps configuration setting reads out of endpoints in both analyzersinsrc/domain/webBundleAnalyzer.test.tscovers positives and the kept cases above for both analyzers.vitest run src/domain/webBundleAnalyzer.test.ts src/domain/javascript/ src/application/javascript/(rebased on current main): 1415 passed.npm run check:fast(typecheck + lint): passed.domain services adapters composition conformance evaluation) on Windows 11 x64, Node 22.23.1: same 126 pre-existing failures asmainon this host (missing locally built Windows native addon,/tmppaths, Windows-invalid file names), +1 passing test.Unavailable coverage: boundary/acceptance projects and the real CLI run from source were not executed on this host because the Windows native addon cannot be built outside the Linux/MinGW lane; the before/after numbers come from the domain analyzer directly. No real-provider lanes apply.
🤖 Generated with Claude Code