ci: harden nightly integration workflow — drop artifact upload#3
Open
vrogojin wants to merge 1 commit into
Open
ci: harden nightly integration workflow — drop artifact upload#3vrogojin wants to merge 1 commit into
vrogojin wants to merge 1 commit into
Conversation
Steelman warning from post-merge review: the on-failure upload-artifact
step harvested /tmp/sphere-cli-it-*/ into 7-day GitHub Actions storage.
Those dirs hold secp256k1 testnet wallet material (mnemonic + private
key) that the integration helpers explicitly shred on exit for hygiene
reasons — uploading the same material as an artifact defeats that.
Even though the keys are throwaway and hold no funds, harvesting them
fails principle-of-least-privilege and could leak into CI logs, Slack
paste-backs, or tickets.
Also while here:
* permissions: contents: read — least-privilege default
* concurrency: group:integration-nightly — prevent cron+dispatch
double-hammering public testnet infra
* sphere-sdk SHA pin — aligned with ci.yml (was branch-pinned)
vrogojin
pushed a commit
that referenced
this pull request
May 15, 2026
Add cli-multiaddress.integration.test.ts pinning the four multi-address
commands (addresses / switch / hide / unhide) plus, critically, the
TOKEN ISOLATION INVARIANT across HD-derived addresses.
The CLI extraction left two distinct things uncovered:
A) CLI plumbing for the multi-address commands (namespace bridge,
arg parsing, help text).
B) The security-critical guarantee that tokens belonging to address
#N never leak to address #M after a switch. A regression here
would mean a user who switched to a fresh address could
accidentally spend tokens that belong to a different HD branch.
The architectural mechanism is per-address token storage: Node.js
FileTokenStorageProvider keeps a separate `tokens/<addressId>/`
subdirectory per tracked address. `sphere.payments.getTokens()` reads
from the storage bound to the currently-active address — so as long
as the directory split is honoured, isolation holds.
Four layers of pins:
1. Help-shape pins (offline, 4 tests) — `payments help <cmd>` for
each of addresses/switch/hide/unhide. HELP_TEXT keys ~707-735.
2. Arg-validation pins (offline, 4 tests) — switch/hide/unhide with
no <index>, plus `switch abc` (non-numeric guard at ~line 2545).
All exit non-zero with "Usage: ..." or "Invalid index" before
getSphere().
3. Stateful local lifecycle (network-light, 7 tests) — fresh wallet
shows only #0 → switch 1 creates+activates #1 with a DIFFERENT
directAddress (HD-derivation isolation pin #1) → on-disk
tokens/ has exactly 2 distinct DIRECT_<...> subdirs (storage
isolation pin #2) → hide/unhide round-trip → switch back to #0
restores the original directAddress exactly (state-preservation
pin #3, no cross-pollination of identity material).
4. Token isolation invariant (opt-in, E2E_RUN_FAUCET=1, 3 tests) —
the gold-standard funded leak proof:
a. faucet 1 UCT at #0; beforeAll polls until UCT lands locally
b. payments tokens at #0 → UCT visible
c. switch to #1 → payments tokens shows "No tokens found"
(THE LEAK TEST — would flip red on cross-address visibility)
d. switch back to #0 → UCT still there, untouched
Gated because on-chain nametag mint (~20s) plus faucet (~5s)
plus the polling loop add ~60-90s on top of the default suite.
Verified with E2E_RUN_FAUCET=1: all 18 tests green in ~111s. The
funded leak proof confirms the isolation invariant holds in practice,
not just in the directory-layout pin.
Implementation note: faucet delivery is async — the faucet API
returns success when the gift-wrap is queued on the relay, not when
the wallet has finalized it into local storage. beforeAll polls
`payments tokens` (with sync) up to 3 times until UCT appears at #0,
then tests use --no-sync for fast per-address reads.
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
Post-merge steelman finding: nightly workflow's on-failure artifact upload harvests secp256k1 testnet wallet material into 7-day GitHub storage. The integration helpers already shred those dirs on exit for the same hygiene reason — uploading them defeats that.
Changes
Test plan