Commit graph

638 commits

Author SHA1 Message Date
johba
5bea99ddf4 Merge pull request 'fix: Dozens of bare waitForTimeout() calls remain throughout e2e tests (#418)' (#496) from fix/issue-418 into master 2026-03-06 10:15:18 +01:00
openhands
3507538fce fix: Dozens of bare waitForTimeout() calls remain throughout e2e tests (#418)
Replace all 10 bare waitForTimeout() calls in tests/e2e/usertest/helpers.ts
with proper event-driven Playwright waits per AGENTS.md Engineering Principle #3
("replace when touched"):

connectWallet():
- Remove 500ms resize-event sleep: connectButton.isVisible({ timeout: 5_000 })
  already waits for the layout to settle after the resize event
- Remove 2000ms "connector init" sleep: the subsequent isVisible check was
  already event-driven
- Replace 2x 1000ms panel-animation sleeps with
  injectedConnector.waitFor({ state: 'visible' }) — the .connectors-element
  appearing is the exact observable DOM event
- Remove 2x 2000ms "handshake" sleeps: walletDisplay.waitFor() at the end of
  the function is the correct gate for connection completion

attemptStake():
- Remove 3000ms post-goto sleep: tokenAmountSlider.waitFor() at the next line
  is the correct page-load gate
- Remove 2x 500ms debounce sleeps after fill/select: stakeButton.waitFor()
  downstream is the correct reactive-state gate
- Remove 3000ms post-transaction sleep: the button returning to "Stake" text
  (waitFor at line 619) is already the correct transaction-completion gate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 08:47:22 +00:00
openhands
92fa38e328 fix: Dozens of bare waitForTimeout() calls remain throughout e2e tests (#418)
Add eslint-disable-next-line no-restricted-syntax comments with
justification to the 10 bare waitForTimeout() calls in
tests/e2e/usertest/helpers.ts.

All waitForTimeout calls in the spec files (01–06 and all usertest
specs) were already properly documented after PR #417. helpers.ts was
the only remaining file with bare calls:
- 6 in connectWallet(): wallet connector panel animation and
  connection handshake have no observable DOM event to await
- 4 in attemptStake(): Ponder indexing lag, debounced form handlers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 08:15:48 +00:00
johba
524a6a66d9 Merge pull request 'fix: webapp-entrypoint.sh CI path bypasses contracts.env sourcing without documentation (#422)' (#491) from fix/issue-422 into master 2026-03-06 09:03:38 +01:00
openhands
34dbd48654 ci: retrigger after infra failure 2026-03-06 07:34:50 +00:00
openhands
6c54a92657 fix: webapp-entrypoint.sh CI path bypasses contracts.env sourcing without documentation (#422)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 07:24:54 +00:00
openhands
d301f75523 fix: webapp-entrypoint.sh CI path bypasses contracts.env sourcing without documentation (#422)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 07:01:07 +00:00
johba
8c893d68e1 Merge pull request 'fix: total computed has no undefined guard — shows initial stake amount during loading (#424)' (#488) from fix/issue-424 into master 2026-03-06 07:54:19 +01:00
openhands
0063e94007 fix: \total\ computed has no undefined guard — shows initial stake amount during loading (#424)
When profit or taxPaidGes were undefined (data still loading), the
computed returned props.amount due to the ?? 0 fallbacks. The computed
now returns undefined until both values are loaded, and the template
guard is simplified to total !== undefined.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 06:31:49 +00:00
johba
37d7339fbf Merge pull request 'fix: commaNumber silently returns '0' for NaN and falsy values (#427)' (#485) from fix/issue-427 into master 2026-03-06 07:20:27 +01:00
openhands
04fbca939f fix: \commaNumber\ silently returns '0' for NaN and falsy values (#427)
Replace truthiness guard with Number.isFinite() so NaN and Infinity are
explicitly rejected rather than silently masked. Zero is now handled by
toLocaleString, which returns '0' correctly. Add test cases for NaN and
Infinity.
2026-03-06 05:51:50 +00:00
johba
67c0ed953a Merge pull request 'fix: getErrorMessage silently ignores viem's shortMessage (#430)' (#484) from fix/issue-430 into master 2026-03-06 06:41:25 +01:00
openhands
fc008fb9c1 fix: correct TypeScript cast for shortMessage in getErrorMessage (#430)
The direct cast of Error to Record<string, unknown> is rejected by
TypeScript because the types don't sufficiently overlap. Cast via
unknown first to satisfy the compiler.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 05:13:27 +00:00
openhands
a8a5d1ab93 fix: getErrorMessage silently ignores viem's shortMessage (#430)
viem's BaseError extends Error, so the instanceof Error branch was
firing and returning error.message before the isRecord branch could
check shortMessage. Check shortMessage first inside instanceof Error
so terse viem messages are shown to users instead of verbose full ones.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 05:02:10 +00:00
johba
d9329d70b3 Merge pull request 'fix: CollapseActive.vue: fixed 5-second delay in unstakePosition() should be replaced with polling (#448)' (#480) from fix/issue-448 into master 2026-03-06 05:52:04 +01:00
openhands
4aee33ad74 ci: retrigger after infra failure 2026-03-06 04:29:45 +00:00
openhands
372f49f6a5 fix: wrap unstakePosition polling loop in try/finally to prevent loading lock (#448)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 04:18:52 +00:00
openhands
e85ff85950 fix: CollapseActive.vue: fixed 5-second delay in unstakePosition() should be replaced with polling (#448)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 03:44:04 +00:00
johba
becfb98198 Merge pull request 'fix: Add cache headers to Ponder GraphQL proxy in Caddy (#447)' (#477) from fix/issue-447 into master 2026-03-06 04:32:02 +01:00
openhands
8b39bf3000 fix: Add cache headers to Ponder GraphQL proxy in Caddy (#447) 2026-03-06 03:07:24 +00:00
openhands
1abe51b348 fix: Add cache headers to Ponder GraphQL proxy in Caddy (#447) 2026-03-06 02:30:56 +00:00
johba
b711860152 Merge pull request 'fix: sellAllKrk uses amountOutMinimum: 0n with no throw on 0 output (#450)' (#474) from fix/issue-450 into master 2026-03-06 03:25:33 +01:00
openhands
d0e651ffc9 fix: sellAllKrk uses amountOutMinimum: 0n with no throw on 0 output (#450)
Replace console.warn with a thrown Error when wethReceived <= 0n so any
caller without a return-value check is protected, not just always-leave.spec.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 01:51:23 +00:00
johba
61f9e07e60 Merge pull request 'fix: E2E test files use file-level eslint-disable for no-restricted-syntax, suppressing all future rules in that group (#451)' (#473) from fix/issue-451 into master 2026-03-06 02:44:16 +01:00
openhands
6b7ac781fb fix: E2E test files use file-level eslint-disable for no-restricted-syntax, suppressing all future rules in that group (#451)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 01:12:26 +00:00
johba
1ceb6647f7 Merge pull request 'fix: KRK fees to feeDestination undocumented (#458)' (#471) from fix/issue-458 into master 2026-03-06 02:01:28 +01:00
openhands
e09a995733 fix: KRK fees to feeDestination undocumented (#458) 2026-03-06 00:32:18 +00:00
openhands
496a464baf fix: KRK fees to feeDestination undocumented (#458) 2026-03-06 00:01:28 +00:00
johba
7dc0c52664 Merge pull request 'fix: e2e test uses getByRole('combobox', { name: 'Tax' }) against a label 'Position Cost (Tax Rate)' (#467)' (#469) from fix/issue-467 into master 2026-03-06 00:10:42 +01:00
openhands
660204ac14 fix: e2e test uses getByRole('combobox', { name: 'Tax' }) against a label 'Position Cost (Tax Rate)' (#467) 2026-03-05 22:41:00 +00:00
johba
89134800c2 Merge pull request 'fix: evaluator: add stakeKrk and unstakeKrk browser helpers (#460)' (#466) from fix/issue-460 into master 2026-03-05 16:34:25 +01:00
openhands
4e6182acc6 fix: evaluator: add stakeKrk and unstakeKrk browser helpers (#460)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 15:09:54 +00:00
openhands
ad9a113a9c fix: evaluator: add stakeKrk and unstakeKrk browser helpers (#460) 2026-03-05 14:38:13 +00:00
openhands
b7bbbb9b89 fix: evaluator: add stakeKrk and unstakeKrk browser helpers (#460)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 14:37:56 +00:00
johba
0b5752ca52 Merge pull request 'fix: evaluator: add sellKrk browser helper (uses sell widget from #456) (#461)' (#465) from fix/issue-461 into master 2026-03-05 15:25:47 +01:00
openhands
c891b3c617 fix: address review findings in sellKrk helper
- Fix max-button race: wait for input to be non-empty after clicking Max
  (setMax is async, composable calls loadKrkBalance() before setting value)
- Add on-chain confirmation via WETH Transfer event polling (mirrors buyKrk)
  so balance query happens after the swap is mined, not just UI-idle
- Use Pick<SellConfig, 'rpcUrl' | 'accountAddress'> since krkAddress is unused
- Add page heading assertion after navigate (consistent with buyKrk)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 13:58:14 +00:00
openhands
912c7e4eee ci: retrigger after infra failure 2026-03-05 13:24:44 +00:00
openhands
61a9fd7e58 fix: evaluator: add sellKrk browser helper (uses sell widget from #456) (#461)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 13:13:04 +00:00
johba
3a3a7844ed Merge pull request 'fix: feat: Add sell KRK widget to get-krk page (#456)' (#464) from fix/issue-456 into master 2026-03-05 14:01:44 +01:00
openhands
5b69d9ee3d fix: address review findings in sell KRK widget
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:39:15 +00:00
openhands
36c798605f fix: feat: Add sell KRK widget to get-krk page (#456)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:03:36 +00:00
johba
466e0d7767 Merge pull request 'fix: evaluator: add market simulation and recenter helpers (#455)' (#457) from fix/issue-455 into master 2026-03-05 12:51:29 +01:00
openhands
9cda5beb4a fix: address review findings in market and recenter helpers
- recenter.ts: parse isUp from Recentered event logs instead of a
  follow-up eth_call that would decode wrong post-recenter state
- recenter.ts: remove hardcoded private key from comment; add blocks>0
  guard in mineBlocks; call provider.destroy() to prevent leaked intervals
- market.ts: snapshot KRK balance before buy to compute krkBought as
  delta instead of cumulative total; call provider.destroy() on exit;
  remove unused withdraw entry from WETH_ABI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 11:27:31 +00:00
johba
32b9d86f18 Merge pull request 'docs: clarify fees go to protocol treasury, not holders' (#453) from docs/fee-destination-clarity into master
Reviewed-on: https://codeberg.org/johba/harb/pulls/453
2026-03-05 12:03:01 +01:00
openhands
5c7b488753 docs: clarify fees go to protocol treasury, not holders
- Add Fee Destination section to PRODUCT-TRUTH.md
- Explicitly ban 'fees grow your KRK value' and 'auto-compounding' claims
- Clarify holder value comes from asymmetric slippage, not fee reinvestment
- Fix misleading 'floor always goes up if fee income exceeds sell pressure'
- Update ARCHITECTURE.md feeDestination annotation
2026-03-05 12:02:45 +01:00
openhands
1973ccf25b fix: evaluator: add market simulation and recenter helpers (#455)
- Export waitForReceipt from swap.ts so market.ts and recenter.ts can reuse it
- Add market.ts with roundTripSwap: direct-RPC buy+sell round-trip using ethers Wallet
- Add recenter.ts with triggerRecenter (calls LiquidityManager.recenter()) and mineBlocks (anvil_mine)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 10:52:28 +00:00
johba
4066ea6db4 Merge pull request 'feat(holdout): add passive-confidence/no-dilution scenario' (#437) from feat/holdout-no-dilution into master 2026-03-05 11:31:56 +01:00
openhands
9b321b6774 ci: retrigger 2026-03-05 08:41:22 +00:00
openhands
cd459bb9b0 fix: correct buyKrk call sites for new opts param, add eslint-disable for polling loop
- no-dilution.spec.ts: pass undefined for opts, screenshotPrefix as 4th arg
- swap.ts: add eslint-disable-next-line for eth_getFilterLogs polling delay
2026-03-05 05:53:19 +00:00
openhands
e6bd236bcc ci: retrigger 2026-03-05 05:51:08 +00:00