Repository navigation
fix(cli): stop YACD_* shadowing wallet URLs and bleeding timeout/wait - #123
Merged
Merged
Conversation
…eout/wait P1 foundation (PR-1.5) of the CLI UX overhaul. Read the command-local behavior flags straight off cmd.Flags() instead of the shared viper, so an ambient YACD_* can no longer drive them: - wallet funding: chainOverridesFromViper becomes chainOverridesFromFlags(cmd), reading --ogmios-url / --kupo-url from the flags so YACD_OGMIOS_URL / YACD_KUPO_URL cannot shadow them. - up/down/install/devnet: read timeout/wait/dry-run/bare via cmd.Flags().GetDuration/GetBool, killing the cross-command YACD_TIMEOUT / YACD_WAIT / YACD_DRY_RUN / YACD_BARE bleed (these flags exist on several commands, so an ambient env value silently affected all of them). --file and --allow-mainnet stay on viper (YACD_FILE is an intentional part of the harness contract); install's --values/--set/--set-string already read off cmd.Flags() (viper StringArray mangles the Helm --set comma syntax). Tests: chainOverridesFromFlags ignores the env and reads the flags; a mechanism test shows viper is shadowed by YACD_TIMEOUT while cmd.Flags() is immune; and a child-env guard asserts the CLI-injected host env (run.go connected.env) carries only the documented host-access keys, never the flag-only UX keys, even when those are exported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
P1 / PR-1.5 of the CLI UX overhaul — the
YACD_*collision/bleed fixes (design §8.3). Reads the command-local behavior flags straight offcmd.Flags()instead of the shared viper, so an ambientYACD_*can no longer drive them.What's here
chainOverridesFromViper→chainOverridesFromFlags(cmd), reading--ogmios-url/--kupo-urlfrom the flags soYACD_OGMIOS_URL/YACD_KUPO_URLcannot shadow them. (No trust gate — funding submits a locally-signed tx and Kupo is read-only; the deleted faucet gate is not reintroduced.)up/down/install/devnetreadtimeout/wait/dry-run/bareviacmd.Flags().GetDuration/GetBool. These flags exist on several commands, so an ambientYACD_TIMEOUT/YACD_WAIT/YACD_DRY_RUN/YACD_BAREsilently affected all of them.Intentionally unchanged
--file/--allow-mainnetstay on viper —YACD_FILEis a documented part of the test-harness contract.install's--values/--set/--set-stringalready read offcmd.Flags()(viper's StringArray binding mangles the Helm--set a=1,b=2comma syntax).Testing
gofmt/go vet/go buildclean;golangci-lint0 issues;moon run root:check+moon run root:test(full envtest gate) green;git diff --checkclean.env_collisions_test.go:chainOverridesFromFlagsignores the env and reads the flags; a mechanism test shows viper is shadowed byYACD_TIMEOUTwhilecmd.Flags()is immune (demonstrating both the bug and the fix); and a child-env guard asserts the CLI-injected host env (run.go'sconnected.env) carries only the documented host-access keys — never the flag-only UX keys (YACD_OUTPUT/YACD_VERBOSE/YACD_QUIET/…) — even when those are exported.Part of the P1 foundation series (1.1 #119, 1.2 #120, 1.3 #121, 1.4 #122 merged → 1.5 → 1.6).
🤖 Generated with Claude Code