Skip to content

fix: bare selat fund is not help; selat-pay packageRoot ignores ancestor packages - #193

Merged
SELAT-DEV merged 1 commit into
mainfrom
cursor/fund-help-packageroot-d89b
Sep 17, 2026
Merged

SELAT-DEV merged 1 commit into
mainfrom
cursor/fund-help-packageroot-d89b

Conversation

@SELAT-DEV

@SELAT-DEV SELAT-DEV commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Closes #191. Closes #192.

QA residuals after Arc raw-key cleanup (#190 / discovery#170), outside the key-blind matrix.

Root cause

#191selat fund help guard. Help must be inert (-h/--help print usage, exit 0, never enter the deposit flow) and must not swallow a bare command. The guard is exact -h / --help argv tokens only. Empty argv is the deposit path: non-TTY still errors with the --amount / no TTY prompt, not Usage: selat fund.

#192packageRoot override resolve. findPackageRoot walked up from $SELAT_PAY_BIN and returned the first package.json it saw. That is wrong for a bare override (a file with no adjacent selat-pay package): an in-tree TMPDIR, or any nested temp under another package, resolved to that ancestor (here, selat-cli) and selatPayVersion() claimed its version. Env-override with a real @selat-ai/selat-pay layout (<root>/bin/selat-pay.mjs) still walks up to that package.

What changed

  • lib/commands/fund.mjs: wantsFundHelp() matches only exact -h/--help tokens; empty argv is never help.
  • lib/selat-pay.mjs: findPackageRoot only accepts package.json whose name is @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-cli package.json so a naive walk cannot pass when TMPDIR is /tmp.

Test evidence

node --test test/fund-help-guard.test.mjs test/selat-pay-resolve.test.mjs
# 12/12 pass (default TMPDIR and TMPDIR=/workspace)

npm test
# 597/597 pass

Includes:

  • bare fund (no --help) does NOT print help — still enters its own flow
  • fund --help / -h print usage, exit 0, no deposit flow
  • a bare override resolves with a null packageRoot and no version claim
  • env-override with a real package root still walks up correctly
Open in Web Open in Cursor 

…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>
@SELAT-DEV
SELAT-DEV marked this pull request as ready for review September 17, 2026 10:56
@SELAT-DEV
SELAT-DEV merged commit e4c480e into main Sep 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: selat-pay packageRoot override resolve regression test: bare selat fund (no --help) must not print Usage help

2 participants