Skip to content

fix(fund): Arc raw-key cleanup — key-blind product surfaces - #190

Merged
SELAT-DEV merged 2 commits into
mainfrom
cursor/arc-fund-raw-key-cleanup-8a2f
Sep 17, 2026
Merged

SELAT-DEV merged 2 commits into
mainfrom
cursor/arc-fund-raw-key-cleanup-8a2f

Conversation

@SELAT-DEV

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

Copy link
Copy Markdown
Contributor

Fixes #189.

Arc fund raw-key cleanup (CTO+Security see-boundary). Companion is SELAT-AI/selat-discovery#169 (separate PR). Do not merge — TPM/CEO merge gate.

What changed

Investigation confirmed the hypothesis: resolveArcDepositEnv returned { env: { SELAT_PRIVATE_KEY, ARC_RPC_URL } } as a serializable object, and fatal/SELAT_DEBUG paths printed raw err.message / err.stack.

  • Signer ship contract: lib/arc-fund-signer.mjs returns { signature, address } or { signature, fingerprint } only. No key / privateKey / mnemonic field on the wire type.
  • Resolve result is key-blind: fingerprint is the identity; the raw key lives in an in-process WeakMap and is applied to the child overlay only via arcDepositSpawnEnv (secret-load path for setup.mjs). The key is not placed on argv and is not sent to the router.
  • Redact before serialize: lib/redact.mjs covers env dumps, argv dumps, error + upstream 4xx/5xx bodies, copy-debug bundles, and quote/claim objects (withoutKeyFields so the client cannot invent a key field).
  • Arc CLI streams: Arc deposits capture child stdout/stderr and reprint after redaction. Other chains still inherit (Circle signing prompts).
  • Fatal debug: bin/selat.mjs serializes errors through the redactor before printing.

Out of scope (per #189): fund/SIWx redesign, refund redesign, catalog-count copy.

QA matrix (P0 = any raw key/mnemonic)

  • Happy sign: signature + address/fingerprint only; no key field on wire
  • Verbose/debug CLI: stdout/stderr key-free (Arc child streams redacted)
  • Thrown/serialized errors + upstream 4xx/5xx: redacted before serialize
  • Quote/receipt/refund/SIWx/MCP/router settlement: client does not invent a key field; refund argv has no --raw-key; Arc key does not enter the router
  • argv / env dump / copy-debug bundle: no raw key
  • Client must not invent a key field on quote/claim

Tests

test/arc-fund-keyblind.test.mjs pins signer return shape, error serialize, env/argv/copy-debug dumps, quote/claim withoutKeyFields, and Arc fund stdout/stderr reprint.

Local: 597/597 (npm test).

Merge

TPM + CEO only. Do not merge from this agent.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 17, 2026 09:55
resolveArcDepositEnv no longer returns SELAT_PRIVATE_KEY on its wire type.
The key stays in-process (WeakMap + child overlay) for the sign call only;
identity is a masked fingerprint. Signer results are signature + address
or fingerprint. Errors, env/argv dumps, copy-debug bundles, and Arc child
stdout/stderr redact before serialize. Fatal SELAT_DEBUG stacks use the
same redaction. Closes nothing — TPM/CEO merge gate for #189.

Co-authored-by: SELAT-DEV <SELAT-DEV@users.noreply.github.com>
assert.doesNotMatch requires a RegExp — switch secret checks to
substring asserts. Inject stdout/stderr into fund() so Arc reprint
tests do not patch process.stdout.write (that swallowed TAP and
hid the other cases). npm test: 597/597.

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:00
@SELAT-DEV
SELAT-DEV merged commit 5197b11 into main Sep 17, 2026
1 check passed
SELAT-DEV added a commit that referenced this pull request Sep 17, 2026
…190)" (#194)

This reverts commit 5197b11.

Co-authored-by: Karen Sheng <ksherlocked@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

Arc fund raw-key cleanup: key-blind product surfaces (see-boundary)

2 participants