Skip to content

Commit cd63b80

Browse files
committed
test(perps): add HL abstraction-cycle agentic flows for TAT-3016 validation
- PerpsWithdrawView gets a testID on the available-balance text so agentic recipes can read the displayed value and assert the withdraw path shows availableBalance, not availableToTradeBalance. - HyperLiquidProvider.getExchangeClient() is a narrowly-scoped public escape hatch used by admin/test flows to drive userSetAbstraction and usdClassTransfer via the SDK. Not part of the PerpsProvider interface. - scripts/perps/agentic: new hl-balance-validation flow captures AccountState + perps-market-available-balance-text (PerpsMarketListView) + perps-withdraw-available-balance-text (PerpsWithdrawView) with deterministic wait_for gates. New hl-provision-fixture flow wraps userSetAbstraction / usdClassTransfer so recipes can cycle abstraction modes programmatically. New hl-fixture-state eval exposes the balance snapshot used by the flow assertions. - evidence/QA.md + evidence/recipe.json removed from tracking; these are per-PR local artifacts and belong under the agentic task dir, not the repo.
1 parent c677753 commit cd63b80

8 files changed

Lines changed: 337 additions & 428 deletions

File tree

app/components/UI/Perps/Perps.testIds.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ export const PerpsWithdrawViewSelectorsIDs = {
329329
RECEIVE_VALUE: 'perps-withdraw-receive-value',
330330
FEE_VALUE: 'perps-withdraw-fee-value',
331331
TIME_VALUE: 'perps-withdraw-time-value',
332+
AVAILABLE_BALANCE_TEXT: 'perps-withdraw-available-balance-text',
332333
};
333334

334335
// ========================================

app/components/UI/Perps/Views/PerpsWithdrawView/PerpsWithdrawView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,11 @@ const PerpsWithdrawView: React.FC = () => {
406406
]}
407407
/>
408408
</Box>
409-
<Text variant={TextVariant.BodyMD} color={TextColor.Alternative}>
409+
<Text
410+
variant={TextVariant.BodyMD}
411+
color={TextColor.Alternative}
412+
testID={PerpsWithdrawViewSelectorsIDs.AVAILABLE_BALANCE_TEXT}
413+
>
410414
{strings('perps.withdrawal.available_balance', {
411415
amount: formattedBalance,
412416
})}

app/controllers/perps/providers/HyperLiquidProvider.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,22 @@ export class HyperLiquidProvider implements PerpsProvider {
484484
return compiled;
485485
}
486486

487+
/**
488+
* Test/admin escape hatch: return the underlying HyperLiquid SDK exchange
489+
* client so agentic fixture flows can invoke arbitrary signed actions
490+
* (`userSetAbstraction`, `usdClassTransfer`, etc.) without growing a
491+
* controller method per admin operation. Not part of the `PerpsProvider`
492+
* interface — callers must cast and accept the SDK surface.
493+
*
494+
* @returns The initialized HyperLiquid SDK exchange client.
495+
*/
496+
public async getExchangeClient(): Promise<
497+
ReturnType<HyperLiquidClientService['getExchangeClient']>
498+
> {
499+
await this.#ensureClientsInitialized();
500+
return this.#clientService.getExchangeClient();
501+
}
502+
487503
/**
488504
* Initialize HyperLiquid SDK clients (lazy initialization)
489505
*

evidence/QA.md

Lines changed: 0 additions & 168 deletions
This file was deleted.

0 commit comments

Comments
 (0)