Skip to content

feat: show the SPA's recovery commands for the operations client [RAI-3096] - #1688

Closed
JuaniRios wants to merge 1 commit into
rai-2998-board-nativefrom
rai-2998-recovery-client
Closed

JuaniRios wants to merge 1 commit into
rai-2998-board-nativefrom
rai-2998-recovery-client

Conversation

@JuaniRios

@JuaniRios JuaniRios commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Part of RAI-3096.

The SPA's recovery commands move from stox over SSH to the operations client, st0x-liquidity-client --env <production|staging>. Item 6a of the RAI-2998 stack, part 2 of 6. Ported from #1654 and #1662, without their DTO changes.

Live effect: the commands the SPA shows in the CLI recovery guide and the transfer and trade dialogs · Risk: low (text an operator copies; no money path in code) · Ships: on the next bot release

Why

The board copies these commands (#1689, #1692), and transfer-board.test.ts keeps the copies equal to the SPA. #1654 put the client form in both. The plan said to drop the SPA side, but then the test cannot guard the board against transfer.ts, and the board would show commands the SPA does not. So the SPA side comes along, as its own PR.

Decisions

  • Production commands use the operations client. It signs in with Google and calls the bot's API, so no SSH and no stopped bot. Simulation builds keep the mock CLI, since the harness has no IAP front for the client.
  • --env comes from the SPA's host: production on the production host, staging on the staging host, and a <production|staging> placeholder anywhere else (an IAP tunnel to localhost), so a guess never targets production.
  • fail-usdc-transfer shows only where the running bot can accept it, with the check for that bridge's direction (fix: per-direction USDC fail checks on the liquidity board #1662). Alpaca to Base gets it at withdrawing and bridging; Base to Alpaca at withdrawing only, plus a pointer to the offline stox path once the vault withdrawal confirmed.
  • The Base to Alpaca check follows the docs/cli-ops.md runbook from docs: check WithdrawV2 too before failing a Base to Alpaca USDC transfer [RAI-3125] #1704 step for step: no OperatorWithdraw on the inventory and no WithdrawV2 on the orderbook from the cash vault, then the attempt timeout and no pending tx (nonce checked on more than one RPC provider), then resume if anything landed or you are not sure. If nothing landed, stop the bot and close the nonce with a 0-value self-transfer, check the logs again, and only then fail.
  • The modes direct-db-live-rpc and live-rpc-only go away: every production command is requires-bot now.

Proof

  • svelte-check, eslint, and all 389 dashboard tests pass on this branch, 397 on the stack top.
  • Reviewers checked every command string against crates/liquidity-client/src/cli.rs and the fail rules against fail_pre_burn_usdc_transfer in src/api.rs. All match.
  • Not verified: a client command run against a live bot from these strings.

Open question

This one changes the SPA, which the 6a brief said to leave alone. If we'd rather keep the SPA on stox until Stage 6, drop this PR and #1692's drift test switches to literal expected tables (J6). wdyt?

Merge conditions

Same as the stack below. This one ships with the bot release, like the rest of the stack. #1689 and #1692 need it below them, so their drift test can pass.

@linear-code

linear-code Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

RAI-2998

RAI-3062

RAI-3096

JuaniRios commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label add-to-gt-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@JuaniRios

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: a19da75a-41f4-480e-898a-50a63b4a7120

📥 Commits

Reviewing files that changed from the base of the PR and between 5790b7b and 9bea021.


📒 Files selected for processing (2)
  • dashboard/src/lib/transfer.test.ts
  • dashboard/src/lib/transfer.ts

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.



Walkthrough

Recovery commands now select operations-client or mock-CLI syntax based on deployment settings. Production and staging environments receive distinct client targeting, while unknown environments use a placeholder. Equity, trade, and USDC bridge recovery commands and guide entries are updated. USDC bridge fail commands depend on direction and status. Resume commands cover in-flight stages.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 9bea0

An operator following the post-burn recovery guidance could settle funds manually while automated recovery continues. Clarify the parking requirement before merging.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: showing SPA recovery commands for the operations client.
Description check Passed The description is directly related to the changeset and explains the client migration, environment selection, recovery-mode changes, and validation status.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

📝 Generate docstrings
  • Commit to this branch
  • Create a new PR



  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@JuaniRios
JuaniRios marked this pull request as ready for review October 8, 2026 23:56
@JuaniRios

Copy link
Copy Markdown
Collaborator Author

@rain-marvin review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@rain-marvin

rain-marvin Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

🔎 Reviewing 9bea021, started by @JuaniRios. The review will appear here when it's done.

@rain-marvin rain-marvin Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR moves the dashboard's recovery commands (the CLI recovery guide and the transfer and trade dialogs) from the offline stox CLI over SSH to the operations client, st0x-liquidity-client --env <production|staging>. It picks --env from the dashboard host, shows fail-usdc-transfer only in the states where the running bot can accept it, and adds a check procedure for each bridge direction. Simulation builds keep the mock CLI.

Every command string matches crates/liquidity-client/src/cli.rs: verbs, argument order, flags and value spellings. The fail gating matches fail_pre_burn_usdc_transfer in src/api.rs. All earlier threads are resolved, and the fixes from the last round are in place at this head. Nothing here blocks the merge. What is left is a few text gaps in the operator procedures: the Alpaca to Base fail check still trusts a nonce comparison that the Base to Alpaca check already says is not proof, the complete-mint row no longer says that the bridge needs a follow-up step, and there is no test that the shown commands still parse with the client.

claude-opus-5-5 · high · 20 min

Comment thread dashboard/src/lib/transfer.ts
Comment thread dashboard/src/lib/transfer.ts
Comment thread dashboard/src/lib/transfer.ts
Comment thread dashboard/src/lib/transfer.ts
@JuaniRios

Copy link
Copy Markdown
Collaborator Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved and changes approved.

This was referenced Oct 10, 2026
@rain-marvin

rain-marvin Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

@JuaniRios 🔔 Follow-up: a day after my review

@JuaniRios, #1688 is still open and hasn't moved since CodeRabbit approved it a day ago. Marvin and CodeRabbit have both approved head 9bea021, CI is green, there are no unresolved threads and it has no conflicts. The only failing check is human/reviewed.

It's waiting on a human approval from one of @agryaznov, @ueco-jb, @rouzwelt or @findolor. It also sits on top of #1687, which is approved but not merged yet, so the next step is to get someone to review it and then land #1687 first. The open question in the description (whether the SPA should stay on stox until Stage 6) is also still unanswered and is worth settling in that review.

claude-opus-5-5 · high · 6 h 44 min

@agryaznov agryaznov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the deferred minors are tracked in the threads.

@graphite-app

graphite-app Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merge activity

  • Oct 12, 4:04 PM UTC: JuaniRios added this pull request to the Graphite merge queue.
  • Oct 12, 4:04 PM UTC: CI is running for this pull request on a draft pull request (#1727) due to your merge queue CI optimization settings.
  • Oct 12, 4:20 PM UTC: Merged by the Graphite merge queue via draft PR: #1727.

@graphite-app graphite-app Bot closed this Oct 12, 2026
@graphite-app
graphite-app Bot deleted the rai-2998-recovery-client branch October 12, 2026 16:21
@github-actions github-actions Bot added the externally-merged Added to a PR that appears closed but is actually merged by an external actor like Graphite label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

externally-merged Added to a PR that appears closed but is actually merged by an external actor like Graphite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants