Skip to content

feat(plugins): download sources without checkout and pin catalog releases in a v2 manifest/catalog - #30636

Merged
nwparker merged 6 commits into
mainfrom
nwparker/plugins-v2-1-manifest-git
Oct 28, 2026
Merged

nwparker merged 6 commits into
mainfrom
nwparker/plugins-v2-1-manifest-git

Conversation

@nwparker

@nwparker nwparker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​645 $\color{#cf222e}{\Huge{\mathbf{−}}}$​44 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​601
Prod 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​843 $\color{#cf222e}{\Huge{\mathbf{−}}}$​82 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​761

ELI5

When Orca downloads a plugin or a plugin catalog with Git, it now only copies the files. Nothing on the user's machine runs during the download: no Git hooks, no file filters, and no unusual transports. The download also has a size limit.

Plugins can now say how much power they need, in a new manifest version. Catalogs can vouch for one exact release of a plugin, and Orca refuses anything that doesn't match it byte for byte.

What Changed

1. Downloading without a checkout (plugin-git-repository.ts, plugin-git-tree.ts, shared/plugins/plugin-git-arguments.ts)

  • Before: the plugin source was a normal clone and checkout, so the user's Git setup applied to it:
    • global hooks (including core.hooksPath) and checkout filters could run during an install;
    • url.*.insteadOf rules could send the download through file:// or another transport;
    • the download size was not limited.
  • After: Orca clones with --no-checkout --depth 1 (or fetches an exact commit) into a temporary repository:
    • the hooks path and template are empty, and only the https and ssh transports are allowed;
    • Orca lists the commit with ls-tree and writes each file's exact bytes from cat-file --batch, so no checkout runs;
    • it refuses symlinks, submodules, .git and its Windows short-name alias (GIT~1), paths that collide on case-insensitive disks, and SHA-256 repositories;
    • a watcher stops the whole Git process tree once the download grows past an approximate limit.
  • Shared argument list: the exact Git arguments live in shared code. They are added to the real-Git compatibility matrix, so CI runs them on the Git 2.25 baseline as well as newer versions.

2. Manifest v2 execution profile (plugin-execution-profile.ts)

  • Profiles run from least to most power: data, instructional, sandboxed-ui, trusted-worker.
  • A v2 manifest declares its profile. It fails to load if it contributes anything beyond that profile, and unknown keys are rejected.
  • v1 manifests keep working; Orca infers the smallest profile that covers what they declare.

3. Pinned catalog releases (plugin-catalog-release.ts, orca-marketplace.v2.json)

  • A catalog entry in the new orca-marketplace.v2.json file names the exact release it vouches for:
    • commit;
    • content hash;
    • version;
    • profile;
    • minimum Orca version;
    • contribution types.
  • Preview and install fetch that commit directly; the branch name in the listing is display text only. Any mismatch is refused.
  • The v1 file stays as it is for Orca versions that are already shipped.
  • Catalog reading: catalog fetches read only the two index files out of Git, under their own download limit. A catalog repository doesn't have to fit one plugin's size limits.
  • Cache: catalog snapshots that carry releases are cached under a new file name, so an older Orca never reads them.
  • Removed: the on-disk catalog read added in refactor(plugins): name shared catalog and manifest schema parts #30612 has no caller any more, so it is removed.

Why

  • Read blobs, don't check out. Reading blobs directly is the only way to guarantee a checkout runs nothing. Turning off individual hooks or filters misses whatever the user's setup adds next.
  • Protocol rules as -c options on each command. Git's per-protocol settings outrank the general one. Explicit never entries also beat a user's own protocol.file.allow=always. Git applies the same allowlist to redirects.
  • No partial clone. A blob-less clone (--filter=blob:none) would make each file read trigger its own network fetch. A depth-1 clone already downloads only the one commit, so the filter, and the version check it needs on older Git, aren't worth it.
  • Size watcher. Git has no client-side limit on fetch size, so the watcher is the only bound that works on every version. It polls, so the limit is approximate.
  • A second catalog file. Entries in the v1 catalog file allow no extra fields, so any new field breaks Orca versions that are already shipped. v2 entries drop unknown fields, and entries this client can't install are skipped instead of hiding the whole catalog.

Linked Issue

None — this is part of the plugin platform rework (maintainer change).

Visual Proof

N/A — no UI change. Install and preview behave the same for valid plugins. Invalid ones fail with a clear error.

Testing

  • Real Git, over an SSH test shim:

    • Hooks and smudge filters never run, including with a global core.hooksPath, by tag and by exact commit.
    • insteadOf rewrites to file:// and to http:// are refused.
    • Oversize downloads stop; symlinks and SHA-256 repositories are refused.
    • A catalog fetch with more than 2,000 files reads only the v2 index.
  • Parsing: the tree-format checks reject .git (including zero-width variants and GIT~1), colliding paths, missing parent folders, and mismatched or truncated cat-file output.

  • Profiles and releases: the profile matrix, release-versus-manifest mismatches, and tampered bytes at the pinned commit.

  • Catalog compatibility: the v1/v2 catalog rules, and separate cache files that a v1 build reads unchanged.

  • Git 2.25: the exact arguments run in git-binary-compatibility.test.ts, which CI's Git 2.25.5 lane covers. Run locally only with the system Git (2.55).

  • Platforms: macOS locally. The hook fixtures are POSIX shell, so they're skipped on Windows; CI covers Linux and Windows for the rest.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: user hooks, filters and other transports can no longer run during plugin downloads. Releases are bound to exact commit and content.
  • Windows: path checks refuse Windows device names, GIT~1, and paths that collide on case-insensitive disks. Abort kills the whole Git process tree through process-host.
  • SSH:
    • Remotes: SSH Git remotes keep working through the user's credentials.
    • Remote Orca hosts: no change — plugins install on the host that runs them.
  • Compatibility:
    • Older clients only ever read the frozen v1 catalog file and the v1 cache file.
    • Git 2.25 is covered in CI.
  • Performance: downloads fetch only one commit, and catalog fetches read two files instead of writing the repository to disk.
  • Depends on: the stdin fix PR (gitExecFileAsyncBuffer now passes input through to Git).

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — plugin tests, check:code-quality:changed and pnpm tc:node pass locally; CI covers the rest

@nwparker
nwparker force-pushed the nwparker/fix-git-exec-buffer-stdin branch from 6dfe075 to 30ae2ee Compare October 19, 2026 12:07
@nwparker
nwparker force-pushed the nwparker/plugins-v2-1-manifest-git branch from 27af974 to 226c0a1 Compare October 19, 2026 12:07
@nwparker
nwparker deleted the branch nwparker/fix-git-exec-buffer-stdin October 19, 2026 21:18
@nwparker nwparker closed this Oct 19, 2026
@nwparker nwparker reopened this Oct 19, 2026
@nwparker
nwparker changed the base branch from nwparker/fix-git-exec-buffer-stdin to main October 19, 2026 21:18
@nwparker
nwparker force-pushed the nwparker/plugins-v2-1-manifest-git branch from 226c0a1 to 8f9a8a3 Compare October 19, 2026 21:41
This was referenced Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a72272c-96a0-499e-9c71-d3b1c4dd6d4c
Commits

Reviewing files that changed from the base of the PR and between 96880d1 and 2c1552c.

Files selected for processing: 1
  • src/shared/plugin-git-download-binary-compatibility.test-cases.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

Git downloads now use bounded Git operations and validated tree materialization. Marketplace catalogs support v2 release metadata and manifest execution profiles. Marketplace preview and installation use pinned commits when release metadata is present and validate the manifest, commit, and content hash. Snapshot storage reads legacy snapshots and writes version 2 snapshots.

Priority: Normal

Merge Risk: Minimal · up to 2c155

The Windows fixture now records the mode required by the test. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly summarizes the two primary changes: checkout-free plugin source downloads and pinned catalog releases in manifest/catalog v2.
Description check Passed The description follows the required structure and provides clear user impact, implementation details, rationale, testing coverage, compatibility notes, and checklist status. The Linked Issue section …
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description follows the required structure and provides clear user impact, implementation details, rationale, testing coverage, compatibility notes, and checklist status. The Linked Issue section states that this is a maintainer change with no issue, and the remaining incomplete checklist items are explained as CI-covered.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f5f4db2-8998-4eda-a965-4284ad778f7d
Commits

Reviewing files that changed from the base of the PR and between dfff513 and b324ef1.

Files selected for processing: 2
  • src/shared/git-binary-compatibility.test.ts
  • src/shared/plugin-git-download-binary-compatibility.test-cases.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@nwparker
nwparker force-pushed the nwparker/plugins-v2-1-manifest-git branch 3 times, most recently from a22710d to 96880d1 Compare October 28, 2026 04:57

function nodeCommand(code: string): string {
const encoded = Buffer.from(code).toString('base64')
return `"${process.execPath.replaceAll('\\', '/')}" -e "eval(Buffer.from('${encoded}','base64').toString())"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not an issue: this is a test-only fixture; the evaluated code is a constant string from the test itself, base64-encoded only to survive shell quoting.

@nwparker
nwparker force-pushed the nwparker/plugins-v2-1-manifest-git branch from 96880d1 to df3870b Compare October 28, 2026 10:53
…owlist and size cap

Plugin and marketplace sources were a real clone/checkout, so user hooks,
smudge filters and core.hooksPath ran, insteadOf rules could reach any
transport, and nothing bounded the download. Now a --no-checkout depth-1
clone (or exact-commit fetch) runs with an empty hooks path, only the https
and ssh transports, and Orca writes the commit's exact blobs from ls-tree +
cat-file --batch. Symlinks, submodules, .git aliases, colliding portable
paths and SHA-256 repositories are refused. A size watcher stops the whole
Git process tree once the pack outgrows an approximate cap.

The exact argv lives in shared code and joins the real-Git compatibility
matrix, so the Git 2.25 lane runs it. Tests reach fixtures over an SSH
shim, since file transports are now refused.
data < instructional < sandboxed-ui < trusted-worker. A v2 manifest is
strict and fails when it carries contributions beyond its profile; v1
manifests keep loading with the least profile inferred from what they
declare.
A v2 catalog entry carries the release it vouches for: commit, content
hash, version, profile, minimum Orca and contribution types. Preview and
install fetch that commit directly and refuse bytes that differ. The v1
file stays strict and frozen for shipped clients; v2 entries strip unknown
keys, and entries this client cannot install are dropped at parse time.

Catalog fetches read only the index blobs under their own download cap,
so a catalog repository is not held to one plugin's limits. Release-bearing
snapshots are cached under a new key, so an older build never reads them
and simply refetches.

readMarketplaceJson and parseMarketplaceFile from #30612 are replaced by
parsePluginMarketplaceIndex: catalogs are now read as Git blobs, so the
on-disk JSON read has no caller left.
Plugin downloads now refuse the file transport, even through an insteadOf
rewrite, so the fresh-profile marketplace journey reaches its fixture
repositories through the GIT_SSH_COMMAND shim the unit tests use.
@nwparker
nwparker force-pushed the nwparker/plugins-v2-1-manifest-git branch from df3870b to 2c1552c Compare October 28, 2026 20:21
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 3/5

[High impact] The PR changes how plugins are fetched, described, and accepted across marketplace workflows.

The custom-transport bypass should be fixed before merging.

Findings

  1. P1 Security Custom Git helpers still run ▶
  2. P2 Filter test has no filter ▶

Summary

Downloads now read Git blobs without checkout. Manifest v2 adds execution profiles, and catalog v2 pins exact plugin releases.

  • Plugin downloads read files without checking them out.
  • Manifest v2 declares how much execution power a plugin needs.
  • Catalog entries can pin the exact plugin release Orca installs.
  • Release-bearing catalog snapshots use a separate cache file.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Catalog Git source] --> B[Bounded download without checkout]
  B --> C[Read v2 index or fall back to v1]
  C --> D[Catalog listing]
  D --> E[Fetch pinned plugin commit]
  E --> F[Read and check tree paths and blobs]
  F --> G[Write staging files]
  G --> H[Check manifest and content hash]
  H --> I[Compare pinned release fields]
  I --> J[Preview or install]
Loading

Reviews (1) · Last reviewed commit: "test(plugins): record the plugin fixture..." · Reviewed by Greptile

Comment on lines +6 to +9
'protocol.allow=never',
'protocol.https.allow=always',
'protocol.ssh.allow=always',
...['file', 'ext', 'git', 'http', 'ftp', 'ftps'].map((name) => `protocol.${name}.allow=never`),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Custom Git helpers still run

If a user has protocol.acme.allow=always and an insteadOf rule rewriting a plugin's HTTPS URL to acme::..., these settings still let Git run git-remote-acme. Git checks protocol.acme.allow before protocol.allow, and acme is outside the explicit deny list. The promised HTTPS/SSH-only restriction is therefore incomplete.

Set GIT_ALLOW_PROTOCOL=https:ssh in the download's child environment, overriding any inherited value, and test a custom-helper rewrite.

How this was verified: Plugin downloads retain user Git configuration, while the new restrictions override only six named denied transports and leave custom per-transport allows intact.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in #30637: plugin Git now runs with GIT_ALLOW_PROTOCOL=https:ssh, which overrides any user protocol.<helper>.allow; added an acme:: insteadOf-rewrite test.

const commit = await f.git(['rev-parse', 'HEAD'])
expect(await f.checkout(mode === 'tag' ? 'v1' : commit)).toBe(commit)
expect(await readFile(join(f.destination, 'data.bin'))).toEqual(f.bytes)
await expect(access(f.filtered)).rejects.toThrow()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Filter test has no filter

The fixture never configures filter.plugin-test.smudge. The .gitattributes entry names an undefined filter, so even a normal checkout leaves filter-executed absent. A change that brings checkout filters back could still pass this test.

Configure a smudge command that writes this marker after creating the fixture commit. Then both the tag and exact-commit cases will actually test that downloads skip filters.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in #30637: the fixture now configures a real filter.plugin-test.smudge that writes the marker, so both download cases prove filters are skipped.

@nwparker
nwparker merged commit 751e974 into main Oct 28, 2026
50 checks passed
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