Remove .statespace/state.json from deploy#145
Merged
Conversation
Remove the hidden .statespace/state.json that the CLI wrote into project directories on every deploy. This was a legacy artifact from when we planned to support incremental file uploads via checksums — but the checksum cache was never actually used to skip individual files. The only thing it did was skip the entire deploy when nothing changed, which isn't worth a hidden dotfile. More importantly, the cached app name was error-prone: if the state.json pointed at a different app than the one you intended (stale state, shared fixture, different environment), deploy would silently target the wrong app or fail with a confusing 'name already taken' error because resolve_target chose Create vs Upsert based on whether the cached name matched --name. Now the behavior is simple and explicit: - `deploy <path> --name <name>` — always upserts (creates or updates) - `deploy <path>` (no --name) — creates with a random name Amp-Thread-ID: https://ampcode.com/threads/T-019ce34b-7d1d-76a8-b515-6ba697e09885
|
Caution Review failedPull request was closed or merged during review WalkthroughThis PR removes the local deploy state persistence mechanism and simplifies the deployment flow by eliminating multi-entity deployment modeling. Name resolution is now inlined; when names are omitted, random names are generated. The state module is deleted, and documentation is updated to reflect the new behavior. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
This was referenced Mar 13, 2026
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.
Remove the hidden
.statespace/state.jsonthat the CLI wrote into project directories on every deploy.This was a legacy artifact from when we planned incremental file uploads via checksums. In practice, the checksum cache was never used to skip individual files — it only skipped the entire deploy when nothing changed. Not worth a hidden dotfile for that.
The cached app name was also error-prone: if
state.jsonpointed at a stale or wrong app (shared fixture, different environment), deploy would silently target the wrong app or fail with a confusing "name already taken" error — becauseresolve_targetchoseDeployMode::CreatevsDeployMode::Upsertbased on whether the cached name matched--name.New behavior:
deploy <path> --name <name>— always upserts (creates or updates)deploy <path>(no--name) — creates with a random nameSummary by CodeRabbit
Changes
Documentation