Conversation
SaxonF
added this pull request to stack #6600
September 14, 2026 11:20
SaxonF
force-pushed
the
notebooks/02-api-deepobject-query
branch
from
September 14, 2026 23:50
a1c9cf8 to
3ee8ed9
Compare
`compute.output.ts` grew a generic `-o`/`--output` policy for structured resources that have no command-specific encoding: which formats answer with a payload, how the payload is encoded, and an up-front refusal of `-o env`. None of it is compute-specific. Move it to `command-internal/resource-output.ts` as `resourceOutput`, parameterized by the command family's env-not-supported error, and have `compute.output.ts` build its three exports from it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
SaxonF
force-pushed
the
notebooks/03-cli-resource-output
branch
from
September 15, 2026 00:12
47077c2 to
b89c657
Compare
Author
|
Closing: dropped from the notebooks stack to keep that work isolated. Upstream #6554 replaced Instead, Worth doing as a standalone refactor once a third command family needs the same policy — at that point it can be reviewed on its own rather than inside a feature PR. |
SaxonF
removed this pull request from stack #6600
September 15, 2026 00:30
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.
Pure refactor, no behavior change. Prepares the ground for the
notebookscommand family, which needs exactly the same-o/--outputpolicy thatcomputealready had.What changed
compute.output.tshad grown a generic output policy for structured resources that have no command-specific encoding:-ovalues answer with a payload (an allowlist, so a format the global flag learns later does not silently start emitting TOML),json/yaml/tomlthrough the generic encoders),-o env, whose flatKEY=valueshape cannot hold a structured payload.None of that is compute-specific, so it moves to
command-internal/resource-output.tsasresourceOutput(EnvNotSupportedError), parameterized by the command family's own env-not-supported error so each family keeps its own error tag and actionability.compute.output.tsnow builds its three exports from it and keeps onlycomputeRenderFormatand its retry-suggestion helper.Reviewer notes
The extraction dropped the long explanatory comments that lived on the compute versions. Worth deciding as part of review whether the allowlist rationale in particular should be carried onto the shared helper, since it now governs two command families rather than one.