Repository navigation
feat(artifacts): inspect VS Code extension packages offline - #12469
Conversation
REA had no owner for a local .vsix ZIP. inspect_vsix_package and inspect-vsix-package now read extension.vsixmanifest and extension/package.json, report identity disagreements, engine range, activation events, a contributes summary, hashed native/wasm/executable members, and a ZIP inventory without installing the extension or contacting a marketplace. Missing or malformed manifests return the inventory with limitations. Invalid ZIP input fails without partial success. Signature files are reported present or absent and are not verified.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge within its stated offline inspection scope. SummaryAdds offline VS Code package inspection through the shared CLI and MCP workflow.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
CLI["CLI command"] --> Service["VsixPackageService"]
MCP["MCP tool"] --> Service
Service --> Provider["VsixPackageProvider"]
Provider --> Snapshot["Bounded stable file snapshot"]
Snapshot --> Parser["ZIP inventory and manifest reader"]
Parser --> Evidence["Typed Evidence"]
Evidence --> Delivery["Complete result or retained summary"]
Reviews (51) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2419bd7483
ℹ️ 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 compressed extension.vsixmanifest within the 16 MiB byte budget can still expand into millions of XML nodes. Count nodes as a stream first, as the Maven POM reader does, and refuse the manifest with an xml_nodes limit before parseXmlDocument allocates its document.
The xml_nodes limit is a fixed parser ceiling, not a caller budget, so the provider fell through to a generic memory refusal that implied more memory could help. Map it through fixedAllowanceOptions as the Maven provider does and cover the public error from the provider.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdbb7fe0ea
ℹ️ 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".
VsixPackageProvider kept its own chain for cancellation, identity, path, selected-file and cleanup failures. It now supplies a dialect to classifyProviderFailure with only the package's own refusals: its parse ceilings and budget recovery, format failures, fixed reader allowances and the max_file_bytes refusal. The held snapshot still supplies the completed identity for a parser failure after the read.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b4df6a200
ℹ️ 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 package.json with an empty contributes key produced a key with an empty name, which the contract refuses, so the whole inventory was rejected. The empty key is now left out of contributes.keys and reported as a limitation.
Each hashed member was read with a fresh per-member budget, so a small compressed package with thousands of members could make the parser decode several GiB. Member reads now draw on one artifactExpansionBudgetBytes budget for the package; once it is spent, remaining members stay in the inventory without a digest and a limitation names the spent budget.
packageJsonEntryPath stripped only one leading ./, so a main such as ./out/./extension.js named extension/out/./extension.js and was reported absent even when extension/out/extension.js existed. Entry points now resolve . and .. segments under extension/; a path that climbs out of extension/ keeps its unresolved form and matches no member.
An extension-less main such as ./out/extension was looked up as a literal ZIP name and reported absent although Node resolves it to extension/out/extension.js. main now tries Node's CommonJS file and directory suffixes, browser tries the .js the web extension host adds, and the reported path is the member found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d48f127297
ℹ️ 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".
Node's directory lookup reads the directory's package.json main before falling back to index files, so an entry like main: ./out with out/package.json naming ./start.js now resolves as present.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a257f0b17
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 013ae4494b
ℹ️ 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 ZIP64 member can declare an uncompressed size above 0xffffffff while the compressed package stays under max_file_bytes. The parser skips hashing it and reports the declared size, but interesting_members[].bytes used the 32-bit uint schema, so the service rejected the whole report. The field now takes any nonnegative integer, matching contents[].uncompressed_size.
…ndex When main names a directory whose package.json is not a JSON object, Node's loader throws ERR_INVALID_PACKAGE_CONFIG rather than falling back to index.js. Keep that outcome distinct from a manifest with no usable main: mark the entry point absent and add a limitation naming the member.
A bundled .jar, .war or .ear is a ZIP, but the path classifier returned unknown for it, so it was never hashed or counted as a nested archive.
Resolve main and browser entry points against exact ZIP member names, as a case-sensitive file system would, and report a member that matches only when case is ignored as a limitation instead of marking the entry present. The directory package.json used to resolve a directory main is matched exactly too.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Merged current main into the branch (3611246) and pushed 1e2956a with the follow-up main needed: the VSIX parser and provider now use main's artifact failure shape ( |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # src/domain/artifactInspection.ts
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # .agents/skills/reverse-engineer-anything/references/native-and-artifacts.md # .cursor-plugin/skills/reverse-engineer-anything/references/native-and-artifacts.md # docs/getting-started/cli.md # docs/reference/supported-targets.md # scripts/lib/module-boundaries.mjs # scripts/lib/test-projects.mjs # src/cli.ts # src/cli/cliCommandRegistrations.ts # src/composition/capabilityDeclarations.ts # src/composition/capabilityServices.ts # src/contracts/toolContracts.ts # src/contracts/toolFamilies.ts # src/domain/analysisView/analysisView.ts # src/domain/analysisView/analysisViewResult.ts # src/server/createServer.ts # src/server/offlineInspectionToolBindings.ts # tests/acceptance/tools/localToolContracts.test.ts # tests/boundary/mcp/absoluteLocalPathTools.test.ts # tests/conformance/providerCapabilityCases.ts # tests/support/providerLifecycleCoverage.ts
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Preserve both origin/main (morluto#12469 VSIX, morluto#13245 PE overlay, morluto#14649 Qualcomm MBN) and YARA entries across conflicted skill docs and test-projects, and include qualcomm-mbn in PE_OVERLAY_LEADING_FORMATS to resolve the typecheck regression between morluto#13245 and morluto#14649.
Summary
Add
inspect_vsix_package/inspect-vsix-package: a local, read-only inspection of a VS Code.vsixas typed Evidence. The reader opens the OPC ZIP, parsesextension.vsixmanifestandextension/package.json, reports identity from both manifests and any disagreement, engine range, target platform, entry points, activation events (with*andonStartupFinishedmarked eager), a contributes summary, declared dependencies and pack members, workspace capabilities, API proposals, assets, signature-file presence, and a ZIP inventory that hashes native.nodeaddons,.wasmmodules, executables, shell scripts, and nested archives.This is the first slice of #3687 (VS Code extension reverse engineering). It does not install the extension, execute it, verify signatures, or contact a marketplace.
Problem and expected behavior
Operators need to inspect a
.vsixthey already hold without installing it. REA had no owner for that ZIP layout: vsixmanifest identity, package.json activation and contributes, and the member inventory lived nowhere in the catalog.Expected outcome: given a local path, the CLI and MCP tool return Evidence whose
normalized_resultincludes vsix and package identities, identity disagreements, engine ranges, entry-point presence, activation events with eager flags, contribute key counts and a capped command list, dependencies and pack members, untrusted/virtual workspace capabilities, API proposals, assets, signature-file presence, member-kind counts, and hashed interesting members. Missing or malformed manifests return the inventory with limitations. A non-ZIP file, duplicate names, path-traversal names, and oversize archives refuse with typed errors. Signature files are reported present or absent and are not verified.Change and scope
New dedicated inspect tool on the existing contract path: domain schema, ZIP reader, provider, application port/service, composition, CLI
registerContractCommand, MCP evidence handler, analysis-view summary, advertised schema, docs, and authored skill wording.Intentionally not included: marketplace download, VSIX signature verification, extension install or activation, webview or extension-host reconstruction, and the rest of #3687.
Contribution scope: this is a local shipped-artifact read. It does not execute the target, inject, mutate bytes, or recover protections. No additional maintainer execution/injection decision is required for that reason.
Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
src/vsix/VsixPackageParser.tsowns ZIP, vsixmanifest, and package.json facts. Consumers (VsixPackageProvider,VsixPackageService, CLI, MCP,vsixPackageView) use those parsed fields; they do not re-parse the archive. No superseded inspect path was removed.inspect_vsix_package, CLIinspect-vsix-package, familyartifact, effectevidence. Input schema includespathplusmax_file_bytes,max_entries,max_manifest_bytes, andmax_member_bytes. Catalog JSON is generated in CI; authored skill text names the command..vsixwithextension.vsixmanifestand optionalextension/package.json. Encrypted ZIP and unsupported compression are typed refusals. Requires the in-tree ZIP reader.createEvidence+completeProviderEvidence; subject digest is the selected file; locations include artifact path; limitations list the no-install, no-network, no-signature-verify, and kind-from-name rules. Observed vs inferred stays distinguishable.limitationsand the ZIP inventory. Invalid ZIP input fails without partial success aside from the file-snapshot hash.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): authored skill references and docs/index catalog wording updated; generated catalogs not committed. No new runtime dependency.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
The workflow reads one caller-selected local
.vsix. It does not launch a process, inject, mutate, contact the network, or recover protections.Evidence and regression coverage
Parser, domain, service, CLI, and MCP tests use in-code ZIP fixtures (no third-party
.vsixcommitted), including missing/malformed vsixmanifest, malformed package.json, path traversal, duplicate names, oversize members, and non-ZIP bytes. Executed CLI on those fixtures plus one public Microsoftreferences-view0.0.89 package downloaded to a scratch directory. Source-derived: vsixmanifest Identity/Assets/Properties and package.json activation/contributes shapes. No Hopper/Ghidra/browser provider run.src/domain/vsix/vsixPackage.test.ts,src/vsix/VsixPackageParser.test.ts,src/application/vsix/VsixPackageService.test.ts,src/domain/analysisView/vsixPackageView.test.ts,tests/acceptance/vsixPackageCli.test.ts,tests/boundary/mcp/vsixPackageMcp.test.ts, plus registrations in local-path admission, local tool contracts, provider capability cases, provider lifecycle coverage, and stable artifact consumers.rea inspect-vsix-packagewas not a command (COMMAND_NOT_FOUNDonupstream/main1ba93c8). After, the synthetic fixture reports vsix identitydemo.hello1.2.3, package identityhello, engine^1.74.0, eager*andonStartupFinished, signatures present, coverage complete. A non-ZIP file exits 1 withinvalid_request/invalid_formatand a 9-byte file snapshot. A malformed vsixmanifest keeps the inventory, setsvsix_identityto null, and records “The selected extension.vsixmanifest is not well-formed XML.”demo/vsix-package(commands.log,out.mp4,preview.gif). Representative output for the synthetic fixture; publicms-vscode.references-view0.0.89; non-ZIP refusal; malformed vsixmanifest limitation.references-viewpackage that was actually run; nested native addons and wasm hashing are covered by in-code fixtures rather than a large third-party extension.Boundary regressions covered: malformed input (non-ZIP, malformed XML/JSON, missing manifest, path traversal, duplicate names, oversize members/manifests), typed unsupported compression, permission/path admission via existing local-path tests, and identity preservation on parser failure (partial snapshot hash or inventory with limitations). Lifecycle regressions: in-process provider
rea-vsix-packageis listed in provider lifecycle coverage (no owned child process).For evidence-bearing changes:
Validation performed
npx vitest run src/domain/vsix/vsixPackage.test.ts src/vsix/VsixPackageParser.test.ts src/application/vsix/VsixPackageService.test.ts src/domain/analysisView/vsixPackageView.test.ts tests/acceptance/vsixPackageCli.test.ts tests/boundary/mcp/vsixPackageMcp.test.ts— 6 files, 39 passed (Node v24.22.3, Linux x86_64).npx vitest run tests/conformance/providerCapabilityConformance.test.ts tests/boundary/mcp/absoluteLocalPathTools.test.ts tests/process-global/stableArtifactConsumers.test.ts tests/acceptance/tools/localToolContracts.test.ts— 4 files, 360 passed.npm run check:fast— typecheck and lint passed; architecture guards passed across 2908 source files (22.1 s).npm run format:check— passed (8822 files).npm run knip— passed (no unused exports reported).npm run verify:test-discovery— 3813 files discovered exactly once.npm run test:changed -- --base upstream/main— 14886 passed, 2 failed. The two failures areNodeSeaArtifactReaderpost-classification mutation andUf2ArtifactReaderforged region; both fail on untouchedupstream/main1ba93c8 and are not this reader.rea inspect-vsix-packageon the synthetic fixture (exit 0, coverage complete), Open VSXms-vscode.references-view0.0.89 (exit 0),broken.vsixmalformed vsixmanifest (exit 0 with limitation),not-an-extension.vsix(exit 1,invalid_format). Baselinerea inspect-vsix-packageon 1ba93c8 exits 1,COMMAND_NOT_FOUND.Compatibility, safety, and release
skills/anddocs/public/product-catalog.jsonare not committed.Author readiness
Human owner: @mvanhorn
Before merge
type(scope): outcome.Demo
Full recording (MP4): https://raw.githubusercontent.com/mvanhorn/pr-demo-assets/main/osc-bulk-1119/vsix-package/out.mp4