Repository navigation
test: deployment security and CLI usage-error regression suites (SW-090, SW-093, SW-094, SW-095) - #252
Merged
dDevAhmed merged 1 commit intoOct 18, 2026
Conversation
- SW-090: redact secret-like subprocess output in the process supervisor, buffering partial lines so secrets split across chunks are still caught, and test that deploy stdout/stderr never reflects secret fixtures while failures stay actionable. - SW-093: add an offline umbrella suite covering the network, source, process and output boundaries of the real deploy path together, asserting every spawned invocation targets Testnet only. - SW-094: report unknown root commands as unknown commands with a typo suggestion and the registered command inventory instead of an "excess arguments" error and a full help dump. - SW-095: give subcommands the root's exit override and remediation so unknown options and other usage errors exit 2 with a concise hint. Closes DigiNodes#190, closes DigiNodes#193, closes DigiNodes#194, closes DigiNodes#195 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Adds regression coverage for the deployment security boundaries and for unknown-command/option UX. Writing these tests uncovered three defects, fixed here:
stellarforge deploreportedtoo many argumentsfollowed by a full help dump. It now reportsunknown command 'deplo', suggests(Did you mean deploy?), and lists the registered commands.stellarforge deploy --bogusexited1instead of the validation code2, becauseaddCommanddoes not inherit the root'sexitOverride. All subcommand usage errors now exit2with a one-line--helphint.Related Issue
Closes #193
Closes #190
Closes #194
Closes #195
Also addresses #190, #194 and #195 (SW-093 depends on SW-090; SW-094/SW-095 share the root-command change).
Scope
src/output/redaction.ts:redactSecretLikeText(StellarS…secret strkeys, bearer tokens, and values after sensitive labels such assecret,seed phrase,mnemonic,password,token).src/dev/orchestrator.ts: buffered, redacting line writer; flushes on stream end, exit and error.src/commands/root.ts: root reports unknown commands via Commander'sunknownCommand(); concise remediation on root and every subcommand.deployment-security.test.ts: umbrella suite running the real deploy path with onlynode:child_processmocked. It covers the network, source, process and output boundaries, and after every test it asserts that any spawned invocation targets Testnet only.deploy-output-secrets.test.ts,redaction.test.ts: secret non-reflection.unknown-command.test.ts,unknown-option.test.ts: remediation copy, consistent exit codes, no post-v1 commands advertised.--help,--versionand no-argument behaviour are unchanged.Testing
npm run typecheck,npm run lint,npm run format:checkandnpm testall pass (37 files, 249 tests). The new suites are deterministic and offline: no real subprocesses or network access. All secret fixtures are synthetic.Two existing assertions in
tests/executable.test.tswere updated: root usage errors now print a concise hint instead of the full help text.Security Impact
Security notes: subprocess output (dev, test, deploy) is now redacted before reaching the terminal. Redaction is conservative: after a sensitive label, the rest of that line is withheld, because multi-word values like seed phrases can't be reliably bounded. Unterminated lines are buffered up to 64 KiB before being flushed. Mainnet deployment remains impossible, and the umbrella suite locks this in.
Release Impact
No published/user-visible behavior change
Patch
Minor
Breaking/pre-1.0 contract change
Changeset included where required
Changeset not required; reason explained below
Release notes: clearer unknown-command/option errors with consistent exit code
2; secret-like values are redacted from subprocess output.Documentation
Checklist
docs/contributing/wave-architecture.mdfor Stellar Wave work🤖 Generated with Claude Code