PoC: typed result contract for store execute - #8243
Draft
dmerand wants to merge 1 commit into
Draft
Conversation
Assisted-By: devx/44d59e1d-1ea0-4691-81ad-7784225a5dc4
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.
Intent
This draft is a proof of concept for migrating the finite
store executecommand to a data-only typed result contract. It keeps execution facts separate from CLI output adapters.Design
StoreExecuteResultcontains JSON-safe operation data and an optional coded failure.--output-file, the file contains the operation payload; JSON stdout contains a structured sink document.userErrorsare result-level failures: data is emitted and the command exits unsuccessfully with codeUSER_ERRORS.Explicit output decisions
userErrorswas reported as success. After, the operation payload is emitted and the command exits unsuccessfully; JSON remains data-only and does not add English sentences.--output-file: Before, the payload was written to the file and stdout was empty. After, stdout emits a JSON sink document containingoutputFile,success, and (on failure)failureCode; the file still contains only the operation payload.No other command output was changed.
--allow-mutationsremains input safety policy and is not part of the result contract or codec.Deliberately not done
BaseCommandor launcher changes.@shopify/cli-kit.Validation
pnpm --filter @shopify/store type-check: blocked by unresolved local@shopify/cli-kitdeclarations and Node globals despite dependency builds; these are environment/dependency build issues, not reported as clean.git diff --check: run before commit.