Repository navigation
fix(state): destroy removes the persisted stack output instead of writing an empty husk - #965
Merged
Merged
Conversation
…ting an empty husk
Destroying a stack planned with `output: {}`, so `apply` re-persisted an
empty `{}` output record for the stage. `state.getOutput` then returned a
non-null, field-less husk while `state stages` no longer listed the stage,
and cross-stack `Output.stackRef` consumers crashed reading fields off the
husk at plan time instead of getting the "Have you deployed?" error.
- Add `Plan.destroy(stack)`: empty spec, `output: undefined`, and a
`destroy` marker on the plan (realizes the old Plan.destroy TODO).
- `apply` finishes a destroy plan by deleting the stage's remaining
persisted state (the stack output record) via `state.deleteStack`.
- Route all three destroy paths (engine `destroy`, `alchemy destroy`,
test scratch stacks) through `Plan.destroy`.
- `InMemoryService.deleteStack` now also drops the stage's outputs.
Fixes #961
Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/061cb1c@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/061cb1c@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/061cb1c |
DavidJFelix
added a commit
to DavidJFelix/alchemy-effect
that referenced
this pull request
Aug 7, 2026
Resolves conflicts between the dashboard work (deployment journal in apply, --ui deploy flow, delete-node pending reporting) and main's Plan.destroy + aggregated destroy failures (alchemy-run#973), destroy stack-state cleanup (alchemy-run#965), and local/live provider modes (alchemy-run#963): - apply: keep the journal exit-mapping; run state.deleteStack after the deployment journal closes on a successful destroy - collectGarbage: adopt main's outcome-based blocked/failed delete aggregation, keep the pending status report for queued deletions - deploy/destroy/test harness: Plan.destroy + apply command option - Cloudflare Workers ui: domains attr became singular domain
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.
Destroying a stack left a stale persisted output record: the destroy plan was built with
output: {}, soapplyre-persisted an empty{}husk for the stage.state.getOutputthen returned non-null whilestate stagesno longer listed the stage, and cross-stackOutput.stackRefconsumers crashed at plan time reading fields off the husk instead of getting the typedInvalidReferenceError.Fix: destroy plans now carry no output and
applydeletes the stage's persisted state once the destroy converges.destroy,alchemy destroy, test scratch stacks) now go throughPlan.destroy.InMemoryService.deleteStackalso drops the stage's outputs (the other stores already did).deploy/destroyentry points; both failed withexpected {} to be undefinedbefore the fix.Fixes #961
🤖 Generated with Claude Code