- Updated holdout.config.ts to use HOLDOUT_SCENARIOS_DIR env var
- Modified evaluate.sh to clone harb-holdout-scenarios repo at runtime
- Deleted scripts/harb-evaluator/scenarios/ directory
- Added .holdout-scenarios/ to .gitignore
- Holdout scenarios are now cloned into .holdout-scenarios/ during evaluation
- This prevents dev-agent from seeing the holdout test set
After `buyKrk()` completes (swap widget returns to idle), the Anvil RPC may briefly return stale balance state. Adds 2s delay to ensure `getKrkBalance` reads post-swap state.
Without this fix, the holdout scenario reports identical KRK balance before and after swap despite the transaction succeeding (success toast visible).
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/434
- 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
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>
- 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>
- 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>
- container_name(): derive separator from compose version (_COMPOSE_SEP),
so v1 (underscores) and v2 (hyphens) both resolve the right container name
- Drop buggy grep fallback for JSON branch extraction; python3 path is
sufficient and safe; grep cannot reliably target only head.ref in the
nested Gitea response
- Validate KRAIKEN/STAKE/LIQUIDITY_MANAGER after sourcing contracts.env to
catch renamed variables with a clear infra_error instead of a cryptic
'unbound variable' abort
- wait_exited: handle Docker 'dead' state alongside 'exited' to fail fast
instead of polling the full timeout
- Ponder /ready timeout is now infra_error (was a logged warning); scenarios
must not run against a partially-indexed chain
- Avoid double git fetch: only fetch the specific branch if the earlier
--prune fetch (fallback path) has not already retrieved all remote refs
- Use mktemp -u so git worktree add creates the directory itself, avoiding
failures on older git versions that reject a pre-existing target path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds scripts/harb-evaluator/evaluate.sh which:
- Accepts a PR number, resolves the branch via Codeberg API or git remote scan
- Checks out that branch into an isolated git worktree
- Boots a fresh docker compose stack with a unique COMPOSE_PROJECT name
- Waits for anvil healthy, bootstrap complete, ponder healthy + indexed
- Sources contract addresses from tmp/containers/contracts.env (never hardcoded)
- Exports EVAL_* env vars and runs any *.sh scripts under scenarios/
- Always tears down the stack and removes the worktree on exit (pass or fail)
- Returns 0 (gate passed), 1 (gate failed), or 2 (infra error)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- expand scripts/watch-kraiken-lib.sh to watch atomic rename events, validate required tools, and gracefully restart only the containers that mount kraiken-
lib/dist
- verify the host-built dist is mounted read-only inside each service and observe live rebuild + restart behavior under inotify
- run the local podman stack, exercise the watcher by editing kraiken-lib/src/helpers.ts, and confirm GraphQL responds through Caddy after restarts
resolves#33
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/38