Skip to content

feat(vsix): link declared extension commands to their registrations - #14977

Open
akshad-exe wants to merge 20 commits into
morluto:mainfrom
akshad-exe:feat/vsix-command-handlers
Open

akshad-exe wants to merge 20 commits into
morluto:mainfrom
akshad-exe:feat/vsix-command-handlers

Conversation

@akshad-exe

@akshad-exe akshad-exe commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds correlate_vsix_registrations / correlate-vsix-registrations, which joins the commands a VS Code extension declares with the code that registers them.

Refs #3687. First command-analysis part after #12469; @mvanhorn confirmed they are not working on it. Later parts build on this one.

Change and scope

  • Absence is reported only for complete coverage: skipped or unparsed sources, graphs without callee_fact_modules, or incompletely read declarations give undetermined. Menus are grouped by name.
  • JavaScript analysis records a module_callee fact on call sites into vscode, including require and interop-wrapped imports. Matches through an unchecked helper are labelled wrapper: unverified.
  • The VSIX report keeps every declared command (previously 32) and records menus and keybindings.
  • The new operation takes inspect_vsix_package and analyze_javascript_application Evidence and reports registered, not_found, undetermined or registered_undeclared; run-time identifiers stay unresolved.
  • VSIX_PACKAGE_PROVIDER_IDENTITY moves to domain/investigationProviders.ts.
  • Static only. The pairing of the two Evidence inputs is not verified.
  • A call omitted by a resource limit gives undetermined; a registration function the file may replace is marked replacement: possible and gives undetermined; default written on a require is not resolved as the VS Code API. Direct require("vscode") calls resolve. An unreadable command declaration leaves undeclared status undetermined.
  • detail: an MCP result above the agent result budget returns a retained summary of counts, with the complete record paged through inspect_analysis_view.

Evidence

Published extensions from Open VSX, analyzed without execution:

Extension Declared Registered Undeclared Undetermined
EditorConfig 0.18.2 1 1 1 0
prettier-vscode 12.4.0 2 2 1 0
GitLens 2026.11.260409 1199 0 0 1199

Extension results were measured before the review fixes; EditorConfig, flowrelay, shiny and promptx command counts were rechecked afterwards and unchanged.

GitLens: call analysis of its entry bundles was dropped under the analysis result budget, so nothing is claimed. It also registers through local wrapper functions, which literal matching would miss.

Known limitations

  • webpack bundles: no commands were matched in markdown-all-in-one 3.6.3 (0 of 15) or wakatime 30.2.1 (0 of 10); every command was undetermined (measured at 245d59e3b).
  • Large bundles can be truncated before their registrations (Biome 3.8.1: 0 of 1, undetermined).
  • A replaced registration function is not detected when replaced in another file, through Object.assign / defineProperty, or with delete; such a command can show registered.
  • not_found can still hide a registration: const register = vscode.commands[name]; register(...), or a computed name on an untraced object.
  • Registrations through an unchecked helper count as registered, labelled wrapper: unverified.
  • Caution has a cost: one unresolved or untraced registration-like call leaves every unmatched command undetermined, as does a reference taken before a later replacement.
  • The reported position is the registration call, not the handler body.

Validation

  • check:fast, format:check, docs:check, advertised schema summary: passed
  • 140 selected test files, 4336 tests: passed (head 16c6601e1)
  • Full suite: not run.

Author readiness

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

akshad-exe and others added 2 commits November 28, 2026 11:42
Record vscode callee facts in the JavaScript semantic graph, keep every
declared command with its menus and keybindings, and add
correlate_vsix_commands to report registered, missing, undetermined and
undeclared commands from package and application Evidence.

Refs morluto#3687

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8
@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The reviewed changes appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge.

Summary

Adds correlate_vsix_registrations to link declared extension commands with static JavaScript registrations, including menus, shortcuts, source locations, and coverage.

  • Extension command reports connect declared names to static VS Code registrations.
  • JavaScript analysis records static call paths rooted in imported modules.
  • VSIX inspection keeps every declared command and records menu and keybinding details.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  P["inspect_vsix_package Evidence"] --> C["correlate_vsix_registrations"]
  J["analyze_javascript_application Evidence"] --> C
  C --> R["Match declarations and registration calls"]
  R --> G["Apply coverage and uncertainty checks"]
  G --> E["Complete correlation Evidence"]
  E --> S["Inline result or retained summary"]
Loading

Reviews (14) · Last reviewed commit: "fix(javascript): bound write tracking fo..." · Reviewed by Greptile

akshad-exe and others added 2 commits November 28, 2026 12:57
…larations unknown

Reject value ambiguity as a vscode callee, record which callee facts a graph
carries, treat skipped sources as unanalyzed, report unmatched registrations
as undetermined when declarations are incomplete, retain each menu name once,
and count statuses in one pass.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8
A selection whose branches name one module through require no longer reports a
non-module alternative.

Refs morluto#3687

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T01:12:43.609058Z e67d887 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16c6601e1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

akshad-exe and others added 2 commits November 28, 2026 16:30
…acts

A call omitted by a resource limit leaves its entry undetermined. A member
written in the file, or a default member written on a require, is not resolved
as the VS Code API.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c8b543c6a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 498cee859d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/vsix/VsixPackageParser.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dcd518722

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/vsix/VsixPackageParser.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be61a0b236

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/vsix/VsixPackageParser.ts Resolved
akshad-exe and others added 2 commits November 28, 2026 23:14
Source order does not establish whether a write to a vscode member ran before a call, so a written member now marks its calls as possibly replaced instead of dropping or keeping them by position. Menus and keybindings with unreadable rows are unknown.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9b7363fb2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/vsix/VsixPackageParser.ts Resolved
A registration built at run time may be any declared command, and a menu or keybinding field that is not text cannot be read.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3fa0cb721

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A binding that may hold something other than vscode keeps its call as a possible identity instead of dropping it. Computed writes mark members as possibly replaced, member lookups walk each path once, and an oversized module callee is omitted with a resource-limit unknown.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4cb167c08d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

security Security Review

This PR appears safe to merge from a security standpoint.

What was checked
  • Checked whether the PR is superseded: main has no correlate_vsix_registrations or VSIX correlation code; the feature exists only in this PR's own commits.
  • The new correlate_vsix_registrations tool is data-only: it joins two caller-supplied Evidence records, runs no code, and reads no files beyond the caller's own request document.
  • Removing the 32-command cap stays bounded by the existing manifest budgets (1 MiB default package.json byte cap and the 1,048,576-value JSON allowance), so a hostile .vsix cannot blow up the report.
  • Registration calls dropped by a resource limit are recorded as located unknowns and the correlation reports undetermined instead of claiming a command has no handler; old graphs without callee_fact_modules also get undetermined.
  • Publisher-controlled strings from the manifest and JavaScript source flow only into zod-validated JSON report fields; no shell, query, file path, or HTML sink receives them, and no dependency, crypto, or authentication code changed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 245d59e3bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/vsix/VsixPackageParser.ts Resolved
Comment thread src/vsix/VsixPackageParser.ts Resolved
…te shortcuts

call, apply and bind leave unmatched commands undetermined, constructor expressions are not registrations, and menus and keybindings keep alt commands and platform overrides.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A5mgB1jLBG3CL4gxqa8xm8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37b49984d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e67d8879ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants