- Modified sellAllKrk helper to return WETH delta received
- Added assertion: WETH received >= 90% of ETH spent (0.09 ETH minimum)
- Added log showing actual slippage percentage
- This proves 'always leave' with reasonable slippage, not just exit ability
Remove redundant onMounted call that fired loadLiquidityStats() a second
time. The watch() with { immediate: true } already handles the initial
load and all subsequent dependency changes, making onMounted redundant.
Also remove now-unused onMounted import.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The webapp-ci Docker image predates packages/utils. The e2e.yml webapp
service already overlays packages/web3 manually; add the same pattern
for packages/utils so Vite can resolve @harb/utils imports at runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
isRecord, coerceString, getErrorMessage, ensureAddress were removed
from useSwapKrk.ts but CheatsView.vue still imported them from there.
Update CheatsView to import from @harb/utils directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getByTestId('swap-buy-button').waitFor({ state: 'visible' }) resolved
immediately because the button is always rendered; only its text changes.
Replace with expect(...).toHaveText('Buy KRK', { timeout: 60_000 }) to
correctly gate on the button returning to its idle state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update 02-max-stake-all-tax-rates.spec.ts to buy KRK via /app/get-krk
instead of the removed cheats-page swap card
- Add VITE_ENABLE_LOCAL_SWAP=true to the webapp CI service so
LocalSwapWidget renders in the e2e pipeline
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract rpcCall into helpers/rpc.ts to eliminate the duplicate copy
in wallet.ts and assertions.ts (warning: code duplication)
- Fix waitForReceipt() in swap.ts to assert receipt.status === '0x1':
reverted transactions (status 0x0) now throw immediately with a clear
message instead of letting sellAllKrk silently succeed and fail later
at the balance assertion (bug)
- Add screen.width debug log to connectWallet() before the isVisible
check, restoring the regression signal from always-leave.spec.ts (warning)
- Fix expectPoolHasLiquidity() to only assert sqrtPriceX96 > 0 (pool
is initialised); drop the active-tick liquidity() check which gives
false negatives when price moves outside all LiquidityManager ranges
after a sovereign exit (warning)
- Add WETH balance snapshot before/after the swap in sellAllKrk() and
log a warning when WETH output is 0, making pool health degradation
visible despite amountOutMinimum: 0n (warning)
- Add before/after screenshots in buyKrk() (holdout-before-buy.png,
holdout-after-buy.png) to restore CI debugging artefacts (nit)
- Move waitForTimeout(2_000) settle buffer in buyKrk() to the catch
path only; when the Submitting→idle transition is observed the extra
wait is redundant (nit)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract reusable helpers from sovereign-exit/always-leave.spec.ts into
three focused modules under scripts/harb-evaluator/helpers/:
- helpers/wallet.ts: connectWallet, disconnectWallet, getEthBalance,
getKrkBalance — UI connect/disconnect flow and on-chain balance reads.
- helpers/swap.ts: buyKrk (navigates to the real /app/get-krk page and
drives the LocalSwapWidget, now that #393 fill() fix is in), sellAllKrk
(approve + exactInputSingle via window.ethereum, no UI dependency).
- helpers/assertions.ts: expectBalanceIncrease (snapshot/action/assert
pattern for any token or ETH), expectPoolHasLiquidity (slot0 + liquidity
sanity check on a Uniswap V3 pool).
always-leave.spec.ts is refactored to use these helpers and to navigate
to /app/get-krk instead of the /app/cheats workaround introduced before
the #393 fix landed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace screen.width with window.innerWidth in useMobile composable.
screen.width reports the physical screen size (0 in headless Chromium),
while window.innerWidth reflects the actual viewport — the correct metric
for responsive layout. The previous Object.defineProperty workaround in
wallet-provider.ts could not override the native Screen.prototype getter,
so screen.width remained 0, isMobile stayed true, and ConnectButton was
never rendered. Fix wallet-provider.ts to pass viewport/screen options
directly to browser.newContext() and remove the broken init-script shim.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace v-model with :value + @input on the number input in LocalSwapWidget.
Vue 3's vModelText directive coerces <input type="number"> values to numbers
via looseToNumber(), causing swapAmount to become a JS number (e.g. 0.05) after
Playwright fill(). viem's parseEther() requires a string and throws when passed
a number, triggering the "Enter a valid ETH amount" error.
The fix mirrors FInput's explicit @input handler which always reads
event.target.value as a string, keeping swapAmount typed as string throughout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch from account 5 to account 0 (matches e2e tests)
- Use cheats page (/app/cheats) instead of get-krk (/app/get-krk) -
get-krk swap widget has v-model reactivity issue with Playwright fill()
- Match e2e/01 wallet connection pattern with mobile fallback
- Add debug screenshots for swap widget diagnosis
- Use getByLabel/getByRole selectors matching e2e patterns
- evaluate.sh: add --ignore-scripts to npm install (prevents husky from
writing to permanent repo .git/hooks from the ephemeral worktree)
- evaluate.sh: change --silent to --quiet (errors still printed on failure)
- evaluate.sh: add `npx playwright install chromium` step so browser
binaries are present even when the cached revision doesn't match ^1.55.1
- evaluate.sh: set CI=true inline on the playwright invocation so
forbidOnly activates and accidental test.only() causes a gate failure
- holdout.config.ts: document that CI=true is supplied by evaluate.sh
- always-leave.spec.ts: add waitForReceipt() helper; replace fixed
waitForTimeout(2000) after eth_sendTransaction with proper receipt
polling so tx confirmation is not a timing assumption
- always-leave.spec.ts: log the caught error in the button-cycling
try/catch so contract reverts surface in the output
- always-leave.spec.ts: add console.log when connect button or connector
panel is not found to make silent-skip cases diagnosable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace shell-script scenario runner with Playwright. The evaluator now
runs `npx playwright test --config scripts/harb-evaluator/holdout.config.ts`
after booting the stack, using the existing tests/setup/ wallet-provider
and navigation infrastructure.
Changes:
- scripts/harb-evaluator/holdout.config.ts — new Playwright config pointing
to scenarios/, headless chromium, 5-min timeout per test
- scripts/harb-evaluator/scenarios/sovereign-exit/always-leave.spec.ts —
Playwright spec that buys KRK through the LocalSwapWidget then sells it
back via the injected wallet provider, asserting sovereign exit works
- scripts/harb-evaluator/evaluate.sh — adds root npm install step (needed
for npx playwright), exports STACK_* env aliases for getStackConfig(),
replaces shell-script loop with a single playwright test invocation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>