fix: bare selat fund is not help; selat-pay packageRoot ignores ancestor packages - #193
Merged
Merged
Conversation
…estor packages Bare `selat fund` must enter the deposit flow — help matches only exact -h/--help tokens, never empty argv. findPackageRoot only accepts @selat-ai/selat-pay, so a bare SELAT_PAY_BIN under an in-tree temp dir no longer claims selat-cli's version. Closes #191 Closes #192 Co-authored-by: SELAT-DEV <SELAT-DEV@users.noreply.github.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.
Closes #191. Closes #192.
QA residuals after Arc raw-key cleanup (#190 / discovery#170), outside the key-blind matrix.
Root cause
#191 —
selat fundhelp guard. Help must be inert (-h/--helpprint usage, exit 0, never enter the deposit flow) and must not swallow a bare command. The guard is exact-h/--helpargv tokens only. Empty argv is the deposit path: non-TTY still errors with the--amount/no TTYprompt, notUsage: selat fund.#192 —
packageRootoverride resolve.findPackageRootwalked up from$SELAT_PAY_BINand returned the firstpackage.jsonit saw. That is wrong for a bare override (a file with no adjacent selat-pay package): an in-treeTMPDIR, or any nested temp under another package, resolved to that ancestor (here, selat-cli) andselatPayVersion()claimed its version. Env-override with a real@selat-ai/selat-paylayout (<root>/bin/selat-pay.mjs) still walks up to that package.What changed
lib/commands/fund.mjs:wantsFundHelp()matches only exact-h/--helptokens; empty argv is never help.lib/selat-pay.mjs:findPackageRootonly acceptspackage.jsonwhosenameis@selat-ai/selat-pay; unrelated ancestors are skipped.test/selat-pay-resolve.test.mjs: the bare-override case nests under a decoy@selat-ai/selat-clipackage.jsonso a naive walk cannot pass whenTMPDIRis/tmp.Test evidence
Includes:
bare fund (no --help) does NOT print help — still enters its own flowfund --help/-hprint usage, exit 0, no deposit flowa bare override resolves with a null packageRoot and no version claim