Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The candidate workflow and release checklist omit required coverage for imcp2-deploy, allowing a candidate to deploy successfully but fail promotion because of its stale version.
4 open issues
What changed in this PR
Prepares the hosted deploy tools for applications that embed the published imcp2 crate, including the gateway, by enabling crate publication and integrating deploy state with the server lifecycle.
Changes:
- Makes
imcp2-deploypublishable with versioned workspace dependencies and lockstep release checks. - Starts the shared deploy sweeper through
spawn_session_reaperand signals deploys to stop throughshutdown. - Documents embedder configuration and shutdown ordering, and adds a multi-instance lifecycle test.
| File | Description |
|---|---|
src/main.rs |
Delegates sweeper startup to the server lifecycle. |
src/lib.rs |
Integrates deploy startup and cancellation with existing lifecycle methods. |
src/deploy.rs |
Adds a single-start sweeper guard, lifecycle test, and configuration documentation. |
README.md |
Explains published-feature usage and embedder shutdown ordering. |
crates/imcp2-local/Cargo.toml |
Uses the shared deploy dependency declaration. |
crates/imcp2-deploy/Cargo.toml |
Enables publication and adds crate metadata. |
Cargo.toml |
Adds the versioned deploy workspace dependency. |
.github/workflows/publish-crate.yml |
Extends version checks and publication guidance to include imcp2-deploy. |
Review effort: Max
raymondk
force-pushed
the
deploy-5c-embedders
branch
from
November 18, 2026 23:50
51d4658 to
580ca47
Compare
raymondk
force-pushed
the
deploy-5c-embedders
branch
from
November 19, 2026 01:11
580ca47 to
d5ab142
Compare
…loy, and run their state from the server's own lifecycle The gateway embeds the published `imcp2` crate, so the `deploy` feature has to work from crates.io and without the bundled binary's `main`. - imcp2-deploy is published, in lockstep with the other crates: a crate on crates.io cannot depend on one that is not. `imcp2` and `imcp2-local` name it through a workspace pin (path and version). publish-crate.yml checks its version against the tag and uploads it between imcp2-core and imcp2. Its first version must be published by hand, and its trusted publisher configured, before the first tag that includes it. - `McpServer::spawn_session_reaper` starts the deploy sweeper (once per process, however many instances share the state) and `McpServer::shutdown` stops the running deploys, so an embedder that does only what it did before has both. `Deploys::stop` stays for a server that drains: called before the drain, as the bundled binary does, each deploy answers first. - `DeployConfig` documents what it reads a zero cap and a too-small store as; the library reads no environment variable. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV
…se checklist, one Deploys per process, stop before the drain, and a test that counts the sweeper - deploy-candidate.yml checks imcp2-deploy's version too, and CONTRIBUTING.md's release steps name its manifest and its workspace pin: a candidate cut by the old checklist would deploy and then fail to promote. - The README and the module docs say that a process makes one `Deploys` and hands each server a clone, and that an embedder that drains calls `Deploys::stop` before the drain; the example shows the order. - The lifecycle test counts the runtime's tasks around each `spawn_session_reaper`, so a second sweeper would fail it. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV
…deploy` says how to stop - publish-crate.yml runs the `deploy`-feature tests on the release commit, as ci.yml does: the default-feature run leaves the hosted deploy module out. - `McpServer::with_deploy` says what stopping asks of an embedder that drains — `Deploys::stop` before the drain, `Deploys::stopped` after it — instead of saying nothing more is needed. The README says the same, and that `Deploys::new` fails over a state directory in use. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV
…ill said imcp2-deploy is unpublished - `Deploys::stop` no longer says a shut-down server leaves no deploy running: it signals and returns, and `Deploys::stopped` is what waits. - The crate's rustdoc said `icp-project` comes from the icp-cli repository and that the published `imcp2` cannot carry the feature. Neither holds, and it would have been published saying so. The release comments in imcp2-local's manifest and dist-workspace.toml name the third crate. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV
raymondk
force-pushed
the
deploy-5c-embedders
branch
from
November 19, 2026 02:02
d5ab142 to
536e120
Compare
| [workspace.dependencies] | ||
| httpdate = "1.0.3" | ||
| imcp2-core = { path = "crates/imcp2-core", version = "0.6.1" } | ||
| imcp2-deploy = { path = "crates/imcp2-deploy", version = "0.6.1" } |
Comment on lines
+641
to
+642
| one per server: the caps are the process's, and making a second over a | ||
| directory in use would clear the uploads and deploys of the first. Nothing |
Contributor
Author
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.


Stacked on #249. First of four follow-ups that get the hosted deploy tools ready to be served from the gateway, which embeds the published
imcp2crate rather than running this repository's binary.Why
Two things only work today when the server is built and run from this repository:
deployfeature depends onimcp2-deploy, which is not on crates.io, so the publishedimcp2cannot carry it.main.rsmakes. An embedder that keeps doing what it does now (spawn_session_reaper(),shutdown()) would get neither.What changes
imcp2-deployis published, in lockstep with the other crates.imcp2andimcp2-localname it through a workspace pin (path and version).publish-crate.ymlchecks its version against the tag and uploads it betweenimcp2-coreandimcp2.McpServer::spawn_session_reaperstarts the deploy sweeper, once per process however many instances share the state.McpServer::shutdownstops running deploys.Deploys::stopremains for a server that drains in-flight requests: called before the drain, as the bundled binary does, each deploy answers with what it created first.DeployConfigdocuments its clamping (a zero cap is read as one, a store smaller than one archive as one archive). The library reads no environment variable; theMCP_DEPLOY_*variables stay in the bundled binary.Before the next release tag
A trusted publisher can only be configured on a crate that exists.
imcp2-deployneeds its first version published by hand and its trusted publisher configured before the firstv*tag that includes this change. Otherwise the workflow uploadsimcp2-coreand then fails onimcp2-deploy. The workflow header says so.Testing
cargo test --locked --workspace --all-targetsandcargo test --locked -p imcp2 --features deploypass; clippy is clean with and without the feature.cargo publish --locked --dry-run --workspacepackages and verifies all three crates in order.the_servers_own_lifecycle_runs_the_deploy_statecovers the sweeper starting once across two instances andshutdownstopping deploys.imcp2with--features deployagainst the registry, which cannot resolve untilimcp2-deployis published.🤖 Generated with Claude Code
https://claude.ai/code/session_01XSXgo38kH12wagL3rstXfV