Add the IAC error category and its four error codes - #471
Merged
Conversation
`lstk deploy` is being built as a bundled extension, and its failures have no good home in the existing seven categories. RESOURCE is the closest - it is deliberately named generically so a future non-snapshot resource error has somewhere to land - and it would fit this one code. It is not used anyway, because a single code is not the whole picture: deploy's later phases bring a family of infrastructure-as-code failures (an unsupported service, an unimplemented resource type, an unresolvable input variable), and scattering those across RESOURCE, CONFIG and VALIDATION_ERROR would leave the domain with no coherent vocabulary. IAC_FILE_NOT_FOUND is its first member: a required IaC file or directory does not exist or cannot be read, which is what `lstk deploy detect` reports for an unreadable `--dir`. Not retryable - the same path stays missing. Note this is the first category no built-in command emits. An extension renders its own envelope rather than having lstk wrap it, so nothing in this repository returns the code today. It is enumerated here regardless, because a closed enumeration is only useful if a consumer can switch on it exhaustively without caring which binary produced the envelope - an extension's output is meant to be indistinguishable from a built-in's, and that is exactly what would break if the vocabulary lived only in the extension. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
peter-smith-phd
force-pushed
the
dpx-518-add-iac-error-category
branch
from
August 26, 2026 23:05
5512202 to
48d4ef6
Compare
peter-smith-phd
marked this pull request as ready for review
August 26, 2026 23:21
The IAC category landed with one member, on the argument that `lstk deploy`'s
later phases would bring a family of infrastructure-as-code failures and that
scattering them across RESOURCE, CONFIG and VALIDATION_ERROR would leave the
domain with no coherent vocabulary. The first of those phases is now specified,
so the rest of the family arrives with it:
IAC_NO_TOOL_DETECTED no IaC tool could be resolved for the workspace -
nothing matched, and no --tool was given. `lstk deploy`
reports this rather than guessing at a tool.
IAC_TOOL_AMBIGUOUS more than one tool matched and no choice could be made.
A workspace holding Terraform alongside a hand-written
SAM template is an ordinary layout, so detection reports
both; deploying exactly one is then a question, and this
is what it becomes when there is nobody to ask.
IAC_DEPLOY_FAILED a delegated deployment command exited non-zero.
All three are not retryable: the same invocation against the same workspace
fails the same way until something changes.
IAC_DEPLOY_FAILED is the one worth a second look, because it exists to avoid a
worse alternative. The exit-code table maps status from the envelope and
reserves 3 and 4, so a delegated tool's own exit status cannot be relayed as
lstk's - terraform exits 2 from `plan` to mean "changes present", which would
collide. The tool's status is reported in error.details instead, and this code
is what carries it.
Like IAC_FILE_NOT_FOUND, no built-in command emits any of these today: they are
enumerated here so a consumer can switch on the vocabulary exhaustively without
caring whether a built-in or a bundled extension produced the envelope.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
anisaoshafi
approved these changes
Aug 27, 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.
Adds one category and four error codes to the
--jsonenvelope vocabulary, needed by the bundledlstk deployextension that emits them. The category was necessary to add, since no other error codes came close to being useful.IACIAC_FILE_NOT_FOUNDIAC_NO_TOOL_DETECTED--toolwas given · not retryableIAC_TOOL_AMBIGUOUS--tool, and nobody to prompt) · not retryableIAC_DEPLOY_FAILEDterraform apply) exited non-zero · not retryableIAC_DEPLOY_FAILEDcarries the delegated tool's own exit status inerror.detailsrather than relaying it as lstk's: the exit-code table maps status from the envelope and reserves3and4, andterraform planexits2to mean "changes present", which would collide.No built-in command emits any of these —
lstk deployis a bundled extension and renders its own envelope — but they are enumerated here so a consumer can switch on the vocabulary exhaustively without caring which binary produced the envelope.Completes DPX-518.
🤖 Generated with Claude Code