Repository navigation
feat(dev): one project per cloud dev environment - #480
Merged
Merged
Conversation
a4 dev up takes the environment's lease before it deploys anything,
renews it while it runs and releases it on exit. Another project's run is
refused with the holder's name and the ways out (--take-over, or
a4 dev branch for its own copy).
Protocol deploys and environment stack builds carry the lease generation.
When a renewal or a write is refused because the environment was taken
over, a4 dev up stops its automations runner and watcher and exits
non-zero ("this environment was taken over by <holder>; nothing more was
written"), without retrying under a new lease.
a4 dev status and the dev_status MCP tool show which project holds the
environment. An Arete API without environment leases answers the lease
route with a plain 404, and a4 dev up then runs without a lease.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issue remains. SummaryAdds one project per cloud dev environment through renewable leases and checks on deployment writes.
|
- A disable refused because the environment was taken over stops the run instead of counting as already disabled. - A project that takes its environment back redeploys: the other project's takeover disabled what it left there. - A refused renewal stops the session at once. - The test API serves environment leases; a test covers the refusal, the take-over and the generation on stack builds. - Docs formatting.
A token or port failure no longer leaves the environment held until the lease expires: the lease is taken just before anything deploys, and a refused take shuts the local endpoint and UI down.
# Conflicts: # docs/src/content/docs/cli/local-development.mdx # rust/arete-mcp/src/dev_env.rs
# Conflicts: # cli/src/commands/dev/mod.rs # cli/tests/dev_environments.rs # docs/src/content/docs/cli/local-development.mdx # rust/arete-mcp/src/dev_env.rs # rust/arete-mcp/src/server.rs
… stay apart The automations update and the stack lookup ran outside the session's cancellable waits, so a stalled request held up a confirmed takeover for as long as it took. They now give way to a lost lease and to a signal. The project id hashed only the absolute path, so projects at one path on different machines or containers counted as the same project and took the environment without --take-over. The id now also covers a random id kept in the checkout.
# Conflicts: # cli/src/commands/dev/mod.rs # rust/arete-mcp/src/server.rs
…n the API a4 dev up takes the lease before it loads the stacks in arete.lock, but those loads carried no generation, so the API refused them and startup reported ready without them. They now carry it, and a takeover during a load ends the run instead of being reported as one failed stack. Stopping released the lease before it stopped the UI and proxy, on a request with a 150-second timeout. Local services now stop first, and the release gives up after five seconds; the lease then expires by itself.
This branch was successfully deployed
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.
One project per cloud dev environment.
a4 dev upnow holds the environment it runs against, so two projects can't overwrite each other's deployments in one environment.What changes
a4 dev uptakes the environment's lease before it deploys anything (POST /api/dev/environments/:env/lease), renews it every 20 s and releases it on exit. A killed run's lease lapses after about a minute.a4 dev upgetsdevenv-environment-leasedwith the holder's name and deploys nothing. The message namesa4 dev up --take-overanda4 dev branch(a copy of the environment for the second project).--take-over(new flag) moves the environment to this project. The previous project's deployments there stop being served.Arete-Dev-Lease-Generationheader.devenv-lease-lost,a4 dev upstops:a4 dev status(a "held by" line, andleasein--json) and thedev_statusMCP tool show who holds the environment.cli/local-development.mdx, and the flag incli/commands.mdx.Fork state (funded wallets, warps, scenarios, resets) stays shared and unaffected.
Compatibility
An Arete API without environment leases answers the lease route with a plain 404 (no error code).
a4 dev upthen runs exactly as before, without a lease (one line ina4.log). Status omits the holder. The API also accepts writes without the header while no lease is held, so this release and the API change can ship in either order. The intended order is the API first, then this release.Tests
commands::dev::leaseunit tests:cargo test -p a4-cli --bin a4 -- commands::dev: 105 passed.cargo test -p arete-mcp: 284 passed.cargo clippy -p arete-mcp -p a4-cli --tests -- -D warnings: clean.