# AGENT_STATE

## Last Supervisor Run

```text
run_id: scheduled_20260506T144855Z
utc_run_time: 2026-05-06T14:48:55Z
working_dir: /var/www/vps2.happyuser.info/dex
git_available: true
tmux_snapshot_source: .agent/snapshots/snapshot_20260506T144855Z.txt
```

## Current Stage

```text
stage: S1_BACKTEST_PROOF
action_category_this_run: TOOLING_FIX
```

Reason: the Python 3.6 compatibility issue now affects the tranche replay
script and its shared fast NPZ dependency. Both fixes have been applied and
verified locally; the correct next move is to rerun the Oleg validation so this
workspace can produce actual cross-window strategy evidence.

## Gate Status

Previous S0 blocker:

```text
Fresh exact-event NPZ inputs must exist and update reliably enough for
portfolio_router_v4 / paper_live_virtual_lp_v1 and Oleg/v8 validation.
```

Gate status:

```text
passed_for_current_WETH_inputs
```

Current blocking gate:

```text
S1_BACKTEST_PROOF: Oleg/v8 validation must run on the exact WETH/USDC 0.30%
monthly NPZs and produce cross-window strategy evidence. The Python 3.6
compatibility issue in cl_fee_replay_tranche_dca_v1.py and
cl_fee_replay_fast_npz_v3.py has been fixed and the validation rerun completed,
but the month winners are not yet a single same-config tranche family.
```

Gate status:

```text
cross_window_results_available_review_pending
```

## Active tmux Sessions

Snapshot source:

```text
.agent/snapshots/snapshot_20260506T144855Z.txt
```

Sessions from snapshot:

```text
dex_control_room
```

## Evidence Generated

WETH/USDC 0.30% exact monthly NPZs present in this workspace:

```text
DEX_DATA/fast_npz/mainnet_WETH_USDC_UNIV3_030_feb2026_fee_replay_v2.npz
DEX_DATA/fast_npz/mainnet_WETH_USDC_UNIV3_030_mar2026_fee_replay_v2.npz
DEX_DATA/fast_npz/mainnet_WETH_USDC_UNIV3_030_apr2026_fee_replay_v2.npz
```

WETH raw event data present in this workspace:

```text
DEX_DATA/uniswap_v3_mainnet/mainnet_WETH_USDC_UNIV3_030_feb2026/
DEX_DATA/uniswap_v3_mainnet/mainnet_WETH_USDC_UNIV3_030_mar2026/
DEX_DATA/uniswap_v3_mainnet/mainnet_WETH_USDC_UNIV3_030_apr2026/
```

Validation success evidence:

```text
session: oleg_weth_exact_tranche_validation_20260506T150103Z
run_id: 20260506T150240Z
log: .agent/tmux_logs/oleg_weth_exact_tranche_validation_20260506T150103Z_20260506T150240Z.log
exit_code: 0
feb2026_best_capacity: oleg_tranche_3p_0.333333f_20_10_double_once_1x_6h_rolling_low_6h_2off
feb2026_return_pct: 3.3511092871500336
feb2026_mdd_pct: -6.1450780365448265
mar2026_best_capacity: oleg_tranche_2p_0.5f_20_25_equal_1x_6h_current_price_6h_0off
mar2026_return_pct: 3.754394860746535
mar2026_mdd_pct: -2.39095380638632
apr2026_best_capacity: oleg_tranche_2p_0.5f_20_30_equal_1x_6h_current_price_6h_0off
apr2026_return_pct: 2.764106683994849
apr2026_mdd_pct: -1.7908151842167208
common_top20_overlap: none
```

Tooling fix applied:

```text
removed: from __future__ import annotations
file: dex_platform/backtest/cl_fee_replay_tranche_dca_v1.py
verification: python3 -m py_compile dex_platform/backtest/cl_fee_replay_tranche_dca_v1.py
status: pass

removed: from __future__ import annotations
file: dex_platform/backtest/cl_fee_replay_fast_npz_v3.py
verification: python3 -m py_compile dex_platform/backtest/cl_fee_replay_fast_npz_v3.py
status: pass

replaced: Python 3.10 union annotations with Python 3.6-compatible typing
file: dex_platform/backtest/cl_fee_replay_fast_npz_v3.py
verification: python3 -m py_compile dex_platform/backtest/cl_fee_replay_fast_npz_v3.py
status: pass

added: top-level pandas import for module-level DataFrame annotations and plotting helpers
file: dex_platform/backtest/cl_fee_replay_fast_npz_v3.py
verification: python3 - <<'PY' ... import cl_fee_replay_fast_npz_v3
status: pass

replaced: datetime.fromisoformat with a Python 3.6-safe ISO timestamp parser
file: dex_platform/backtest/cl_fee_replay_fast_npz_v3.py
verification: python3 - <<'PY' ... parse_iso_ts('2026-05-06T15:00:00Z')
status: pass
```

Validation rerun completed:

```text
session: oleg_weth_exact_tranche_validation_20260506T150103Z
request: .agent/job_requests/oleg_weth_exact_tranche_validation_20260506T150103Z_20260506T150130Z.request
command: bash dex_platform/scripts/watch_and_tune_oleg_weth_usdc_030_monthly.sh
expected_outputs: DEX_REPORTS/oleg_weth_usdc_030_tranche_tune/{feb2026,mar2026,apr2026}/
log_tail: all monthly Oleg tranche tunes completed
```

## What Changed

Removed the unsupported `from __future__ import annotations` line from the
Oleg tranche replay script and its shared fast NPZ dependency so they can run
on the installed Python 3.6.8. Both scripts now compile under
`python3 -m py_compile` in this workspace.

Also replaced the remaining Python 3.10-style union annotations in the shared
fast NPZ module with Python 3.6-compatible typing so the module imports cleanly
under the installed interpreter.

Added a module-level `import pandas as pd` so the plotting helpers and
DataFrame annotations resolve at import time on Python 3.6.

Replaced the remaining `datetime.fromisoformat` usage with a parser that
handles `Z` and numeric timezone offsets on Python 3.6.

## Files Changed This Run

```text
dex_platform/backtest/cl_fee_replay_tranche_dca_v1.py
dex_platform/backtest/cl_fee_replay_fast_npz_v3.py
docs/AGENT_STATE.md
```

Git note:

```text
git is present, but no commit or push was made.
```

## Decisions Made

```text
1. The validation failure is a tooling compatibility issue, not a data-gap issue.
2. The exact WETH monthly NPZ inputs remain available in this workspace.
3. The tranche validation completed successfully, but the month winners do
   not yet collapse to a single shared tranche configuration.
4. OHLCV proxy artifacts remain screening-only and are not final proof.
5. No signed pilot work is allowed.
```

## Next Single Action

Decide whether the month-specific winners above are strong enough to count as
explicit regime-gated stability; if not, keep S1 open and run a stability
consolidation pass before moving to S2.

## Risks

```text
Paper-live proof is not yet S2; BIO freshness exists but the live watcher may
still need to be pointed at the fresh NPZ path.
The WETH collection used public RPC; future refreshes may need the same
resume/cache settings to avoid provider failures.
The installed Python interpreter is old enough that more syntax compatibility
issues may still exist.
No signed pilot is allowed before S1 and S2 evidence gates pass and explicit
human approval exists.
```

## Operating Rules

```text
Never start dex_control_room or codex_visible_loop.sh from Codex.
Use scripts/request_supervised_job.sh when tmux access is unavailable.
Never read, print, edit, or copy secrets.
Never make signed transactions.
```
