Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Existing store directories can retain unsafe permissions, allowing other local users to replace received bundle trees before deployment.
3 open issues
What changed in this PR
Adds an upload-store API for remote deployments, preparing session-bound bundles for the later deploy pipeline without retaining the archive. HTTP routing remains for a later PR.
Changes:
- Adds single-use tickets and streaming extraction with size limits, plugin validation, and timeouts.
- Implements shared storage accounting, replacement, expiry, and cleanup, with lifecycle tests.
- Exposes
Uploadsthrough the deploy module.
| File | Description |
|---|---|
crates/imcp2-core/src/deploy/uploads.rs |
Implements the upload store, resource controls, validation, cleanup, and tests. |
crates/imcp2-core/src/deploy/mod.rs |
Exports the upload store and updates staged-rollout documentation. |
Review effort: Max
This was referenced Nov 19, 2026
raymondk
marked this pull request as draft
November 19, 2026 03:12
raymondk
force-pushed
the
deploy-core-2-upload-store
branch
from
November 19, 2026 04:06
c618806 to
c731dd7
Compare
For a server the agent cannot hand a file to. A tool call carries JSON the model writes, which cannot be an archive, so the bundle arrives on an ordinary `PUT` authorised by a one-time ticket minted inside an authenticated tool call (`imcp2_core::deploy::Uploads`). - **Tickets**: 256 random bits, single use, five minutes, one pending per session, and the upload deployable by the session that minted it alone. - **Extracted as it arrives.** The body is fed to the bundle host a chunk at a time, on a thread that owns the body and cleans up after itself, so the archive is nowhere whole and the upload stops at the byte that takes the archive, or what it extracts to, past its limit. What the store holds is the extracted bundle, which its deploy takes by a rename. What is not a bundle, or carries a sync plugin the server does not run, is refused here, before any deploy is asked for. - **Bounded in the bytes it keeps**, since a server's state directory may be a RAM filesystem: one budget for the store, in extracted bytes. A bundle arriving or being deployed is charged the most one may come to, one waiting what it came to; a session has one upload at a time; an upload waits five minutes for its deploy; a body that stalls or takes too long is given up on; and what an earlier process left is removed when a store is made. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV
raymondk
force-pushed
the
deploy-core-2-upload-store
branch
from
November 19, 2026 15:59
c731dd7 to
f2e1067
Compare
… directory private Two review findings on the upload store. A bundle that lapsed or was replaced was removed (a recursive delete) under the state mutex, on whichever Tokio worker ran mint, receive or take, so every session's calls waited on it. The store now only stops holding the bundle under the lock; the tree is removed once the lock is released, on a blocking thread. Its bytes stay charged until it is gone, so the budget is still of what is on disk. An arrival or a deploy that finds a lapsed bundle counts it as room, as before, and removes it before it writes: on the extraction thread for an arrival, awaited for a deploy. A store directory that existed already was taken as it was, whatever its mode. Under one other users can write to, a bundle's directory could be renamed away and another tree put in its place before the deploy. An existing directory is now made 0700, at the store's making and at each upload, and the upload refused if it cannot be. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Second of six. Stacked on the bundle host PR.
What this PR adds
imcp2_core::deploy::Uploads: how a bundle reaches a server that cannot read the user's disk. A tool call carries JSON the model writes, which cannot be an archive, so the bundle arrives on an ordinaryPUTauthorised by a one-time ticket minted inside an authenticated tool call.Notes for review
Testing
Extraction on arrival, both size limits (including stopping without reading the rest of the body), budget charging at each stage, a refused replacement, stalled and abandoned uploads, the plugin allowlist, and leftovers cleared at start.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV