Commit graph

873 commits

Author SHA1 Message Date
johba
833ae45882 Merge pull request 'fix: fix: evolve.sh silences all batch-eval errors with 2>/dev/null (#749)' (#765) from fix/issue-749 into master 2026-03-14 18:06:24 +01:00
openhands
f355974cc8 fix: fix: evolve.sh silences all batch-eval errors with 2>/dev/null (#749)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 16:51:04 +00:00
openhands
1453139d31 fix: fix: evolve.sh silences all batch-eval errors with 2>/dev/null (#749) 2026-03-14 16:27:15 +00:00
openhands
89a9d3e575 fix: fix: evolve.sh silences all batch-eval errors with 2>/dev/null (#749)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 16:27:09 +00:00
johba
cf94d4c342 Merge pull request 'fix: fix: evolve.sh stale tmpdirs break subsequent runs (#750)' (#762) from fix/issue-750 into master 2026-03-14 17:19:42 +01:00
johba
24d05cbbba Merge pull request 'feat: add recovered LLM seeds (floor hugger + contrarian)' (#710) from chore/seed-consolidation into master 2026-03-14 16:55:24 +01:00
openhands
e54f0430ce fix: fix: evolve.sh stale tmpdirs break subsequent runs (#750) 2026-03-14 15:48:15 +00:00
openhands
b168a05930 fix: fix: evolve.sh stale tmpdirs break subsequent runs (#750)
Replace `mktemp -d` with a fixed working directory `evolved/.work/` that
is wiped at startup.  Stale `/tmp/tmp.*` directories from killed runs can
no longer interfere with batch-eval.sh path resolution.  Run outputs are
already preserved in `evolved/run_NNN/` before the work dir is cleaned.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 15:48:07 +00:00
openhands
564f0c5c69 fix: add fitness_flags to evo_run004, fix run007 note accuracy
- evo_run004_champion: added missing fitness_flags field
- evo_run007_champion: clarified both branches (staked<=88% vs >88%)
2026-03-14 15:43:58 +00:00
openhands
37ecf413d8 fix: resolve manifest.jsonl conflict markers 2026-03-14 15:43:58 +00:00
openhands
648e247ce3 feat: add run 7 champion to kindergarten
evo_run007_champion: fitness 7.117e21, anchorWidth=153 (unbounded),
discoveryDepth=0. Simplified to single percentageStaked>88% threshold.
Evolved under IL crystallization attack pressure.
2026-03-14 15:43:58 +00:00
openhands
34f142ae17 feat: add run7 evolution champion to seed pool 2026-03-14 15:43:58 +00:00
openhands
5f7d002e2a feat: add recovered LLM seeds (floor hugger + contrarian)
Recovered from reflog after rebase accident destroyed PRs #692, #699.
Balanced Adaptive (#688) was garbage collected — will be regenerated.
Kindergarten (#683) needs fresh implementation due to evolve.sh conflicts.

Closes #672, #675.
2026-03-14 15:43:58 +00:00
johba
969c910b04 Merge pull request 'fix: bootstrap + red-team on forked networks' (#684) from fix/fitness-factory-address into master 2026-03-14 16:39:59 +01:00
openhands
e9397891ed fix: remove setRecenterAccess from red-team.sh — recenter() is now public 2026-03-14 15:10:59 +00:00
openhands
2cdc1f7234 fix: restore bootstrap_vwap from master 2026-03-14 13:31:23 +00:00
openhands
8826c0b812 ci: retrigger (mirror available) 2026-03-14 13:31:23 +00:00
openhands
70a1fabec7 ci: retrigger 2026-03-14 13:31:23 +00:00
openhands
b0ff16f3ec ci: retrigger 2026-03-14 13:31:23 +00:00
openhands
ab800d07f6 fix: fund FEE_DEST before impersonation in grant_recenter_access
FEE_DEST is now a keccak-derived address with zero ETH balance.
anvil_impersonateAccount succeeds but cast send fails on gas deduction.
Add anvil_setBalance before impersonation, matching the same fix
already applied in red-team.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:31:23 +00:00
openhands
130e22d189 fix: sync FEE_DEST in bootstrap-common.sh with DeployLocal.sol feeDest
DeployLocal.sol changed feeDest to keccak256('harb.local.feeDest') =
0x8A9145E1Ea4C4d7FB08cF1011c8ac1F0e10F9383 but bootstrap-common.sh
still had the old address 0xf6a3eef9088A255c32b6aD2025f83E57291D9011.
Mismatch caused setRecenterAccess to revert (impersonating wrong address).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:31:23 +00:00
openhands
bf2d261cd9 ci: retrigger 2026-03-14 13:31:23 +00:00
openhands
af8bd07c7d feat: add red-team discovered IL crystallization attack (31.9 ETH optimal)
Single-cycle attack extracts 21.3 ETH (2.13%) from 1000 ETH LM:
  buy 31.9 ETH → recenter → sell all KRK

Key finding: thin pre-recenter positions allow massive price impact,
recenter rebuilds deep positions at manipulated price, sell through
deep positions recovers most ETH. IL crystallized during recenter.

This is the optimal single-buy amount — 31.95+ hits max tick,
<31 ETH extracts proportionally less.
2026-03-14 13:31:23 +00:00
openhands
dbf78de793 fix: bootstrap + red-team on forked networks
Bootstrap fixes:
- Idempotency check: skip if Kraiken already deployed on Anvil
- anvil_setCode to strip ERC-4337 code from deployer + feeDest
- DeployLocal.sol: feeDest derived from keccak256('harb.local.feeDest')

Red-team fixes:
- New bootstrap-light.sh: Anvil-only, ~30s deploy
- red-team.sh uses bootstrap-light instead of full docker compose
- anvil_setBalance for feeDest before impersonation
- forge --color never, path resolution, docker chown

Address fixes (all Base mainnet, in both FitnessEvaluator + AttackRunner):
- V3_FACTORY: 0x33128a8fC17869897dcE68Ed026d694621f6FDfD
- SWAP_ROUTER: 0x2626664c2603336E57B271c5C0b26F421741e481
- NPM_ADDR: 0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1
2026-03-14 13:31:23 +00:00
johba
8607c097eb Merge pull request 'ci: use local git mirror as clone reference' (#758) from fix/ci-local-mirror into master 2026-03-14 14:30:24 +01:00
johba
b7a76aa0e1 Merge pull request 'fix: feat: LLM seed — Defensive Floor Hugger optimizer (#672)' (#759) from fix/issue-672 into master 2026-03-14 14:17:36 +01:00
openhands
ecc64d20b7 fix: feat: LLM seed — Defensive Floor Hugger optimizer (#672) 2026-03-14 12:48:34 +00:00
openhands
fafe317fa5 fix: feat: LLM seed — Defensive Floor Hugger optimizer (#672)
Add llm_floor_hugger.push3: pure-constant Push3 optimizer that keeps
anchorShare=0.05e18, anchorWidth=5 ticks, discoveryDepth=0.05e18, CI=0.
Ignores all staking/tax inputs — floor position is always maximised.
Transpiles without error; manifest.jsonl updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 12:48:22 +00:00
openhands
22e328e12b ci: use local git mirror as clone reference
Eliminates Codeberg git clone rate limiting. The mirror at
/git-mirrors/harb.git (synced every 2 min) provides objects locally,
so the clone step only fetches deltas from Codeberg.

Volume mounted via WOODPECKER_BACKEND_DOCKER_VOLUMES.
2026-03-14 12:44:08 +00:00
johba
057737e293 Merge pull request 'fix: fix: EVAL_MODE defaults to anvil — should default to revm (#751)' (#754) from fix/issue-751 into master 2026-03-14 13:37:20 +01:00
openhands
cd86774ac8 fix: address review findings for #751 — STATE.md and script header docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 12:17:23 +00:00
openhands
21ff729509 fix: fix: EVAL_MODE defaults to anvil — should default to revm (#751) 2026-03-14 11:56:57 +00:00
openhands
83ab1683f5 fix: fix: EVAL_MODE defaults to anvil — should default to revm (#751)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 11:56:52 +00:00
johba
fd1a06ec9f Merge pull request 'fix: feat: evolve.sh auto-incrementing per-run results directory (#752)' (#753) from fix/issue-752 into master 2026-03-14 12:47:13 +01:00
openhands
266500fde1 fix: address review findings for #752 — regex and STATE.md cleanup
- Fix run_NNN scan regex: r'run(\d+)' → r'run_(\d+)' so it correctly
  matches the underscore-separated directory names the script creates
  (previously always resolved to 001, overwriting the same dir each run)
- Remove [in-progress] tag from STATE.md entry for #752

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 11:27:53 +00:00
openhands
280253b498 fix: feat: evolve.sh auto-incrementing per-run results directory (#752) 2026-03-14 11:08:10 +00:00
openhands
b5bf53b010 fix: feat: evolve.sh auto-incrementing per-run results directory (#752)
- --output now accepts a base dir (default: evolved/) instead of requiring
  an explicit path each run
- On each invocation, scan base dir for existing run_NNN/ subdirectories,
  find the highest N, and create run_(N+1)/ for this run's outputs
- All generation JSONL files, best.push3, diff.txt, and evolution.log are
  written to the new run dir — previous runs are never overwritten
- Log header now shows both Base dir and Output (run dir) for clarity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 11:08:04 +00:00
johba
6ff8282a7e Merge pull request 'fix: Remove recenterAccess — make recenter() public with TWAP enforcement (#706)' (#713) from fix/issue-706 into master 2026-03-14 10:48:59 +01:00
openhands
0d3aee15b4 fix: address AI review findings for #706 recenterAccess removal
- DeployBase.sol: remove broken inline second recenter() (would always
  revert with 'recenter cooldown' in same Forge broadcast); replace with
  operator instructions to run the new BootstrapVWAPPhase2.s.sol script
  at least 60 s after deployment
- BootstrapVWAPPhase2.s.sol: new script for the second VWAP bootstrap
  recenter on Base mainnet deployments
- StrategyExecutor.sol: update stale docstring that still described the
  removed recenterAccess bypass; reflect permissionless model with vm.warp
- TestBase.sol: remove vestigial recenterCaller parameter from all four
  setupEnvironment* functions (parameter was silently ignored after
  setRecenterAccess was removed); update all callers across six test files
- bootstrap-common.sh: fix misleading retry recenter in
  seed_application_state() — add evm_increaseTime 61 before evm_mine so
  the recenter cooldown actually clears and the retry can succeed

All 210 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 09:15:48 +00:00
johba
42e0d93df9 Merge pull request 'fix: ENVIRONMENT.md describes Anvil as Base Sepolia but backtesting scripts use Base mainnet addresses (#729)' (#742) from fix/issue-729 into master 2026-03-14 09:58:25 +01:00
openhands
52ed8ef233 fix: red-team.sh sudo strips FORK_URL before docker compose sees it (#729)
red-team.sh called bare `sudo docker compose up/down` which applies
env_reset and drops FORK_URL before anvil-entrypoint.sh can read it.
Change both calls to `sudo -E` so the caller's FORK_URL override is
propagated to docker-compose and into the anvil container.

Update ENVIRONMENT.md to reflect that a plain `FORK_URL=... bash
red-team.sh` invocation now works correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 08:30:49 +00:00
openhands
5b4e867c4b fix: address AI review feedback on ENVIRONMENT.md Network Contexts section
- Fix factual error: bootstrap deploys KRAIKEN protocol contracts and uses
  the existing V3 Factory; it does not re-deploy Uniswap V3 infrastructure
- Fix count/characterisation: intro now says "two network contexts" (dev
  Anvil + backtesting tools) and clarifies FitnessEvaluator uses revm
  in-process, not Anvil
- Fix sudo env-stripping hazard: replace bare `export FORK_URL` instruction
  with `FORK_URL=... sudo -E bash red-team.sh` so the variable is not
  silently dropped by sudo
- Nit: add --match-test testBatchEvaluate to the FitnessEvaluator example
  to match the test file's own documented usage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 08:10:40 +00:00
openhands
f55eaae230 fix: ENVIRONMENT.md describes Anvil as Base Sepolia but backtesting scripts use Base mainnet addresses (#729)
- Clarify that the dev Anvil defaults to Base Sepolia but can be overridden
  with FORK_URL (confirmed from containers/anvil-entrypoint.sh)
- Add "Network Contexts" section distinguishing three distinct Anvil usages:
  1. Dev stack Anvil (docker-compose): Base Sepolia by default
  2. red-team.sh: requires FORK_URL=mainnet because it uses Base mainnet
     periphery addresses (V3_FACTORY, SwapRouter02, NPM)
  3. FitnessEvaluator.t.sol: independent mainnet fork via BASE_RPC_URL,
     unrelated to the docker-compose stack

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 07:28:27 +00:00
johba
319632e7ae Merge pull request 'fix: V3_FACTORY address lacks a source comment (#730)' (#740) from fix/issue-730 into master 2026-03-14 08:24:28 +01:00
openhands
bc2ed50451 fix: V3_FACTORY address lacks a source comment (#730)
Add inline Basescan URL comment identifying V3_FACTORY as the Uniswap V3
Factory on Base mainnet, consistent with the existing comment style used
for NPM_ADDR in both files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 06:57:02 +00:00
johba
76e5d72c3d Merge pull request 'fix: calculateParams in OptimizerV3Push3 has no NatSpec after this PR (#735)' (#737) from fix/issue-735 into master 2026-03-14 07:48:45 +01:00
openhands
2c849ec456 fix: calculateParams in OptimizerV3Push3 has no NatSpec after this PR (#735)
Move the orphaned NatSpec block (originally for calculateParams) from
above getLiquidityParams to directly precede calculateParams, and give
getLiquidityParams only its own @inheritdoc block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 06:20:37 +00:00
johba
7aedcc549e Merge pull request 'fix: push3-evolution description missing crossover operator (#659)' (#736) from fix/issue-659 into master 2026-03-14 07:07:10 +01:00
openhands
0a59de9b12 fix: push3-evolution description missing crossover operator (#659) 2026-03-14 05:46:48 +00:00
johba
fd3c569c82 Merge pull request 'fix: OptimizerV3 / OptimizerV3Push3 not explicitly typed against IOptimizer (#661)' (#734) from fix/issue-661 into master 2026-03-14 06:40:43 +01:00