Skip to content

fix(plugins): fail marketplace installs on HTTP error responses - #279

Merged
BunsDev merged 1 commit into
mainfrom
d/surface/marketplace-download-status
Oct 15, 2026
Merged

BunsDev merged 1 commit into
mainfrom
d/surface/marketplace-download-status

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 15, 2026

Copy link
Copy Markdown
Member

Summary

Marketplace plugin installs now fail on an HTTP error instead of installing the error page. Before, a 404 or 500 body was saved as plugin.zip, fell back to manifest.yaml, and the install reported success. On an update this replaced the existing manifest.

Context

  • Related request: code-surface audit, logical unit 91 ("Unit91 marketplace download HTTP status" in the surface inventory ledger; manifest entry 90). Source surface-marketplace-download-status (fix/marketplace-download-status).
  • Scope: marketplace_install in crates/plugins/src/marketplace.rs (+4 production lines) and the new crates/plugins/tests/marketplace_http.rs.
  • Non-goals: this is not a transactional install. Extraction fallback, body validity, partial writes, deadlines and size bounds, redirects and symlink paths remain separate items.

Changes

  • Check status().is_success() before reading the body. The error reports the status only, never the body.
  • Create the install directory only after the body and hash checks pass.
  • Port note: fix(plugins): validate marketplace plugin names before path joins #221 made plugin_install_dir fallible and validates the plugin name before any request. That stays (plugin_install_dir(&entry.name)?); only the create_dir_all moves.

Validation

  • RED (accepted source baseline): a 404 returned Ok for a new install, and a 404 body replaced an existing manifest (byte-checked against owned temp fixtures).
  • cargo test --locked -p claurst-plugins --test marketplace_http on this branch: pass.
    • Six cases (404, 500 and 200, each for a new and an existing install) cover the exact HTTP error and the absent body sentinel.
    • Existing manifest, marker and entry count are preserved, and no new home is created.
    • A success writes the exact YAML bytes.
    • The fixture uses env_clear, an owned COVEN_CODE_HOME, no_proxy and a loopback listener, with bounded waits.
  • cargo fmt --all -- --check, cargo check --workspace --locked, cargo clippy --workspace --all-targets --locked -- -D warnings: pass.
  • git diff --check: clean.
  • Accepted source: focused fixture and source review accepted, and full integration gates passed.
  • cargo test --workspace on this branch: hosted CI.

PR Readiness

  • Diff is limited to the unit's files.
  • Generated files were not edited by hand.
  • User-facing docs: not needed.
  • No secrets, credentials, local paths, or unrelated logs are included. No live registry is contacted.
  • Remaining risks: the non-transactional install items listed above.

marketplace_install never checked the download's status, so a 404 or
500 body was written as plugin.zip, fell back to manifest.yaml and the
install reported success, replacing an existing manifest with the error
page. Check the status before reading the body, report only the status,
and create the install directory only after the body and hash are
accepted. Existing plugin-name validation still runs before any request.

Surface unit 91 (manifest entry 90).

Coven-Harness: Claude Code / claude-opus-5-5
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 15, 2026 12:37pm UTC

Request Review

@BunsDev
BunsDev merged commit 7da632b into main Oct 15, 2026
6 checks passed
@BunsDev
BunsDev deleted the d/surface/marketplace-download-status branch October 18, 2026 07:49

This branch was successfully deployed

1 active deployment
Preview — 647ac3d8 Deployed Oct 15, 2026 by vercel[bot]
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.

1 participant