Commit graph

1257 commits

Author SHA1 Message Date
johba
1b4de1c081 Merge pull request 'fix: Attack file schema for burn_lp needs documentation and migration (#615)' (#1111) from fix/issue-615 into master 2026-03-22 12:45:03 +01:00
johba
27ff88c31b ci: retry pipeline 2026-03-22 11:16:37 +00:00
johba
c9ffef279f Merge pull request 'docs: RESOURCES.md — add dispatch mechanism and formula inventory' (#1112) from docs/resources-dispatch into master
Reviewed-on: https://codeberg.org/johba/harb/pulls/1112
2026-03-22 11:56:19 +01:00
johba
9267537a14 docs: RESOURCES.md — add dispatch mechanism, formula inventory, and constraints
Planner needs to know HOW to use resources, not just that they exist.
Adds action dispatch instructions, lists all available formulas, and
documents the port 8545 constraint for concurrent formula runs.

Supports disinto #544 (planner formula dispatch awareness).
2026-03-22 11:56:03 +01:00
johba
112182d2e2 Merge pull request 'chore: planner run — prerequisite tree update' (#1110) from chore/planner-20260322-1044 into master
Reviewed-on: https://codeberg.org/johba/harb/pulls/1110
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-22 11:55:46 +01:00
johba
ce9be22d2e fix: Attack file schema for burn_lp needs documentation and migration (#615)
Add SCHEMA.md documenting the JSONL attack file format with all operation
definitions, field types, and the burn_lp tokenId convention divergence
between AttackRunner (.positionIndex) and FitnessEvaluator (.tokenId).

Add schema-version header comments to all existing attack files and teach
both consumers to skip comment lines starting with //.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:53:07 +00:00
johba
02ca80fd5a chore: planner run 2026-03-22 2026-03-22 10:44:42 +00:00
johba
e22e6ac7bb Merge pull request 'fix: Attack files have hardcoded tokenIds that are fork-block-sensitive (#614)' (#1109) from fix/issue-614 into master 2026-03-22 11:34:45 +01:00
johba
0b6442a87c fix: Attack files have hardcoded tokenIds that are fork-block-sensitive (#614)
Make burn_lp ops fork-block-independent by using a 1-based positionIndex
(resolved at runtime from prior mint_lp ops) instead of hardcoded NFT
tokenIds. Mirrors the existing pattern used by unstake/_stakedPositionIds.

Also log a warning when burn_lp encounters zero liquidity instead of
silently becoming a no-op.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:11:58 +00:00
johba
a5d74ced81 Merge pull request 'fix: config.ts reads infrastructure.weth but no tooling generates it (#611)' (#1108) from fix/issue-611 into master 2026-03-22 11:04:14 +01:00
johba
e14dbf59dc ci: retry pipeline 2026-03-22 09:40:43 +00:00
johba
6a1bb71463 fix: config.ts reads infrastructure.weth but no tooling generates it (#611)
Add infrastructure.weth to deployments-local.json output in both
bootstrap-common.sh (write_deployments_json) and bootstrap-light.sh,
so non-Base local forks get the correct WETH address from the
deployment file instead of silently falling back to the Base hardcode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 09:29:28 +00:00
johba
b2bbdd28ed Merge pull request 'chore: seed prerequisite tree + RESOURCES.md' (#1106) from chore/seed-planner-tree into master
Reviewed-on: https://codeberg.org/johba/harb/pulls/1106
2026-03-22 09:10:15 +01:00
johba
c238bd1f57 chore: seed prerequisite tree + RESOURCES.md
Prerequisite tree seeded from VISION.md milestones with current issue state.
Top 3 constraints: contract safety (#1031/#997/#1067), OptimizerV3 tests (#1054),
evolution commits via PR (#1047).

RESOURCES.md lists evolution box, Codeberg accounts, CI, and RPC access.

Part of disinto #502 (planner v2).
2026-03-22 09:09:58 +01:00
johba
5c9cf81589 Merge pull request 'fix: shouldRecordVWAP else-branch fires incorrectly when lastRecenterTick==0 after bootstrap (#609)' (#1102) from fix/issue-609 into master 2026-03-22 09:06:03 +01:00
johba
cb4525c46c Merge pull request 'chore: gardener housekeeping 2026-03-22' (#1097) from chore/gardener-20260322-0607 into master
Reviewed-on: https://codeberg.org/johba/harb/pulls/1097
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-22 08:47:28 +01:00
johba
83a1b576e4 chore: gardener housekeeping 2026-03-22
- Update all AGENTS.md watermarks to HEAD (5f01d55)
- Add feeDestinationLocked and recenterAccess removal to onchain/AGENTS.md guardrails
- Add gardener/dust.jsonl accumulator (6 dust items: onchain comments, evidence schema docs)

Issues actioned via API:
- Closed #1085 as duplicate of #1082
- Promoted #1079, #1082, #1084 to backlog with acceptance criteria
- Unblocked #607, #609, #610, #611, #614, #615 (dev-crash blockers, no technical blockers)
- Added dependency-resolved comment to #1054 (dep #970 now closed)
2026-03-22 08:47:11 +01:00
johba
63dafd82ca fix: shouldRecordVWAP else-branch fires incorrectly when lastRecenterTick==0 after bootstrap (#609)
Add `_hasRecenterTick` boolean guard to decouple bootstrap detection from
VWAP volume tracking. Before this fix, the bootstrap condition relied solely
on `cumulativeVolume == 0`, which made `lastRecenterTick==0` ambiguous:
it could mean "never recentered" or "previous recenter landed at tick 0
(price = 1.0 token ratio)".

The new guard ensures the direction comparison in the else-branch only
runs after a recenter has explicitly set `lastRecenterTick`, eliminating
the tick-0 ambiguity. Belt-and-suspenders: both `!_hasRecenterTick` and
`cumulativeVolume == 0` trigger bootstrap.

Tests added:
- test_hasRecenterTickGuardPreventsTick0Ambiguity
- test_vwapFrozenDuringBuyOnlyAfterSellRecenter

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:28:08 +00:00
johba
f99e7b9e8b Merge pull request 'fix: No Foundry test for OptimizerV3 calculateParams correctness (#607)' (#1098) from fix/issue-607 into master 2026-03-22 08:06:02 +01:00
johba
87912b06da fix: No Foundry test for OptimizerV3 calculateParams correctness (#607)
Add table-driven Foundry tests for OptimizerV3.calculateParams covering:
- Bear regime at 0%, 1%, 50%, 91% staking (all tax rates)
- Bull/bear boundary at 92% with tax index transitions
- Bull/bear at 95% with penalty=50 exact boundary
- EffIdx shift behavior at 96% (taxIdx 13→14 discontinuity)
- Bull at 97% with max tax, 100% always bull
- Edge cases: all-zero inputs, zero tax at high staking
- Mantissa overflow guard
- Unused slots ignored
- Fuzz: no reverts, output always exactly bear or bull

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:31:06 +00:00
johba
a3de10bf1d Merge pull request 'fix: fitness_flags not propagated to manifest entries for newly admitted candidates (#990)' (#1096) from fix/issue-990 into master 2026-03-22 07:14:02 +01:00
johba
abac7f7ed7 fix: use None instead of '' for absent fitness_flags to match schema
Review feedback: d.get('fitness_flags') without a default preserves the
null vs absent distinction mandated by the manifest schema (string | null).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:02:20 +00:00
johba
e2963cbcba fix: fitness_flags not propagated to manifest entries for newly admitted candidates (#990)
Two changes in evolve.sh pool-admission code:

1. Include `fitness_flags` from evaluator JSONL in the manifest entry dict
   for newly admitted candidates (~line 866-874). Previously the field was
   omitted, so downstream `effective_fitness()` could never zero-rate a new
   candidate.

2. Use `effective_fitness(entry)` when appending new candidates to the
   evolved ranking list (~line 907), so ZERO_RATED_FLAGS defence applies
   at first admission — not only when re-ranking existing entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 05:47:34 +00:00
johba
5f01d55cc7 Merge pull request 'fix: line 202: git apply failure path (after --check passes) still uses bare continue, bypassing STOP_REQUESTED (#979)' (#1095) from fix/issue-979 into master 2026-03-22 06:34:15 +01:00
johba
cb565e8183 fix: line 202: git apply failure path (after --check passes) still uses bare continue, bypassing STOP_REQUESTED (#979)
When `git apply --check` passes but `git apply` itself fails, the code
now checks STOP_REQUESTED before continuing to the next iteration,
consistent with the check at the end of the main loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 05:17:07 +00:00
johba
d1174216df Merge pull request 'fix: Several other healthchecks are missing timeout fields (#937)' (#1094) from fix/issue-937 into master 2026-03-22 05:46:02 +01:00
johba
41d836299e fix: Several other healthchecks are missing timeout fields (#937)
Add explicit timeout: 3s to bootstrap, webapp, and landing healthchecks
to avoid Docker's 30s default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 04:06:55 +00:00
johba
8e09efee86 Merge pull request 'fix: AGENTS.md guardrails do not document the stakingPoolAddr != feeDestination exclusion (#934)' (#1093) from fix/issue-934 into master 2026-03-22 05:00:17 +01:00
johba
9086a4c5e4 fix: AGENTS.md guardrails do not document the stakingPoolAddr != feeDestination exclusion (#934)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 03:37:02 +00:00
johba
ebfa00a2b9 Merge pull request 'fix: webapp service has no depends_on ponder (#908)' (#1092) from fix/issue-908 into master 2026-03-22 04:24:03 +01:00
johba
17b169c01e fix: webapp service has no depends_on ponder (#908)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 02:56:57 +00:00
johba
e9d8f56709 Merge pull request 'fix: DeployBaseMainnet.sol:15 may need FEE_DEST update (#795)' (#1091) from fix/issue-795 into master 2026-03-22 03:46:02 +01:00
johba
e04e041a0f fix: correct EOA→contract in FEE_DEST comment (#795)
The production feeDest has contract bytecode on Base mainnet, not an EOA.
Fix the contradictory comment flagged in review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 02:15:29 +00:00
johba
fcd8f77693 fix: DeployBaseMainnet.sol:15 may need FEE_DEST update (#795)
Document the FEE_DEST derivation in DeployBaseMainnet.sol and explain
why FitnessEvaluator.t.sol intentionally uses a different address.

The production address (0xf6a3...D9011) is correct — it has contract
bytecode on Base mainnet, so setFeeDestination() locks it permanently.
The test uses a keccak-derived EOA (0x8A91...9383) to avoid the locking
behaviour breaking snapshot/revert cycles in fork tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:51:39 +00:00
johba
8d6dab197f Merge pull request 'fix: fix: evolution formula must commit results via PR before closing (#1047)' (#1088) from fix/issue-1047 into master 2026-03-22 02:26:02 +01:00
johba
ecb0e5b771 ci: retrigger pipeline for PR #1088 2026-03-22 01:04:11 +00:00
johba
aeedb2db22 ci: trigger pipeline after rebase 2026-03-22 00:22:04 +00:00
johba
45f9579de4 fix: fix: evolution formula must commit results via PR before closing (#1047) 2026-03-22 00:22:04 +00:00
johba
0edda8bb4b fix: evolution formula must commit results via PR before closing (#1047)
- Add `cleanup` step: removes per-generation candidate files and
  generation_*.jsonl records after they are aggregated into the evidence
  file, preventing disk exhaustion (cf. run #1025 at 91% usage).

- Rewrite `deliver` step with mandatory ordering:
  1. `git checkout -- .` to discard unrelated working-tree modifications
     before staging result files (evidence JSON, champion .push3, manifest).
  2. Commit to branch `evidence/evolution-run-{run_id}` (not directly to main).
  3. Push and create PR — if this fails, post an error comment and leave the
     issue OPEN; do not proceed to step 4.
  4. Post summary comment only after PR URL is confirmed, with mandatory
     link to the PR.

- Update `products.evidence_file` delivery to PR branch (was "commit to main").
- Update `products.issue_comment` to enforce ordering and non-close-on-failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 00:16:53 +00:00
johba
a6f26453a0 Merge pull request 'fix: feat: implement evidence/resources and evidence/protocol logging (#1059)' (#1078) from fix/issue-1059 into master 2026-03-21 22:26:13 +01:00
johba
3efdfef376 Merge pull request 'fix: No CI check that Push3 seeds transpile successfully before merge (#697)' (#1090) from fix/issue-697 into master 2026-03-21 22:25:49 +01:00
johba
b616953313 fix: add missing shell scripts and fix contract interface in run-protocol
- Add scripts/harb-evaluator/run-resources.sh: collects disk, RAM,
  Anthropic API usage, and Woodpecker CI queue metrics
- Add scripts/harb-evaluator/run-protocol.sh: collects TVL, fees,
  position data, and rebalance events from LiquidityManager
- Fix run-protocol.toml: positions accessed via positions(uint8) not
  named getters (floorPosition/anchorPosition/discoveryPosition)
- Fix event signature: Recentered(int24,bool) not Recenter(int24,int24,int24)

Addresses review findings: missing implementation files and contract
interface mismatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 21:00:14 +00:00
johba
1d9636dab3 ci: trigger pipeline after rebase 2026-03-21 20:55:56 +00:00
johba
3508ec5f42 fix: No CI check that Push3 seeds transpile successfully before merge (#697)
Add seed-transpile-check CI step that loops over every *.push3 file in
tools/push3-evolution/seeds/, transpiles it via the Push3 transpiler,
and verifies the generated Solidity compiles with forge build. Fails
the build if any seed fails transpilation or compilation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:47:52 +00:00
johba
de014e9b13 fix: feat: implement evidence/resources and evidence/protocol logging (#1059)
- Add evidence/resources/ and evidence/protocol/ directories with .gitkeep
- Add schemas for resources/ and protocol/ to evidence/README.md
- Create formulas/run-resources.toml (sense formula: disk/RAM/API/CI metrics,
  daily cron 06:00 UTC, verdict: ok/warn/critical)
- Create formulas/run-protocol.toml (sense formula: TVL/fees/positions/
  rebalance frequency via LmTotalEth.s.sol + cast, daily cron 07:00 UTC,
  verdict: healthy/degraded/offline)
- Update STATE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 19:39:23 +00:00
johba
7fd1963480 fix: remove project .claude/settings.json — use global config (#1089)
## Problem

The project-level `.claude/settings.json` overrides the global `skipDangerousModePermissionPrompt` flag, causing Claude Code to show an interactive bypass-permissions confirmation dialog in worktrees. This blocks ALL non-interactive agent sessions on evolution.

## Root cause

Claude Code resolves settings per-project. When a `.claude/settings.json` exists in the repo, it takes precedence over `~/.claude/settings.json`. The harb repo has one (with supervisor hooks) but without `skipDangerousModePermissionPrompt: true`. Result: every agent tmux session shows a confirmation prompt and dies.

## Fix

Delete `.claude/settings.json` and `.claude/hooks/supervisor/` entirely:
- The supervisor hooks are legacy from claude-code-supervisor
- agent-session.sh injects its own hooks per worktree at runtime
- Disinto has no project-level `.claude/` and works fine
- Global `~/.claude/settings.json` has the correct flags

## Impact

**This unblocks all harb agents on evolution.** Currently zero PRs can be processed.

Reviewed-on: https://codeberg.org/johba/harb/pulls/1089
2026-03-21 20:23:46 +01:00
johba
46e928ea97 fix: Red-team schema should add candidate_commit field (#1066) (#1075)
Fixes #1066

## Changes
Done. Here's what was changed:

**`evidence/README.md`**
- Added `"candidate_commit": "abc1234"` to the red-team schema JSON example
- Added `candidate_commit | string | Git commit SHA of the optimizer under test` row to the field table

**`scripts/harb-evaluator/red-team.sh`**
- Captures `CANDIDATE_COMMIT` from `git rev-parse HEAD` at startup (alongside existing `CANDIDATE_NAME`/`OPTIMIZER_PROFILE`)
- Added a new step (9a-pre) that writes `evidence/red-team/YYYY-MM-DD.json` at the end of each run, including `candidate_commit` plus all other schema fields (`candidate`, `optimizer_profile`, `lm_eth_before`, `lm_eth_after`, `eth_extracted`, `floor_held`, `verdict`, `attacks`)

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/1075
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-21 13:47:13 +01:00
johba
636ba989ee fix: Optimizer and OptimizerV3 lack _disableInitializers() in constructor (#1055) (#1080)
Fixes #1055

## Changes
That notification is for the earlier background task which already completed — I retrieved its output and used it to diagnose and fix the failing test. The work is done.

Reviewed-on: https://codeberg.org/johba/harb/pulls/1080
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-21 13:42:54 +01:00
johba
5e8d603ebd Merge pull request 'evidence: first red-team baseline — floor held' (#1065) from evidence/red-team-2026-03-20 into master 2026-03-21 07:48:26 +01:00
johba
fd80aec3be evidence: fix nits — strategies count, percentage calculation
- strategies_tested=7 (independent measurements only), strategies_total=9
- Fix attack 4 percentage: 374/2050 ≈ 18%, not 37%

Re: #1058

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 06:45:40 +00:00